summaryrefslogtreecommitdiff
path: root/src/i18n
diff options
context:
space:
mode:
authorLuke Barkess <57995669+Brumus14@users.noreply.github.com>2025-11-22 13:59:36 +0000
committerGitHub <noreply@github.com>2025-11-22 13:59:36 +0000
commite584a8bade2617899d69ae6f83011d0c1d2a9df7 (patch)
treedd4ac5b15ed654c18381d927a1b89dcda2071528 /src/i18n
parent2ac9ded2ac56da300c7bc0fb75142ed17f60edbf (diff)
config: added locale config option (#12416)
Diffstat (limited to 'src/i18n')
-rw-r--r--src/i18n/Engine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/i18n/Engine.cpp b/src/i18n/Engine.cpp
index d78689a6..64c919ba 100644
--- a/src/i18n/Engine.cpp
+++ b/src/i18n/Engine.cpp
@@ -1,6 +1,7 @@
#include "Engine.hpp"
#include <hyprutils/i18n/I18nEngine.hpp>
+#include "../config/ConfigValue.hpp"
using namespace I18n;
using namespace Hyprutils::I18n;
@@ -1105,5 +1106,7 @@ I18n::CI18nEngine::CI18nEngine() {
}
std::string I18n::CI18nEngine::localize(eI18nKeys key, const Hyprutils::I18n::translationVarMap& vars) {
- return huEngine->localizeEntry(localeStr, key, vars);
+ static auto CONFIG_LOCALE = CConfigValue<std::string>("general:locale");
+ std::string locale = *CONFIG_LOCALE != "" ? *CONFIG_LOCALE : localeStr;
+ return huEngine->localizeEntry(locale, key, vars);
}