#include "utils/SaveFileStateJob.h"
#include "utils/AlarmClock.h"
#include "utils/StringUtils.h"
+#include "utils/Weather.h"
#include "DatabaseManager.h"
#ifdef _LINUX
}
#endif
+bool CApplication::SetLanguage(const CStdString &strLanguage)
+{
+ CStdString strPreviousLanguage = g_guiSettings.GetString("locale.language");
+ CStdString strNewLanguage = strLanguage;
+ if (strNewLanguage != strPreviousLanguage)
+ {
+ CStdString strLangInfoPath;
+ strLangInfoPath.Format("special://xbmc/language/%s/langinfo.xml", strNewLanguage.c_str());
+ if (!g_langInfo.Load(strLangInfoPath))
+ return false;
+
+ if (g_langInfo.ForceUnicodeFont() && !g_fontManager.IsFontSetUnicode())
+ {
+ CLog::Log(LOGINFO, "Language needs a ttf font, loading first ttf font available");
+ CStdString strFontSet;
+ if (g_fontManager.GetFirstFontSetUnicode(strFontSet))
+ strNewLanguage = strFontSet;
+ else
+ CLog::Log(LOGERROR, "No ttf font found but needed: %s", strFontSet.c_str());
+ }
+ g_guiSettings.SetString("locale.language", strNewLanguage);
+
+ g_charsetConverter.reset();
+
+ if (!g_localizeStrings.Load("special://xbmc/language/", strNewLanguage))
+ return false;
+
+ // also tell our weather and skin to reload as these are localized
+ g_weatherManager.Refresh();
+ g_PVRManager.LocalizationChanged();
+ ReloadSkin();
+ }
+
+ return true;
+}
CSplash* GetSplash() { return m_splash; }
void SetRenderGUI(bool renderGUI);
+
+ bool SetLanguage(const CStdString &strLanguage);
protected:
virtual bool OnSettingsSaving() const;
break;
case TMSG_SETLANGUAGE:
- g_guiSettings.SetLanguage(pMsg->strParam);
+ g_application.SetLanguage(pMsg->strParam);
break;
case TMSG_MEDIA_STOP:
{
#include "cores/AudioEngine/Engines/CoreAudio/CoreAudioHardware.h"
#endif
#include "guilib/GUIFontManager.h"
-#include "utils/Weather.h"
#include "LangInfo.h"
#include "pvr/PVRManager.h"
#include "utils/XMLUtils.h"
SetChanged();
}
-
-bool CGUISettings::SetLanguage(const CStdString &strLanguage)
-{
- CStdString strPreviousLanguage = GetString("locale.language");
- CStdString strNewLanguage = strLanguage;
- if (strNewLanguage != strPreviousLanguage)
- {
- CStdString strLangInfoPath;
- strLangInfoPath.Format("special://xbmc/language/%s/langinfo.xml", strNewLanguage.c_str());
- if (!g_langInfo.Load(strLangInfoPath))
- return false;
-
- if (g_langInfo.ForceUnicodeFont() && !g_fontManager.IsFontSetUnicode())
- {
- CLog::Log(LOGINFO, "Language needs a ttf font, loading first ttf font available");
- CStdString strFontSet;
- if (g_fontManager.GetFirstFontSetUnicode(strFontSet))
- strNewLanguage = strFontSet;
- else
- CLog::Log(LOGERROR, "No ttf font found but needed: %s", strFontSet.c_str());
- }
- SetString("locale.language", strNewLanguage);
-
- g_charsetConverter.reset();
-
- if (!g_localizeStrings.Load("special://xbmc/language/", strNewLanguage))
- return false;
-
- // also tell our weather and skin to reload as these are localized
- g_weatherManager.Refresh();
- g_PVRManager.LocalizationChanged();
- g_application.ReloadSkin();
- }
-
- return true;
-}
void SaveXML(TiXmlNode *pRootNode);
void LoadMasterLock(TiXmlElement *pRootElement);
- bool SetLanguage(const CStdString &strLanguage);
-
ReplayGainSettings m_replayGain;
void Clear();
CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(pSettingControl->GetID());
CStdString strLanguage = pControl->GetCurrentLabel();
if (strLanguage != ".svn" && strLanguage != pSettingString->GetData())
- g_guiSettings.SetLanguage(strLanguage);
+ g_application.SetLanguage(strLanguage);
// user set language, no longer use the TV's language
vector<CPeripheral *> cecDevices;