From 328461faf13e13be3a9205c4658d6c8b08fc9e8e Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 7 Aug 2017 23:01:35 +0100 Subject: [PATCH] Use IETF language tags for configuring language --- modules/webadmin.cpp | 2 +- src/Translation.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index 1fe1dbca..966c0a62 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -1381,7 +1381,7 @@ class CWebAdminMod : public CModule { l_en["Code"] = ""; l_en["Name"] = "English"; CTemplate& l_ru = Tmpl.AddRow("LanguageLoop"); - l_ru["Code"] = "ru_RU"; + l_ru["Code"] = "ru-RU"; l_ru["Name"] = "Russian"; #else Tmpl["HaveI18N"] = "false"; diff --git a/src/Translation.cpp b/src/Translation.cpp index 4574ff6d..dbde1268 100644 --- a/src/Translation.cpp +++ b/src/Translation.cpp @@ -52,6 +52,7 @@ CString CTranslation::Plural(const CString& sDomain, const CString& sContext, const std::locale& CTranslation::LoadTranslation(const CString& sDomain) { CString sLanguage = m_sLanguageStack.empty() ? "" : m_sLanguageStack.back(); + sLanguage.Replace("-", "_"); if (sLanguage.empty()) sLanguage = "C"; #ifdef HAVE_I18N // Not using built-in support for multiple domains in single std::locale