Jump to content

Translating module


Harmen
 Share

Recommended Posts

Hi all,

Recently I launched a module -ImportPagesPrestashop-, and now I was thinking if it is worthy to translate this module in several languages (starting with a translation in dutch, because I'm from the Netherlands). Is it worth to put the effort into the translation or do you guys think ->English is the best and translations are not needed?

Thanks in advance,

~Harmen

  • Like 1
Link to comment
Share on other sites

Hej!

You should just use the translation function in the places which shall be translated. Then people can translate the module by themselves.

For example:

<?php
// from your module
$f->description = "The pages you import will be given this parent.";

// to
$f->description = _("The pages you import will be given this parent.");

If you install ProcessWires translation stuff and go to the setup of your language and there to "translate files" area thing - you can select your module and translate those exact phrases which are put into _(" blurb ")

Have also a look here: https://processwire.com/api/multi-language-support/

enjoy : )

  • Like 1
Link to comment
Share on other sites

Hey @blynx,

Thanks for your reply. I've read the page you linked and I do have a question about your example. I think it is not 

35 minutes ago, blynx said:

$f->description = _("The pages you import will be given this parent.");

but the following:

Quote

$f->description = __("text") //so double _ 

//or 

$f-description = $this->_("text");

Please tell me if I am wrong, can't test it now unfortunately. 

Regards,

~Harmen

  • Like 1
Link to comment
Share on other sites

I've tried the following 

$f->description = __("Text");

This worked and I am glad it works but I do have some questions.

If I've translated everything to -for example- Dutch, how do I add the translation file to my module? Copy the csv file or json file to my module directory so with the install, you get the translation file too or how does this works?

Cheers,

~Harmen

Link to comment
Share on other sites

That's the bad part about module translation. There's no standard way to share those translations and even less a way to install those automatically, as there's no notion of a "Dutch Language" in ProcessWire. Simply export the translation (as json format if PW <3.0) and add it to your modules files. People can then import it on their own.

Link to comment
Share on other sites

32 minutes ago, LostKobrakai said:

 

That's the bad part about module translation. There's no standard way to share those translations and even less a way to install those automatically, as there's no notion of a "Dutch Language" in ProcessWire.

 

Maybe something for the roadmap in 2017 to solve this issue :rolleyes:. I'll try to revise my module and make a dutch translation for it. If anyone wants to translate the module in another language, feel free to contact me.

Link to comment
Share on other sites

  • 4 years 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
 Share

×
×
  • Create New...