Use global translations in modul - Core developers - PrestaShop

Jump to content

Photo

Use global translations in modul

translate module

#1

Posted 21 September 2014 - 08:51 AM

MrGumby

    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!



#2

Posted 21 September 2014 - 02:17 PM

vekia

    PrestaShop Legend

  • Ambassadors
  • 53036 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


#3

Posted 21 September 2014 - 06:18 PM

MrGumby

    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.


#4

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:

 

https://www.prestash...tions-solution/

 

Regards.





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