Problem
TWiki assumes to know about plurals in other languages: "seconds" is translated as "second" + "s". In Dutch this becomes the incomprehensable "secondens".
The same with "minute" + "s" = "minutens".
Caused by this template text:
"%1 has been editing the topic for %2 and the lease is still active for "
"another %3."
This line is used by
Edit.pm
and
Func.pm
, using
$past = TWiki::Time::formatDelta(
$t - $lease->{taken}, $session->{i18n} );
$session->{i18n}
is the current language. This is only passed when
$TWiki::cfg{UseLocale} = 1
, which is strange, as the language should be retrieved without it.
OK, we are having both
$session->i18n
and
$session->{i18n}
. Only one is correct.
Fixed that in
Item5517, but it doesn't solve the problem.
Solution
It appears that
Lexicon.pm
is fancier than I thought. It has this in the documentation:
#: Hello.pm:11
msgid "You have %quant(%1,piece) of mail."
msgstr "Sie haben %quant(%1,Poststueck,Poststuecken)."
So in the translation file you must write the plural after the singular. For instance with German in
de.po
:
#. ($days)
#: lib/TWiki/Time.pm:290
msgid "%*(%1,day) "
msgstr "%*(%1,Tag,Tagen) "
This will create a correct translated string:
TestUser bearbeitet das Topic seit 1 Stunde 19 Minuten 20 Sekunden und die Ausleihung ist noch aktiv für weitere 40 Sekunden.
--
TWiki:Main/ArthurClemens
- 10 Apr 2008