Use global translations in modul - Core developers - PrestaShop

Jump to content


Use global translations in modul

translate module


Posted 21 September 2014 - 08:51 AM


    PrestaShop Newbie

  • Members
  • Pip
  • 22 Active Posts

Hello fellow PrestaShoppers!


I have one particularly usefull question:


When one writes a module, can he use global translations? For example, there already exists translation like "(tax incl.)" in global PrestaShop translations, right? So why define new one in my module? It'll be waste of resources. But use (in smarty)

{l s='(tax incl.)'}

without defining mod='...' does not work.


If there exists any way, how to use global translations in modules, it will be great!


Posted 21 September 2014 - 02:17 PM


    PrestaShop Legend

  • Ambassadors
  • 53122 Active Posts

sometimes context decides what you exactly mean. in addition each language has got own gramatical rules, so for some of the languages and some context {l s='(tax incl.)'} will not be always just "tax incl." but something else

free tutorials, free templates, free addons, responsive prestashop modules MndfRK4.png


Posted 21 September 2014 - 06:18 PM


    PrestaShop Newbie

  • Members
  • Pip
  • 22 Active Posts

Hello vekia,


you are right, that at many circumstances, concatenate translations together could result in confusing meaning, that's for sure. But there are moments, where it could save some time and storage space.

After some research, i do not think, that using other translations from templates will ever be possible. On the other hand, in module class, one could call static methods of class Translate, to get AdminTranslation or PdfTranslation, but it is not very comfortable (i.e. one need to know admin controller, where this translation is used), but it could be somehow utilized. The problem is, I did not found method for front office translations, do you know, where it is?

Edited by MrGumby, 21 September 2014 - 06:19 PM.


Posted 19 August 2016 - 08:30 PM

jordisan (Jordi S.)

    PrestaShop Newbie

  • Members
  • Pip
  • 4 Active Posts

For global translations I implemented this solution that might work for you:





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cookies help us deliver our services. By using our services, you agree to use our cookies.     Learn more