21.03.2013, 14:15
Lawl, this looks amazing man
this is very interesting, it doesnt support formatting does it?
|
[MULTISTRING] en {Hello, %s!}; es {Hola, %s!};
new str[256];
new mes[256];
...
imessage(mes, "MULTISTRING", "en");
format(str, sizeof(str), mes, "John");
...
That doesn't answer the question of why it was done that way in the first place instead of researching existing solutions.
|
For example, translation from French to Polish - it's a real mockery of translator because of different code pages. You can not have two strings (original and translation) in a single file.
|
GetIString error: something wrong with language (NULL, etc.)
#include <imessage> new PlayerLang[MAX_PLAYERS][4]; //player language new imes[254]; imessage(imes, "WELCOME_MESSAGE", PlayerLang[playerid]); SCM(playerid, 0xC0C0C0FF, imes);
It assumes the formatting within the framework of format() function:
istrings.txt: Код:
[MULTISTRING] en {Hello, %s!}; es {Hola, %s!}; PHP код:
You are wrong, researching existing solutions had been done at first. The result is: y_languages' format of text strings was designed for compatibility with y_ini. But it is hard to use for translators and redactors. For example, translation from French to Polish - it's a real mockery of translator because of different code pages. You can not have two strings (original and translation) in a single file. P.S. I've added benchmarks +test code. |