Poppy381 Posted December 12, 2016 Share Posted December 12, 2016 I can't translate my module with 1.7.0.1 and 1.7.0.2 Originally my module works with 1.6 version. I've try this 2 new methods : BO : $this->trans('string', array(), 'Modules.mymodulename.Admin'); FO: l(s='' d='Modules.mymodulename.Shop') The translationn tool doens't recognize any strings I've try with $this->getTranslator->trans(.... I've also try several cases for my module name. No success. What am I missing ? Do i have to call something specific to translate, i don't find anything in other prestashop native modules... Link to comment Share on other sites More sharing options...
Poppy381 Posted December 12, 2016 Author Share Posted December 12, 2016 Ok I think I get it.....I can't see translations because it's the OLD tool on PS1.7.....but where is the NEW tool to translate guys ? Link to comment Share on other sites More sharing options...
otabary Posted December 13, 2016 Share Posted December 13, 2016 Hi I got the same problem Here ! I've created new translation strings but they are not recognize by the back-office translation tool ... (even after empty the cache)Can someone help ? Is this tool yet implemented in 1.7 ? Thx Link to comment Share on other sites More sharing options...
Poppy381 Posted December 13, 2016 Author Share Posted December 13, 2016 I think that we have to wait new release 1.7.0.3 The only translations that works are with the old way... As i don't want to rewrite my module 2 times, I will wait the tool, or informations about that. Link to comment Share on other sites More sharing options...
otabary Posted December 13, 2016 Share Posted December 13, 2016 It's strange ! In the module I'm looking for (EmailSubscription), they are using the new system : {l s='Newsletter' d='Modules.EmailSubscription.Shop'} with domains instead of mod, and you have the translations in the BO ...The new system should works for new translations exept if we have to declare them somewhere else but I can't find any documentation on this ... Link to comment Share on other sites More sharing options...
Poppy381 Posted December 13, 2016 Author Share Posted December 13, 2016 Nothing strange. New Prestashop modules are written in the new way. But we just don't have the tool to translate. Check the emailsubscription translation : it found 0 entries to translate : http://YOURWEBSITE/YOURADMINDIRECTORY/index.php?tab=AdminTranslations&token=8bb9c80abce4428daf9d5c176fa8f580&type=modules&module=ps_emailsubscription&lang=fr# Link to comment Share on other sites More sharing options...
otabary Posted December 13, 2016 Share Posted December 13, 2016 Yes but if you take the classic theme for this module you have the tpl file overrided and you have {l s='Get our latest news and special sales' d='Shop.Theme'} for the title translation which can be found in the translation tool under shop > theme (if you choose the classic theme). So I think that the translation system is working for theme translation but I'm not able to add a new translation ... Link to comment Share on other sites More sharing options...
Poppy381 Posted December 13, 2016 Author Share Posted December 13, 2016 Yes we can access new Translation tool for everything but not module installed. I don't think it's a good idea to target 'Shop.Theme' instead of your module name as written in documentation . Anyway if you check the AdminTranslator controller l 1285 /** * Get all translations informations for all type of translations * * array( * 'type' => array( * 'name' => string : title for the translation type, * 'var' => string : name of var for the translation file, * 'dir' => string : dir of translation file * 'file' => string : file name of translation file * ) * ) */ public function getTranslationsInformations() { $this->translations_informations = array( 'back' => array( 'name' => $this->trans('Back office translations', array(), 'Admin.International.Feature'), 'var' => '_LANGADM', 'dir' => _PS_TRANSLATIONS_DIR_.$this->lang_selected->iso_code.'/', 'file' => 'admin.php', 'sf_controller' => true, 'choice_theme' => false, ), 'themes' => array( 'name' => $this->trans('Themes translations', array(), 'Admin.International.Feature'), 'var' => '_THEMES', 'dir' => '', 'file' => '', 'sf_controller' => true, 'choice_theme' => true, ), 'mails' => array( 'name' => $this->trans('Email translations', array(), 'Admin.International.Feature'), 'var' => '_LANGMAIL', 'dir' => _PS_MAIL_DIR_.$this->lang_selected->iso_code.'/', 'file' => 'lang.php', 'sf_controller' => false, 'choice_theme' => false, ), 'others' => array( 'name' => $this->trans('Other translations', array(), 'Admin.International.Feature'), 'var' => '_OTHERS', 'dir' => '', 'file' => '', 'sf_controller' => true, 'choice_theme' => false, ), 'modules' => array( 'dir' => _PS_MODULE_DIR_, 'file' => '', ) ); No name, no var for Modules...It seems volontary to not be displayed :'( Link to comment Share on other sites More sharing options...
Poppy381 Posted January 4, 2017 Author Share Posted January 4, 2017 You are right, it doens't work yet, I have the same problem. Hurry up PS dev team I think it's not a minor problem for submitting modules to addons... Link to comment Share on other sites More sharing options...
algspd Posted January 17, 2017 Share Posted January 17, 2017 Exactly same problem here. I just upgraded to prestashop 1.7.0.4 because of this release note: 7193 Fix modules translation form Well, now I can see the translation item in the dropdown... but ps_categoryproducts still shows 0 items to translate, while there are at least 2: {l s='%s other product in the same category:' sprintf=[$products|@count] mod='ps_categoryproducts'} {l s='%s other products in the same category:' sprintf=[$products|@count] mod='ps_categoryproducts'} I can see strings from other modules, I think it is something related to this module or to old .tpl files, although I changed the tpl several times to different formats. Link to comment Share on other sites More sharing options...
algspd Posted January 17, 2017 Share Posted January 17, 2017 I'm asking in stackoverflow too... http://stackoverflow.com/questions/41686971/prestashop-1-7-ps-categoryproducts-is-not-translatable Link to comment Share on other sites More sharing options...
Poppy381 Posted January 17, 2017 Author Share Posted January 17, 2017 Installed ps_1_7_0_4, still the same problem...really annoying :'( ! Link to comment Share on other sites More sharing options...
ThomasBBW Posted January 24, 2017 Share Posted January 24, 2017 I see this: Update - January 2017We’ve been too optimistic when we said the new translation system would be available for contributors’ modules built specifically for PrestaShop 1.7.This is not working. I repeat, this is not working. You should keep using the legacy translation system and it will work just like before. Otherwise you won’t be able to translate your modules, which we want to avoid. We’re still trying to find a workaround so that new modules can benefit from the new translation system, but that is not going to happen in a near future, unfortunately. These comments do not apply to theme development, for the whole theme structure has been redesigned in 1.7. 1.7-specific themes should use the new translation system. Just not modules Source:http://build.prestashop.com/news/new-translation-system-prestashop-17/#as-a-module-contributor Link to comment Share on other sites More sharing options...
Poppy381 Posted January 24, 2017 Author Share Posted January 24, 2017 Sh*t ! So guys said : Hurry up update your modules to 1.7. Nice developers like me think : follow the new rules, so your modules will be up to date for a long time. And now " We’re still trying to find a workaround so that new modules can benefit from the new translation system, but that is not going to happen in a near future, unfortunately." Just a little idea for this STUPID developer which write this message : Do you have any plan to write it on the documentation that IT'S NOT WORKING and to NOT use it we lose a LOT of time to trying to make it work ! An Angry module developer ! 2 Link to comment Share on other sites More sharing options...
Poppy381 Posted January 24, 2017 Author Share Posted January 24, 2017 Update this please, it's important that developer KNOW that it's not gonna work one day : http://developers.prestashop.com/module/05-CreatingAPrestaShop17Module/06-ModuleTranslation.html BTW thank you ThomasBBW for the information Link to comment Share on other sites More sharing options...
PureeMaison Posted August 24, 2017 Share Posted August 24, 2017 Hi there, I hope Im in the right subject, I also tried to translate my module in Prestashop 1.7.2.1 I have a getContent.tpl file with a big form, then register variables in database with processConfiguration and assignConfiguration and display them in a mymodule.tpl. I would like to know if there is a way to translate those variables ? Thanks ! Paul Link to comment Share on other sites More sharing options...
bbinturong Posted April 24, 2018 Share Posted April 24, 2018 Hello from the future ! Still can't use the translation in .tpl ... Someone have an issue ? Link to comment Share on other sites More sharing options...
RdzawoBrody Posted July 31, 2018 Share Posted July 31, 2018 (edited) I use PS 1.7.4.2 I've problem with module translation, example in documentation doesn't work (http://doc.prestashop.com/display/PS17/Module+translation). <h4>{l s='Welcome!' d='Modules.MyModule'}</h4> Solution that works for me: <h4>{l s='Welcome!' mod='mymodule'}</h4> Edited July 31, 2018 by RdzawoBrody Wrong PS version (see edit history) 1 Link to comment Share on other sites More sharing options...
rocky Posted August 1, 2018 Share Posted August 1, 2018 The same problem is happening to me too. PrestaShop hasn't figured out how to get the new translation system working with modules, so we must continue to use the old translation system until they do. PrestaShop v1.7.5 will allow modules to use modern controllers. I'm hoping the translation domains will work with them. Link to comment Share on other sites More sharing options...
pacoverpakkingen Posted April 11, 2019 Share Posted April 11, 2019 This still seems not be resolved. I am running 1.7.2 and still can't translate the ps_emailsubscription module. But it translates to Dutch on its own. Where does that translation come from? Because in the module it says: return $this->trans('Thank you for subscribing to our newsletter.', array(), 'Modules.Emailsubscription.Shop'); 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