diff options
author | Karlson2k <k2k@narod.ru> | 2015-02-11 12:24:30 +0300 |
---|---|---|
committer | Karlson2k <k2k@narod.ru> | 2015-02-15 17:17:51 +0300 |
commit | ab7dfe8f88d9bf95dcdf659bb5e68f63d1fb5cf5 (patch) | |
tree | 3bae26729e09c92ae38629cf454206b88c4d82f9 | |
parent | cf83640331f7c64f69ec9412b0fa0a2dfb65d5be (diff) |
LangInfo: add m_locale and GetLocale() for current locale
-rw-r--r-- | xbmc/LangInfo.cpp | 3 | ||||
-rw-r--r-- | xbmc/LangInfo.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp index a88e1646e3..dad5ee7e4c 100644 --- a/xbmc/LangInfo.cpp +++ b/xbmc/LangInfo.cpp @@ -198,6 +198,7 @@ void CLangInfo::CRegion::SetGlobalLocale() strLocale = "C"; } + g_langInfo.m_locale = current_locale; // TODO: move to CLangInfo class locale::global(current_locale); #endif g_charsetConverter.resetSystemCharset(); @@ -421,6 +422,8 @@ void CLangInfo::SetDefaults() // Set the default region, we may be unable to load langinfo.xml m_currentRegion=&m_defaultRegion; + + m_locale = std::locale::classic(); m_languageCodeGeneral = "eng"; } diff --git a/xbmc/LangInfo.h b/xbmc/LangInfo.h index aa499fde8a..6c9898c41f 100644 --- a/xbmc/LangInfo.h +++ b/xbmc/LangInfo.h @@ -25,6 +25,7 @@ #include <map> #include <string> #include <vector> +#include <locale> #ifdef TARGET_WINDOWS #ifdef GetDateFormat @@ -130,6 +131,9 @@ public: void SetCurrentRegion(const std::string& strName); const std::string& GetCurrentRegion() const; + const std::locale& GetLocale() const + { return m_locale; } + static bool CheckLanguage(const std::string& language); static void LoadTokens(const TiXmlNode* pTokens, std::vector<std::string>& vecTokens); @@ -179,6 +183,7 @@ protected: MAPREGIONS m_regions; CRegion* m_currentRegion; // points to the current region CRegion m_defaultRegion; // default, will be used if no region available via langinfo.xml + std::locale m_locale; // current locale, matching GUI settings std::string m_audioLanguage; std::string m_subtitleLanguage; |