i18n() issue

Rob Kaper cap at capsi.com
Mon Dec 8 18:01:48 GMT 2003

I have a new string (in a branch, don't worry) which gives me some problems
with i18n():

i18n("Join %1's %2 Game").arg( player->name() ).arg( game->name() )

If the player name contains "%1", this will result in nonsense like "Join
Monopoly's %2 Game" instead of "Join Rob's Monopoly Game". I'm not willing
to concatenate the string together myself, as this can cause problems with
word order in translations.

I don't think it's desirable to prevent % in all user-definable variables
either. Using dummy keywords as arguments and substituting those after the
translation would mean extra code for each translatable message with
multiple arguments.

So, to sum up: I'm not sure how to solve this.

Another small thing: if %1 ends in 's', the string should be "Join %1' %2
Game". I could check for this, but different languages might need to replace
"'s" under different circumstances than english. How to handle the
possessive suffix in translatable messages?

Rob Kaper     | "In the name of sheer pity, won't someone operate on
cap at capsi.com | Chairman Arafat and put that poor cancer into a cleaner
www.capsi.com | environment? -- Rick Brookhiser
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031208/ec9ae95a/attachment.sig>

More information about the kde-core-devel mailing list