[wp-polyglots] no-code-duplication i18n for WordPress

Lionel Elie Mamane lionel at mamane.lu
Fri Mar 7 12:47:18 GMT 2008


On Fri, Mar 07, 2008 at 11:39:52AM +0100, Stefano Aglietti wrote:
> On Fri, 7 Mar 2008 10:52:51 +0100, Lionel Elie Mamane
> <lionel at mamane.lu> wrote:

>> My code, as currently written, does not let them translate arbitrary
>> PHP code; it takes the pieces of the string that are literal and
>> translates them separately. E.g. when it finds
>>  "the dog named $foo is cute",
>> it translates "the dog named " and " is cute".

> And this is not good, cause first of all we don't see the presence of
> a variable that can change the meanings of the due part of the
> sentence, second, the construction of the sentence shoudl vary a lot
> in various languages.

Yes, I agree, that's why my suggestion/recommendation was to replace
 "the dog named $foo is cute"
by
 sprintf("the dog named %s is cute", $foo)
in the code, so that this case does not arise.

-- 
Lionel


More information about the wp-polyglots mailing list