Jump to content

Global translations (solution)


jordisan (Jordi S.)

Recommended Posts

As it seems there's no native way to implement global translations (i.e., shared translations that can be used in different templates/modules), let me share the solution I have implemented, which I have described in my blog:

 

http://jordisan.net/blog/2016/global-translations-in-prestashop/

 

In short, I'm using a new .tpl file for global translations which can be included from different modules and themes/templates; the string to translate is passed to that template as a variable. Using this solution, these global translations can be managed through PrestaShop's back office.

 

prestashop-global-translations-backoffic

 

 

Any feedback will be welcome!

Edited by jordisan (Jordi S.) (see edit history)
Link to comment
Share on other sites

If I understand right, in that case I think you should use the "standard" solution for translations in those pages (templates); that is {l s="..."}

 

You can also have multiple "global" templates; for example, 0globaltrans-front.tpl and 0globaltrans-back.tpl with different translations for the same strings. And then include one or the other in your tpl files.

 

many times translation depends on context, what if i will want to change the translation for selected pages only? are there a solution for such cases or i will have to use different string?

Edited by jordisan (Jordi S.) (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...