Page 1 of 1
Better language support for modules
Posted: Tue Jan 17, 2012 12:39 pm
by Ertenal
If there is one thing i like about magento is the way the use translations. English is the default language, offcourse. If you have a sentence like "Thank you for shopping" you will put this in your template like
Code: Select all
<?php echo $this->__('Thank you for shopping') ?>
The system then tries to translate this using the translate files. If one is found, the translation will be made. So far, the translation system in CMS MS is the same. However, when no translation has been found, it will just print "Thank you for Shopping". If a translation is not found in CMS MS it will say something like
Code: Select all
--Add Me - module:Cardsell string:Thank you for shopping--
Is it an idea to rewrite the translate system in this way? I don't think it will be that hard to copy this feature?
Re: Better language support for modules
Posted: Tue Jan 17, 2012 3:07 pm
by Wishbone
Why would someone write a partial translation? You would think that someone would translate all or none.
Re: Better language support for modules
Posted: Tue Jan 17, 2012 4:01 pm
by Duketown
Ertenal,
Great idea. However when developing it is quickly to see if a translation is available or not. This because also the english text is put in a translation file.
@Wishbone: what if the developer has prepared a new version and added some new front-/backend translatable items? Normally the translations are done after the actual launch of the new version.
Duketown
Re: Better language support for modules
Posted: Tue Jan 17, 2012 4:10 pm
by scelle
In my experience, the non-translated strings are not missing in the translation file, they're just - non-translated. So, if a translator translates only half of the module's strings, the other half is still in English and will not cause any error.
The message that Ertenal quoted is shown only when the matching key is not found in the language (translation) file.
Re: Better language support for modules
Posted: Wed Jan 18, 2012 12:17 pm
by Ertenal
If a language string is missing, for some reason, then i'd rather see the english version of the string then some message that it doesn't exist. This speeds up the process of module development because you don't have to create an english translation file.