-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Translation in html files using $t() broken? #2056
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
Comments
Just want to add another example where I've experienced the same issue, though the string is not in a template file. In my case trying to translate a string in a core JS file (no override):
String example:
Translation in
Other translations in this theme locale file work fine for in-template translations. |
Translation seems to run via |
Translation is fetched in
|
I will try to make a PR... |
It is already fixed in the |
Internal issue MAGETWO-43935 |
Is this the part that wasn't being translated? @amenk If so, then it still hasn't been fixed because this is the latest develop and we still need to fix it. If it isn't the part you're talking about then could you please point out how to get there? |
I did not followup this. But I checked the js-translate.json and it looked good. I can currently use develop, because I use composer and do not want to mess with that process at the moment. I hope there will soon be another composer release? |
@amenk Yes there is going to be a release soon. But could you please confirm if my screenshot is looking at the correct place in the frontend where you were having this issue? |
Should roughly be the correct place. But I am using the blank theme and I think there is no such popup. |
Okay let me switch themes and try again |
Popup still there with the new theme. We'll get the translation fixed for the popup. Thanks |
@chicgeek, thank you for reporting of the translation issue. |
@arkadiych Okay, is there an internal ticket / further discussion for my issue with |
@chicgeek, MAGETWO-44263 should cover all entries of such type of untranslatable phrases. |
Is this already fixed in the rc master? How can we fix it? We need it urgently. |
There was a hypothetically a fix included in beta 6, however we're still seeing the bug after upgrading. The changelog for CE:
Here is one example that does not translate (similar to the first posted here):
|
@debuysserk, the issue with $t() should be fixed in RC |
@chicgeek, Have you executed next action before check:
If it doesn't help, could you provide a full relative path to *.csv file? |
I'm also facing this problem, for example the Add to Cart button has three phases. The Add to Cart, Adding... and Added. These cannot be translated. I believe translations are done via js-translation.json, but this file is empty by default. When I manually add translations (just for testing) to this file, some translations are used. The Add to Cart button unfortunately not. I'm running Magento 2.0.0. |
Hi folks! This issues still seems to be unresolved...we installed the newest version of Mage 2 a few weeks ago. I created our own theme according to the http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/bk-frontend-dev-guide.html For example:
Translation file is placed in:
A fix would be nice 'cause the majority of our clients speak german... |
Okay, it is somehow working for me now. Even though I failed creating my own language package with the magento commands, I "found out a simple solution".
to the already existing language package folder
Flushed cache and now it is working... |
Although my js-translation.json file is filled with translations now, the Adding... string is still not translated on the storefront. |
Hi @hellsanos! Moving your CSV file to an official Magento directory is not an acceptable solution for the product. You should not have to modify a Magento delivered language pack. (This is not a complaint of what you did, just saying for the Magento folks that this is a workaround, not a solution to the problem.) |
I just found that if the js-translation.json is already present, if you redeploy the contents the js-translation.json is not regenerated. After deleting the js-translation.json files and a redeployment of the static files the js-translation.json files are generated correctly |
the js-translation.json is generated correctly. Using the JavaScript debugger we just discovered that |
Joining in, in my case the "js-translation.json" file only contains"[]" and i cannot figure out why. |
@IceReaper I didn't figure out why, either. As a workaround you can just delete it and rebuild for your locale, e.g.:
|
@niclashoyer thanks for the hint, but that also generated an empty array in the js-translation.json file. Magento 2.0.2 PHP 7.0, unmodified magento. |
@IceReaper Try this explanation: http://www.vanderboon.net/wiki/Install_Test_Magento_2_Translation You also need an symbolic link |
Did not work :/ As a workaround i manualy converted the de_DE.csv to the json - works till the bug is fixed. |
I am running up-to-date development branch. From the product list and the product compare list, the actions of the "add to cart" button are translated correctly From the product view the actions of the "add to cart" button are NOT translated correctly weird....... |
@thomvanderboon I tried this out and it worked correctly for me on latest develop branch. This thread is getting too broad with translation issues and the original issue with $t is already fixed. I will close this now. Please open new issue with specific translation examples if you find any. Thank you guys for reporting this! |
Tried all solutions in this thread and others on the internet without solving the issue with |
@cjohansson Did you find a solution? I have the exact same problem. |
Yes @MidnightDesign, we found a work-around. You can manually edit the |
Manually?? But how do I know which translations are needed in there? So is this actually a bug? Is there an open issue for this? |
I think they should re-open this ticket because the issue remains. @hshar7 |
Same issue here, magento 2.1.2. Having to resort to a CSS :After content solution, for something permanent. please fix. |
Just want to share our permanent solution to this Magento 2 issue. We use a nginx web-server and add server logic to walk-around the Magento 2 problem like this: location ~* js-translation.json$ { Replace ROOT, VENDOR and THEME with your values. So we have a js-translation.json file in our theme and configures web-server to bypass Magento 2 bug to make client-side translations work. |
Bugs - MAGETWO-69496 Impossible specify Bundle option title on store view level with changes to more than one store view - MAGETWO-66793 [Backport] Merchant can't unsubscribe Customer from Newsletter in Admin - MAGETWO-80643 Cannot create orders in the admin for stores other than the default when using Paypal Payflow Pro - MAGETWO-65534 RED BUILD [2.1-develop] [L4] Unstable Tests in L4 Functional Tests EE build on mainline develop: AddToCartCrossSellTest, NavigateUpSellProductsTest, NavigateRelatedProductsTest
cjohansson how did yo resolve that plz |
This is still an issue I have |
This comment was marked as abuse.
This comment was marked as abuse.
yes man you should dive in magento folders and find fr.json file then you
should translate all things thats not translating automaticaly
Le mar. 25 sept. 2018 à 19:41, We are IGET <[email protected]> a
écrit :
… @BenSpace48 <https://github.com/BenSpace48> did you found how to
translate this string? I'm stuck on it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AUDaHZBpLC6wtOXaXEiCC_JvC8lrg02bks5uenjsgaJpZM4GLeSI>
.
|
use text/x-magento-template, .phtml file, $t not working. not be collected into ...././js-translate.json |
Workaround, tested in magento 2.2.6 Copy the file: vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-estimation.html To your theme: app/design/frontend/<your_vendor_name>/<your_theme_name>/Magento_Checkout/web/template/cart/shipping-estimation.html Then the strings are going to be translated: $t('Estimate Tax') |
I needed to copy the shipping-estimation.html file to my theme's folder even in 2.3.3. About five years after this problem has been reported. |
I use beta4 and switched the store language to de_DE. While many strings are just not yet translated to DE, there is a translation in
app/code/Magento/Checkout/i18n/de_DE.csv
for example forIf I am getting it correctly, this is referenced in
app/code/Magento/Checkout/view/frontend/web/template/shipping.html:8
But still the English text is shown.
Is the Javascript translation currently broken?
The text was updated successfully, but these errors were encountered: