mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
impr: Only reload localization when necessary
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
namespace hex {
|
||||
|
||||
std::string LangEntry::s_fallbackLanguage;
|
||||
std::string LangEntry::s_selectedLanguage;
|
||||
std::map<std::string, std::string> LangEntry::s_currStrings;
|
||||
|
||||
LanguageDefinition::LanguageDefinition(std::map<std::string, std::string> &&entries) {
|
||||
@@ -89,6 +90,8 @@ namespace hex {
|
||||
for (auto &definition : definitions[fallbackLanguage])
|
||||
LangEntry::s_currStrings.insert(definition.getEntries().begin(), definition.getEntries().end());
|
||||
}
|
||||
|
||||
LangEntry::s_selectedLanguage = language;
|
||||
}
|
||||
|
||||
const std::map<std::string, std::string> &LangEntry::getSupportedLanguages() {
|
||||
@@ -107,4 +110,8 @@ namespace hex {
|
||||
LangEntry::s_currStrings.clear();
|
||||
}
|
||||
|
||||
const std::string &LangEntry::getSelectedLanguage() {
|
||||
return s_selectedLanguage;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user