Harmen Posted January 24, 2017 Share Posted January 24, 2017 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 1 Link to comment Share on other sites More sharing options...
blynx Posted January 24, 2017 Share Posted January 24, 2017 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 : ) 1 Link to comment Share on other sites More sharing options...
Harmen Posted January 24, 2017 Author Share Posted January 24, 2017 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 1 Link to comment Share on other sites More sharing options...
blynx Posted January 25, 2017 Share Posted January 25, 2017 Uh yeah that may be actually! ... you may just try it out the next time - one will work, the other one will throw an error - i always confuse them .... ;P Link to comment Share on other sites More sharing options...
Harmen Posted January 25, 2017 Author Share Posted January 25, 2017 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 More sharing options...
LostKobrakai Posted January 25, 2017 Share Posted January 25, 2017 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 More sharing options...
Harmen Posted January 25, 2017 Author Share Posted January 25, 2017 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 . 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 More sharing options...
blynx Posted January 25, 2017 Share Posted January 25, 2017 https://github.com/processwire/processwire-requests could be a good place to put a feature request ; ) Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 25, 2017 Share Posted January 25, 2017 With the new .csv option for exporting translations of multiple files combined it wasn't to bad to get something working: https://github.com/processwire/processwire/pull/52 2 Link to comment Share on other sites More sharing options...
Harmen Posted January 25, 2017 Author Share Posted January 25, 2017 4 minutes ago, LostKobrakai said: With the new .csv option for exporting translations of multiple files combined it wasn't to bad to get something working: https://github.com/processwire/processwire/pull/52 Great! Will definitely implement this in my module Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 25, 2017 Share Posted January 25, 2017 First this must be merged/approved by Ryan Link to comment Share on other sites More sharing options...
Harmen Posted January 25, 2017 Author Share Posted January 25, 2017 True, but why wouldn't it be approved as it works? By the way I am still not done with a complete revised version of my module and add the translation changes to it, so no haste Link to comment Share on other sites More sharing options...
bernhard Posted April 3, 2021 Share Posted April 3, 2021 I've created an issue in the requests repo - please give it a thumb up to show demand for such a feature! https://github.com/processwire/processwire-requests/issues/396 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now