Hello, I was trying to get a translation key and I came across a problem.
First code, return TransKey_Bad.
Code:
formatex(szTransKey, charsmax(szTransKey), "ZOMBIENAME %s", rgZombieClass[ZOMBIE_SECTION]);
if (GetLangTransKey(szTransKey) != TransKey_Bad)
formatex(rgZombieClass[ZOMBIE_NAME], charsmax(rgZombieClass[ZOMBIE_NAME]), "%L", this, szTransKey);
Code:
[bp]
ZOMBIENAME Heavy Zombie = Zumbi Pesado
Now if replace " " with "_", return the right translation key.
Code:
formatex(szTransKey, charsmax(szTransKey), "ZOMBIENAME %s", rgZombieClass[ZOMBIE_SECTION]);
replace_string(szTransKey, charsmax(replace_string), " ", "_");
if (GetLangTransKey(szTransKey) != TransKey_Bad)
formatex(rgZombieClass[ZOMBIE_NAME], charsmax(rgZombieClass[ZOMBIE_NAME]), "%L", this, szTransKey);
Code:
[bp]
ZOMBIENAME_Heavy_Zombie = Zumbi Pesado
If the transkey contains white spaces, the GetLangTransKey always return -1. Is this a bug or is there one "restriction" related to lang file format (syntax)?
__________________