[Typo3-dev] Translation of extension

Dmitry Dulepov typo3 at fm-world.ru
Thu Jan 20 20:57:56 CET 2005


Hi!

Well, I have an idea to write a special document about this. It is not 
difficult, there are only a few rules. I already listed the main one (never 
split lines, use parameters and sprintf). Another good one (advanced): do 
not assume parameter order (i.e. that all "%d"s will be in the same order 
after translation). PHP's version of sprintf allow to specify paramter's 
position like this:
    "%1\$d of %2\$d".
This will allow to translate something like: "Found %2\$d, displaying %1\$d" 
while code still uses "sprintf($format, $displaying, $total)" formatting 
code.

When creating keys for lines (this what goes before "=>" sign in the 
locallang.php), use meningfull names. Do not use "number.of", use 
"number.of.messages.displayed.and.total". This is much easier to understand 
for translator.

Some languages have very different phrases for singular and plural. In 
English it is quite natural to write "page(s)" but it is not the same in all 
languages. Many well-written programs have separate lines for singular and 
plural version.

It does not look exciting for those who interested mainly in creating 
fantastic new things but this is what creates a high quality product. Bad 
implementation may spoil even a brilliant idea. So localization should be 
considered as a very important thing for the product that goes to the 
international market.

This is all what quickly came to my mind. Surely if I sit and think I will 
remember much more :) I once had to prepare a large set of programs for 
localization to 4 european, hebrew and korean language... That was a great 
lesson.

Dmitry.

----- Original Message ----- 
From: "Peter Kindström" <peter.kindstrom at abc.se>
Newsgroups: typo3.dev
To: <typo3-dev at lists.netfielders.de>
Sent: Thursday, January 20, 2005 7:26 PM
Subject: Re: [Typo3-dev] Translation of extension



Hi Dmitry,
> One more big problem I see is that many extension authors just do not know
> how to create code suitable for localization.

  [snip]

> Extensions authors MUST always put full lines of text to language files 
> and
> use sprintf to format values. This must be a requirement to a
> correctly-written extension!

Is there any rules/best practice written down for this? If not,
maybe a "Translation guidelines" should be written? Maybe on the
wiki? (http://wiki.typo3.org/index.php/Translation_guidelines)

I mean, if extensions authors really want to get it right, they
should be able to read about the requirements somewhere...


/Peter Kindström 





More information about the TYPO3-dev mailing list