jordisan (Jordi S.) Posted August 19, 2016 Share Posted August 19, 2016 (edited) 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. Any feedback will be welcome! Edited August 19, 2016 by jordisan (Jordi S.) (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 19, 2016 Share Posted August 19, 2016 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? Link to comment Share on other sites More sharing options...
jordisan (Jordi S.) Posted August 19, 2016 Author Share Posted August 19, 2016 (edited) 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 August 19, 2016 by jordisan (Jordi S.) (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now