[Owncloud] L10N and the way to translate

Thomas Tanghus thomas at tanghus.net
Mon May 28 00:15:14 UTC 2012


On Monday 28 May 2012 01:11 Florian RĂ¼chel wrote:
> On the subject of how we translate string in ownCloud. I couldn't find a
> lot of discussion on this subject and since I just joined in ownCloud, I
> hope I can get some feedback on the reasons why certain decisions were made.
> 
> First off all, I come from Joomla and my main experience originates from
> here. I have worked with other CMS in PHP but most of what I will state
> is based on the Joomla practices.
> 
> The ownCloud way: As you all know, ownCloud translates by using an array
> called $TRANSLATIONS and calls it via the language interfaces
> t()-function. The general practice (at least in all the code I found),
> was to use the english text as the key for all languages.
> 
> The Joomla way: Joomla offers a static function (which internally also
> calls a language-instance) to translate strings. In Joomla the general
> practice is to use a describing string like COM_CONTENT_ARTICLE_TITLE
> which would then be translated to the current language. All strings are
> defined in a language-ini file which is read by the PHP-parser.
> 
> Now here comes my opinion:
> I have a hard with one language being the key for another. I imagine
> wanting to change that string. I would have to change it in *every*
> lang-file. Of course, I can accomplish that with scripts and such, but
> it strikes my as no good practice.

I don't know how much trouble it is to update the translations, but I for one 
really prefer having natural language (English) as the key for translations. 
Even though they may change more often, I find it easier to put into context 
when having a proper string to translate, rather than and artificial 
"constant" which often tends to end up just as long anyways, and harder to get 
the meaning from.

I'm working on a proposal for a templating system which uses the current 
translation backend, but adds an easy way to use variables in the translation 
string.

At first glance I found using PHP arrays a bit unelegant (in lack of better 
words), but on seconds thought I like the KISS of it ;-)

-- 
Med venlig hilsen / Best Regards

Thomas Tanghus



More information about the Owncloud mailing list