Jump to content
  • 0
MrGumby

Use global translations in modul

Question

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!

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
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

×