Jump to content

Custom translations


rOskar

Recommended Posts

Hello!

What is the best and easiest way to make custom, new translations?
I found information that if You want to translate missing lines of module, it is good way to:

Quote

you can copy the templete file in the theme directory like:

themes/your_theme/modules/ps_wirepayment/views/templates/hook/payment_return.tpl

And then change the domain for all strings, instead of {l s="My string" mod="ps_bankwire"} use something like {l s="My string" d="Modules.Wirepayment.Shop"}

You will then be able to translate all strings as part of your theme (International -> Translations -> Theme)

I changed this line in my tpl, but translation did not show at BO translations. Do i have to reload translations somehow, to make it appear? Whenever I edit file app/resources/translations/pl-PL/ModulesWirepaymentShop.pl-PL and put at the end:

Quote

  <file original="modules/ps_wirepayment/views/templates/hook/payment_return.tpl" source-language="en" target-language="pl" datatype="plaintext">
    <body>
      <trans-unit id="b2f40691858b401ed10e62bdf022c705">
        <source>Please specify your order reference %s in the bankwire description.</source>
        <target>Translated %s example.</target>
        <note>Context:
File: modules/ps_wirepayment/views/templates/hook/payment_return.tpl:34</note>
      </trans-unit>
     </body>
  </file> 

And replace it via FTP - shop crashes and there is error 500. Translating payment_return.tpl is just example, I would like to know how to add new translations at any place of my shop.

 

 

 

Link to comment
Share on other sites

  • 1 month later...

I think it was not working, because I put manually code to app/resources/translations/pl-PL/ModulesWirepaymentShop.pl-PL file. My problem was partially solved by exporting language from translation page - as point 2 in "case 2" at below page:
http://build.prestashop.com/howtos/translation/how-to-translate-your-theme/

In fact, case 2 is working fine for theme files, such as themes/x/templates/catalog/product.tpl. But it is not working when I put for example this code to tpl of any module:

Quote

{l s='Translation here' d='Shop.Theme.Mytheme'}


I understand this way we can translate themes, not modules.

EXAMPLE
Module ps_wirepayment - adding any code like this to tpl (modules/ps_wirepayment/views/templates/hook/payment_return.tpl):

Quote

{l s='My custom translation for module' d='Modules.Wirepayment.Shop'}


is not working - translation is not showing at BO and we can not see new line of text at front. I followed many articles about this issue but noone seems to work. Wirepayment module is just example, there is problem with others too. Prestashop 1.7.4.2.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
  • 8 months later...

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...