Prestashop: [BOOM-4237] Core translations not available in custom theme - missing expressions

Created on 22 Aug 2018  Â·  25Comments  Â·  Source: PrestaShop/PrestaShop

This issue has been migrated from the Forge. Read the original ticket here.

  • _Reporter:_ podemski
  • _Created at:_ Sat, 4 Nov 2017 00:41:03 +0100

For some reason we can't access core translations like this ones from NewProductsProductSearchProvider and other controllers while translating our custom themes.

Proposed solution:
https://gist.github.com/kpodemski/c21c8b0a7ca3793ce39a3bff1a3932bb

basically we want to get all default translations and merge them into custom theme translations.

What do you guys think?

  • How to reproduce the issue ?

Install custom theme, try to translate sorting options on "New products" page to something else

Steps to reproduce the issue:

  1. Use the default "classic" theme.
  2. Go to tab International->Translations, select "Theme translations", "classic" and language:
    image
  3. You can see that everything is fine:
    image
  4. Now create a copy of the "classic" theme for example "classic2" or use any other custom theme.
  5. Go to translations:
    image
  6. You can see missing translations and missing expressions:
    image

A solution to fix:

I see that I can edit the file:
\src\PrestaShopBundle\Service\TranslationService.php
and change here "classic" to "classic2" (or another theme name) and all default translations and expressions are displayed, but after this custom theme translations in the tab Shop->Theme->Mytheme are not available.

1.7.2.0 1.7.4.1 1.7.5.2 1.7.6.0 1.7.6.3 Bug International Minor Modules & Themes PR available TBS Translations

Most helpful comment

Encountered the same on new installation of 1.7.6.5 with a free theme installed.

While presta is an awesome product, I have to say, many of the default strings are very scary to customers "order with an obligation to pay" or "adhere to them unconditionally" are just not user friendly IMHO

All 25 comments

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ salma.moakhar
  • _Created at:_ Wed, 15 Nov 2017 12:11:35 +0100

Hi Krystian Podemski,

Could you please a PR with your solution.

Thanks & best regards, Salma

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ podemski
  • _Created at:_ Tue, 30 Jan 2018 22:10:01 +0100

Can someone from the team look into this and take some actions to fix this issue? It's really annoying and i'm pretty sure that my solution is not the best one available, i'm not experienced with Symfony translator tho

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ marion_francois
  • _Created at:_ Wed, 31 Jan 2018 09:09:26 +0100

ping Pablo Borowicz

Still an issue in 1.7.5 @eternoendless

Any news on this subject?
Or maybe we wait for PS 1.8?...

ping @eternoendless

Created at: Sat, 4 Nov 2017 00:41:03 +0100...

with proposed solution...

@kpodemski If I understand correctly, this issue is about using a core wording, then trying to change the translation of said wording on the BO in the context of your specific theme?

@eternoendless It's about editing core wording like "Your account isn't available at this time, please contact us" (ajax wording error) in specific theme (all other than classic theme).

@marionf @eternoendless can we please bumb it to higher priority? it's not a minor issue, basics translations are not working, more details in #13836

Did you try inserting the translation directly in ps_translations? If that works then the "Minor" severity is correct (you'll learn more about why in an upcoming blog post on Build). If not, then it can be bumped to "Major".

Either way, I'm adding this to the 1.7.7 roadmap.

@eternoendless Hello, I don't understand "insert directly in ps_translations" ? We talk about 1000 core translations

If I got it right, the wordings are being translated correctly, you just want to customize it on your specific theme? Or are you suggesting that NO wording is working right on your theme, just on classic?

Yes, we have specific theme and we want to customize core translations (like ajax message from controller).

In that case, as a workaround, you should be able to insert the translation directly in the database, in the ps_translation table. Here's an example using the classic name

id_lang | key | translation | domain | theme
-- | -- | -- | -- | --
1 | Choose a file | Choissisez un fichier | ModulesBannerShop | classic

  • id_lang: This is the id of the language you are translating to. Look in ps_lang to find out which id matches the language you are targeting.
  • key: The original wording. It's best to copy and paste it, it must be exactly the same as the one used in the code.
  • translation: Your translation.
  • domain: The translation domain as it appears in the code (remember to remove dots).
  • theme: The theme name. If it's not "classic", this should match your theme's.

After editing this table you will need to clear your shop's cache.

Maybe that work's but why we need to do that ? For no-developpers users who just bought theme and install it ?

It's a _workaround_ – that means a solution that's not ideal but works right now. The alternative is to sit and wait while it gets fixed. I'm trying to help you here.

Oh okay :) thanks @eternoendless , I missunderstood you !

Why this issue is not in the Project 1.7.6 but one month with the label 1.7.6.0 ?
up @eternoendless

@alex4102, in fact, this issue is not fixed yet in the PS1.7.6.0.
The label 1.7.6.0: it is the Affects Versions.
But this issue should be fixed in the next minor Release 1.7.7.0.
It is added to the 1.7.7.0 milestone.

Thanks!

Oh okay thanks for this information.

Hi,

Same issue with PS1.7.5.2 and PS1.7.6.3.

Thanks!

So we have to wait 1.7.7.0 to see this fix ?

Encountered the same on new installation of 1.7.6.5 with a free theme installed.

While presta is an awesome product, I have to say, many of the default strings are very scary to customers "order with an obligation to pay" or "adhere to them unconditionally" are just not user friendly IMHO

Hi,
Is there a current tagged release date for this problem?
Would like to know if its in the horizon for a fix.

This should be fixed by #19487

Was this page helpful?
0 / 5 - 0 ratings