Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some texts are not translated #2951

Closed
jaimestuardo opened this issue Jan 10, 2016 · 45 comments
Closed

Some texts are not translated #2951

jaimestuardo opened this issue Jan 10, 2016 · 45 comments
Labels
bug report Component: Translation Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@jaimestuardo
Copy link

I have found another bug in Magento 2 and it is concerning translation. I have placed translation file: /app/i18n/desytec/es_es/es_ES.csv to translate to Spanish.

It works but not for some texts. For example, if you connect to http://www.vtrack.cl/catalogsearch/advanced/, you will see almost all form texts in English instead of Spanish. Maybe texts are hard coded, because if you see "Advanced Search" text at the bottom of the page it was translated correctly into Spanish, but not in the Title.

If I searched the entry in the CSV file, i saw:
"Advanced Search","Búsqueda avanzada"

The same for all fields in form and for other pages.

Other case is the contact form page: http://www.vtrack.cl/contact/. "This is a required field." message validation is still in English even when it is translated in CSV file. This happens to all forms.

Regards
Jaime

@sIiiS
Copy link
Contributor

sIiiS commented Jan 10, 2016

They are attributes and you should add your word in the "Default Store View" in product attributes
go to "Stores -> Attributes -> Product" and change them!

@jaimestuardo
Copy link
Author

You are wrong or misunderstood the issue.

You are talking about attributes for product catalog, however, I was talking about translation that has nothing to do with products, for example, translation for the sentence "Advanced Search" title as clearly says in the issue description.

Regards
Jaime.

@jaimestuardo
Copy link
Author

it is not cache problem... you have just actually confirmed that it is a bug. For example, with respect to "Advanced Search" you said that I need to open a core file and change the text. Do you think it is a normal procedure for a multilanguage site? why is not the translation file taken into account for this sentence? This sentence is translated in the CSV file.

By the way, "Advanced Search" was only an example. Along the site, there are many other non translated titles. Another one is "Contact Us" form title. Please connect to: http://www.vtrack.cl/contact/. You will see "Contact Us" as the title, but the link at page bottom you will see the right Spanish version "Contáctenos". And in the CSV file, this entry exists:

"Contact Us","Contáctenos"

This entry should translate the form title, but it did not.

Regards,
Jaime

@sIiiS
Copy link
Contributor

sIiiS commented Jan 10, 2016

Yes, for "Advanced Search" and several titles and lables!
Also for Cache lable and descriptions too!

"Advanced Search" is here
{magento2 root}/vendor/magento/module-catalog-search/view/frontend/layout/catalogsearch_advanced_index.xml
in this file you can find it : <title>Advanced Search</title>

@jaimestuardo
Copy link
Author

What about "Contact Us" title? "You have no items in your shopping cart." text? or "This is a required field?" validation message? All of them are not translated even when that texts exists in the CSV file.

You said that for "Advanced Search" and several titles, it is needed to correct in the core files, but, I think Magento developers should be notified about this so that make all of these translatable texts.

@thomvanderboon
Copy link

Please search the open issues in this Github. Multiple issues have already been opened and confirmed

@jaimestuardo
Copy link
Author

Concerning "Privacy and Cookie Policy" text I have found the correction to this bug.

First, this entry was in /module-cms/view/frontend/layout/default.xml file this way:
[argument name="label" xsi:type="string"]Privacy and Cookie Policy[/argument]

I have added "translate" attribute, so that it became:
[argument name="label" xsi:type="string" translate="true"]Privacy and Cookie Policy[/argument]

However, this did not work either because "Privacy and Cookie Policy" text was not in CSV file (the one that was generated using the magento application, another bug?). So, I have added "Privacy and Cookie Policy" entry to the CSV file and problem was gone.

Concerning "Advanced Search" and "Contact Us" texts, I have changed directly in core files as suggested.

I could not find the "required field" message yet, but I keep looking.

@cescopag
Copy link

cescopag commented Feb 9, 2016

I found are at least three ways titles are set:

1) with title tag

<head>
    <title>Advanced Search</title>
</head>

which doesn't translate

2) with reference to page title

<referenceBlock name="page.main.title">
    <action method="setPageTitle">
        <argument translate="true" name="title" xsi:type="string">My Dashboard</argument>
    </action>
</referenceBlock>

which translates correctly,

3) directy via PHP

$this->pageConfig->getTitle()->set(__('Create New Customer Account'));

which translates correctly as well.

This is very confusing and need to be unified.

@antboiko antboiko added the PS label Feb 15, 2016
@DavidLambauer
Copy link
Contributor

Is there any Update? We still have the problem that we cant translate titles correctly without a workarround.

@mktudock
Copy link

We also have this issue. We can't translate the title of the Contact page because it uses method 1 which is not translatable.

@lucas-santos-chaordic
Copy link

We are facing a similar problem, but it happens when we use accented letters, like í ú. In portuguese it is very common to have words with accents... In this case, some translations are not shown in the frontend. Any ideia?

@pareshe
Copy link

pareshe commented May 17, 2016

Edit this file "vendor/magento/module-theme/view/frontend/templates/html/title.phtml"(So for that first copy that to theme).
Replace :

$title = '<span class="base" data-ui-id="page-title-wrapper" ' .  $block->getAddBaseAttribute() . '>'
    . $block->escapeHtml($block->getPageHeading()) . '</span>';

With:

$title = '<span class="base" data-ui-id="page-title-wrapper" ' .  $block->getAddBaseAttribute() . '>'
    . __($block->escapeHtml($block->getPageHeading())) . '</span>';

This will work for me "/contact","sales/guest/form/" etc page.

@PieterCappelle
Copy link
Contributor

Any update about this? Same problem about the tag "Forgot Your Password" you can't translate. This should be fixed. Thank you!

@thomvanderboon
Copy link

@PieterCappelle This issue has already been fixed in latest development branch. Will be moved to stable branch in one of the upcoming releases.

@PieterCappelle
Copy link
Contributor

@thomvanderboon Great! I can't find anywhere in this issue that it has been fixed, how do you know such a things? (we are always working on stable releases like 2.0.6 right now)

@Korniow
Copy link

Korniow commented Jul 1, 2016

I've created a patch for "Privacy and Cookie Policy" translation in pull request #5400

@vkorotun vkorotun removed the PS label Aug 4, 2016
@wert2all wert2all self-assigned this Aug 16, 2016
@wert2all
Copy link
Contributor

Thanks for response. Internal ticket MAGETWO-56872 was created.

@wert2all wert2all added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 16, 2016
@wert2all wert2all removed their assignment Aug 17, 2016
@jernejh
Copy link

jernejh commented Sep 22, 2016

Any news regarding the "Advanced Search" as a title string? Problem still persists in 2.1.1 version.

@cuiyang000
Copy link

"Forgot Your Password" not translatable problem still exists in 2.1.1

@paales
Copy link
Contributor

paales commented Nov 18, 2016

The issue doesn't seem to be that it is untranslatable. It seem that 'Forgot Your Password' isn't in the translation package. Magento should add those to the Crowdin translations as well.

@rramiii
Copy link

rramiii commented Dec 25, 2016

any updates regarding this?? still same for me on 2.1.1

@hezide
Copy link

hezide commented Dec 31, 2016

same issue in magento 2.1.3

@LucScu
Copy link

LucScu commented Jan 27, 2017

GREAT we are celebrating 1 year open bug, thx magento team

@siliconalchemy
Copy link

@thomvanderboon thanks for the workaround, but it's not working for me in 2.1.5. I've followed the steps above exactly, but the en_GB translation I'm trying to create just gives lots of blank js files, and the nl_NL files only give a single translation:

more ./var/view_preprocessed/source/adminhtml/Magento/backend/nl_NL/jstranslation.json
{"Are you sure you want to do this?":"Weet je zeker dat je dit wilt doen?"}

@thomvanderboon
Copy link

Please note

a) if translation is same as original it will not be in the json file.
b) You need to reload the page twice

@siliconalchemy
Copy link

But for example this file:
./pub/static/frontend/Magento/blank/nl_NL/js-translation.json
just contains '[]'. Shouldn't it be full of translations?

magento-team pushed a commit that referenced this issue Mar 26, 2017
 - Merge Pull Request #5400 from MindConflicts/magento2:Privacy-Policy-translation-patch
@jeanpham
Copy link

Hi Thomvanderboon, Thanks for your explanation. I have tried to follow your instructions, but unfortunately, it doesn't work. My Directory structure looks like this (please see screenshot). Is that correct?

https://snag.gy/OMEUr7.jpg

E.g. "Order Summary" is in the CSV, but it is not translated.

Thanks!

@indraprasetya
Copy link

indraprasetya commented May 9, 2017

Hi thomvanderboon, I have tried to follow your instructions and the page was translated on my local pc. Why after bundle js on server EC2 AWS (nginx) the translation in validation.js like (this is a required field.) the message not translate?

@tsifra
Copy link

tsifra commented May 18, 2017

I'm on 2.1.6 i'm still not able to translate /catalogsearch/advanced/ page title. I think rewriting theme files is not right way for this.

@VincentMarmiesse
Copy link
Contributor

Hello,

I'm also on 2.1.6 and I'm not able to translate the Contact page title.

@alejandromartincruz
Copy link

alejandromartincruz commented Jun 7, 2017

Hello,

2.1.7 and I have problems to translate some elements of the cart, and the checkout.

'Go to checkout', 'Cart total', 'View and edit cart', 'Shipping address', 'Order summary', 'Shipping methods' and mainly every single one validation message of the checkout form, and some other ones.

@EliasKotlyar
Copy link
Contributor

Hello everyone.

If someone encounters a Problem with loading order of the translations(not the generation of the js-translation.js), you may find the following Issue interesting:
#7363

Greetings
Elias

@KarlComSe
Copy link

Part of the issues, with page titles not translating is described here #6337 and a solution is proposed here #9992. It solves the contact us issue and likely other page title issues. Does any title problems still exist?

In the response of @thomvanderboon, what is the difference between what you are proposing and creating a localization?

In front of what @jeanpham describes, I'm on 2.17 and don't have the same issue (where I am able to find the corresponding English and translated sentences you refer to). If those errors still exist, could you specify where you see them? In addition, could you also describe what happens if and when you use the inline translation tools on these sentences?

@tommybds
Copy link

Found out that my translations problems were because of deploying files.

with this :php bin/magento setup:static-content:deploy
problem with CSS and JS

php bin/magento setup:static-content:deploy -l en_US -l fr_FR
Problems with some translations not working (due to overwriting)

php bin/magento setup:static-content:deploy -l fr_FR
No more problems

So final solution for me was to launch these line in a upgrade.sh file at the root of magento :

php -f bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -l fr_FR
php bin/magento cache:flush

@jonathan-martz
Copy link

Is the Bug now fixed ?

@DripperCoffee
Copy link

Run the following commands from document root:
find . -name js-translation.json -exec rm -rf {} \;
php bin/magento setup:static-content:deploy en_US 
php bin/magento setup:static-content:deploy nl_NL
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

DO NOT and I mean DO NOT run the php bin/magento i18n:pack command. Keep the translation file in one file.

@thomvanderboon This was of great help but I have a problem. Before finding these instructions I actually went ahead and ran the above command you suggested absolutely not to run. So now, whenever I do setup:upgrade or similar action, the manually added pack translations are lost.

Is there a way to remove additional packages and only keep the manually added translation? Of course I would like to keep i18n files for modules that are not included in the core translation files.

@thomvanderboon
Copy link

thomvanderboon commented Aug 28, 2017 via email

@synpatic
Copy link

I'm facing the same problems with Finnish translations (Magento ver. 2.1.7). The main pages are translated but all the Magento_Checkout translations are in English.

Once I got it working with
find . -name js-translation.json -exec rm -rf {} ;
php bin/magento setup:static-content:deploy en_US
php bin/magento setup:static-content:deploy fi_FI
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush

I though that this will be the permanent solution... but I was totally wrong.

When the set of commands were rerun the all checkout texts are back in English.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Component: Translation labels Sep 11, 2017
@magento magento locked and limited conversation to collaborators Sep 12, 2017
@magento-engcom-team
Copy link
Contributor

Hello everyone. Thank you for your reports, suggestions and comments. Unfortunately, we should lock this issue for now. We already fixed most of the cases described in this issue and will deliver the fixes with release 2.2.0 very soon. If you still have other issues, please, report separate issues otherwise this will be infinite loop. Thank you for collaboration!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug report Component: Translation Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests