Better language support for modules

General project discussion. NOT for help questions.
Post Reply
Ertenal
Forum Members
Forum Members
Posts: 19
Joined: Fri Sep 30, 2011 2:28 pm

Better language support for modules

Post 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?
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Better language support for modules

Post by Wishbone »

Why would someone write a partial translation? You would think that someone would translate all or none.
Duketown

Re: Better language support for modules

Post 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
scelle
Forum Members
Forum Members
Posts: 81
Joined: Sun Apr 24, 2011 8:14 pm
Location: Montenegro

Re: Better language support for modules

Post 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.
Ertenal
Forum Members
Forum Members
Posts: 19
Joined: Fri Sep 30, 2011 2:28 pm

Re: Better language support for modules

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

Return to “General Discussion”