crlib: reworked dictionary to hashmap.
linkage: another fix to dynamic linkage. cpp: fixed msvc warning about placement new.
This commit is contained in:
parent
b70d2af4ab
commit
43f6a7828a
12 changed files with 291 additions and 312 deletions
|
|
@ -495,7 +495,7 @@ void BotConfig::loadLanguageConfig () {
|
|||
}
|
||||
|
||||
if (!lang.second.empty () && !lang.first.empty ()) {
|
||||
m_language.push (lang.first.trim (), lang.second.trim ());
|
||||
m_language[lang.first.trim ()] = lang.second.trim ();
|
||||
}
|
||||
}
|
||||
else if (line.startsWith ("[TRANSLATED]") && !temp.empty ()) {
|
||||
|
|
@ -756,11 +756,9 @@ const char *BotConfig::translate (StringRef input) {
|
|||
if (game.isDedicated ()) {
|
||||
return input.chars ();
|
||||
}
|
||||
static String result;
|
||||
result.clear ();
|
||||
|
||||
if (m_language.find (input, result)) {
|
||||
return result.chars ();
|
||||
if (m_language.has (input)) {
|
||||
return m_language[input.chars ()].chars ();
|
||||
}
|
||||
return input.chars (); // nothing found
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue