msgid "king"
msgstr<0> "kralj"
msgstr<3> "kralja"
msgstr<5> "kraljem"

msgid "move %s"
msgstr "premesti %<3>s"

msgid "go with %s"
msgstr "idi sa %<5>s"


Im curious, how you would implement this?

if I call the following in some preexisting application:
printf( gettext("Please move %s."),  gettext("king") );

the order of operations is :
gettext("king");
gettext("Please move %s.");
printf( %s , %s );

So how would the first gettext("king") know what to return?

I think you could get this to work if there was some sort of context,
which could be used to tie the whole thing together.
such as:

void *ctx = gettext_context("Please move piece.");
printf( gettext(ctx,"Please move %s."),  gettext(ctx,"king") );


The default for context could be NULL, in which case there is no special behavior, but in cases where exceptional handling is required you could provide override strings. Context would have to be a mandatory part of each gettext call...








-- Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/



Reply via email to