mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-03 05:57:40 -05:00
Implement localization all throughout ImHex
English only for now, additional languages will come in the future
This commit is contained in:
@@ -201,6 +201,8 @@ namespace hex {
|
||||
|
||||
void ContentRegistry::Language::addLocalizations(std::string_view languageCode, const LanguageDefinition &definition) {
|
||||
getLanguageDefinitions()[languageCode.data()].push_back(definition);
|
||||
|
||||
EventManager::post(hex::Events::SettingsChanged, {});
|
||||
}
|
||||
|
||||
std::map<std::string, std::string>& ContentRegistry::Language::getLanguages() {
|
||||
|
||||
@@ -27,6 +27,34 @@ namespace hex {
|
||||
return get().data();
|
||||
}
|
||||
|
||||
std::string operator+(const std::string &&left, const LangEntry &&right) {
|
||||
return left + static_cast<std::string>(right);
|
||||
}
|
||||
|
||||
std::string operator+(const LangEntry &&left, const std::string &&right) {
|
||||
return static_cast<std::string>(left) + right;
|
||||
}
|
||||
|
||||
std::string operator+(const LangEntry &&left, const LangEntry &&right) {
|
||||
return static_cast<std::string>(left) + static_cast<std::string>(right);
|
||||
}
|
||||
|
||||
std::string operator+(const std::string_view &&left, const LangEntry &&right) {
|
||||
return std::string(left) + static_cast<std::string>(right);
|
||||
}
|
||||
|
||||
std::string operator+(const LangEntry &&left, const std::string_view &&right) {
|
||||
return static_cast<std::string>(left) + std::string(right);
|
||||
}
|
||||
|
||||
std::string operator+(const char *left, const LangEntry &&right) {
|
||||
return left + static_cast<std::string>(right);
|
||||
}
|
||||
|
||||
std::string operator+(const LangEntry &&left, const char *right) {
|
||||
return static_cast<std::string>(left) + right;
|
||||
}
|
||||
|
||||
std::string_view LangEntry::get() const {
|
||||
auto &lang = SharedData::loadedLanguageStrings;
|
||||
if (lang.find(this->m_unlocalizedString) != lang.end())
|
||||
|
||||
Reference in New Issue
Block a user