Jump to content
finnenhawke

PrestaShop 1.7.5.1 - Translations not saving / updating

Recommended Posts

I'm using PrestaShop 1.7.5.1 with GamesHouse Theme from official Marketplace and some marketing modules.

The problem is that translations are not always being saved, no matter what module I edit. Basically, the rule of thumb is that when I open the translation menu for the first time, it will save properly. However, when then I edit more lines and try to save changes again, they won't save. Last translated fields become blank again, only the first batch remains translated. To be able to translate again, I have to log off and log back into administration panel. Then sometimes it works again, and sometimes even then it doesn't work and I have to just try saving over and over again until it finally saves.

Does anyone have some experience with that? Is that some kind of borderline aggressive caching from my hosting provider or what? 

Share this post


Link to post
Share on other sites

I will observe this topic as I have a corresponding issue with the same Presta version.

In my case translations are nicely saved in the back office but the front end of the site is not bothered by the changes... Even after clearing the cache. Classic theme (Presta's default).

Share this post


Link to post
Share on other sites

I also experience this after updating to 1.7.5.1

Share this post


Link to post
Share on other sites
Posted (edited)

The updated translations (is saved) but is not updated in front or back office, is still displayed the old value (1.7.5.1)

 

Edited by TonyJP (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

I think you observe this because of enabled caching. Clear the caches or disable them temporarily. It happens for product edits as well, at least for me, that is.

 

Also, I have another problem with translations, which is that they are updated (I even see them through PHPMyAdmin in the tables) but still with all caches turned off, the texts in the contact form are not changing from English.

Other texts change, just those in the contact us and some partially translated strings in the cart stay in English. I checked them in the MySQL DB and they are translated, exported the language and they are translated. I have no idea what to do.

I think it is something from my theme Vinova Sport but I don't know what. Also at seemingly random, some of the translations just reset and clear to English and I have to translate them again which is weird and it happened about 5 times already.

Edited by wutsdis (see edit history)

Share this post


Link to post
Share on other sites

I have same thing as you wutsdis but with some other strings.

Share this post


Link to post
Share on other sites
Posted (edited)

The only workaround for the strings to appear translated is to hardcode them translated into the theme template code, but I don't like that solution particularly. 😞

Edited by wutsdis (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

This had cost me so much time to solve. I hope it will help someone else. In my case, it seems that the theme creator made some kind of a problem. I am using the Vinova Sport theme.
 

The problematic strings I had were in the checkout templates, there were also some others in the /layouts and possibly more in other places. I changed their domain, in my case:

from

d='Shop.Theme'

to

d='Shop.Theme.Checkout'

and for some of the other missing strings from 

d='Shop.Theme'

to

d='Shop.Theme.Global'

Then I translated them from the back office and it worked.

Edited by wutsdis (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

Glad that worked for you. ;:)

I'm still confused... One of the ones that doesnt work for me was:

{l s='Showing %from%-%to% of %total% items' sprintf=['%from%' => $pagination.items_shown_from ,'%to%' => $pagination.items_shown_to, '%total%' => $pagination.total_items] d='Shop.Theme.Catalog'}


I changed it to this and it works (as that old string already was translated long before).

{l s='Showing %from%-%to% of %total% item(s)' d='Shop.Theme.Catalog' sprintf=['%from%' => $pagination.items_shown_from ,'%to%' => $pagination.items_shown_to, '%total%' => $pagination.total_items]}


However, changing it and then translating the new string says "saved" and then doesn't show up in front office :(

{l s='Showing %from%-%to% of %total% products' d='Shop.Theme.Catalog' sprintf=['%from%' => $pagination.items_shown_from ,'%to%' => $pagination.items_shown_to, '%total%' => $pagination.total_items]}





Also, after it says that the translation got saved. It will say this above the field:
ShopThemeCatalog - 1 expression - -1 missing

Edited by nom (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

I used these docs, maybe you could find something helpful in there https://devdocs.prestashop.com/1.7/development/internationalization/translation/translation-domains/

Try to add just the simple text string first and see if it works, maybe there is a problem with the %placeholders%.

I also get that red missing text warning a lot of times when saving, sometimes it increases to -5. I have no idea what it means.

Edited by wutsdis (see edit history)

Share this post


Link to post
Share on other sites

Tried {l s='Showing test' d='Shop.Theme.Catalog'} and that worked. :S Thank you so much for your advice. I will do a work around with the placeholders.

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/23/2019 at 12:36 AM, wutsdis said:

I think you observe this because of enabled caching. Clear the caches or disable them temporarily. It happens for product edits as well, at least for me, that is.

 

I have completely and utterly disabled cache, yet it still happens. I also tried cleaning it every time I save. What I noticed, however, is that I simply have to wait after each time I save a new translation. So yes, you're partially right - it is caused by some kind of cache, even when I disable all of caching functions in PrestaShop settings.

What actually happens is that when I press "Save" the translation is correctly saved to the PHP file (modules/module_name/translations/pl.php). The translation file gets immediately updated on the server. However, it simply takes some time for PrestaShop to detect the updated PHP file and show the translations in the administration panel 

In other words, every time I am translating something, I make sure to simply wait around 5-10 minutes each time I press "save". I press "Save", the website reloads and the translations fields remain empty. That's the moment where I have to wait. I leave the translation settings and come back after 5-10 minutes. Boom, last translations show up and I can continue adding more. 

I have to be careful not to press "Save" again before PrestaShop detects previous translations. If I do it before PrestaShop detects the last translations they will be replaced with empty strings. SUPER annoying. I think it might have to do something with the cache on the website hosting for PHP files?

Edited by finnenhawke (see edit history)

Share this post


Link to post
Share on other sites

Yes, this is what is doing it for me, it is called OPcache, I should've been more clear. It is something you should have control over from the cpanel of your hosting provider.

Share this post


Link to post
Share on other sites

I am using Prestashop v 1.7.5.2 and it seems the module translation is not working (empty fields after submit, not saving). Anyone found how to solve this?
 

Share this post


Link to post
Share on other sites

I had a similar issue and just could not save the Shop > Theme > Catalog translation properly.  I manually entered the row in table ps_translations.  It worked.

Share this post


Link to post
Share on other sites

This is so freaking annoying!!!

1.7.6.1, opcached disabled.. I translate one string and there... done for the day...

Has this been figured out already? The issue is closed!

Share this post


Link to post
Share on other sites

The new translation system is bugged. I posted a report starting from here: https://github.com/PrestaShop/PrestaShop/issues/15432#issuecomment-528809111

I had problems with a theme and some modules. The theme could have an error breaking the file parsing.
About the module i could resolve translating it manually, like the old method (module folder, "languages", file with iso code .php). The problem could happen with old modules. The BO could have empty strings, or they could seem working, but the xlf files are ignored, so the module remains not translated. I reported the solution here https://github.com/PrestaShop/PrestaShop/issues/15432#issuecomment-528836586

They suggest to report the problem to the module/theme developers, but i had to guess by myself what was going on... and hopefully i fond the work around.

 

Share this post


Link to post
Share on other sites

My problem is the string is already translated but i need to change it.. It changes in the backoffice but the frontoffice remains the same..

I try again the next day and it works..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More