3 * Copyright (C) 2005-2012 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 #include "utils/StdString.h"
34 bool Load(const CStdString& strFileName);
36 CStdString GetGuiCharSet() const;
37 CStdString GetSubtitleCharSet() const;
39 // three char language code (not win32 specific)
40 const CStdString& GetLanguageCode() const { return m_languageCodeGeneral; }
42 const CStdString& GetAudioLanguage() const;
43 // language can either be a two char language code as defined in ISO639
44 // or a three char language code
45 // or a language name in english (as used by XBMC)
46 void SetAudioLanguage(const CStdString &language);
48 // three char language code (not win32 specific)
49 const CStdString& GetSubtitleLanguage() const;
50 // language can either be a two char language code as defined in ISO639
51 // or a three char language code
52 // or a language name in english (as used by XBMC)
53 void SetSubtitleLanguage(const CStdString &language);
55 const CStdString& GetDVDMenuLanguage() const;
56 const CStdString& GetDVDAudioLanguage() const;
57 const CStdString& GetDVDSubtitleLanguage() const;
58 const CStdString& GetTimeZone() const;
60 const CStdString& GetRegionLocale() const;
61 const CStdString& GetLanguageLocale() const;
63 bool ForceUnicodeFont() const { return m_currentRegion->m_forceUnicodeFont; }
65 const CStdString& GetDateFormat(bool bLongDate=false) const;
67 typedef enum _MERIDIEM_SYMBOL
74 const CStdString& GetTimeFormat() const;
75 const CStdString& GetMeridiemSymbol(MERIDIEM_SYMBOL symbol) const;
77 typedef enum _TEMP_UNIT
79 TEMP_UNIT_FAHRENHEIT=0,
89 const CStdString& GetTempUnitString() const;
90 CLangInfo::TEMP_UNIT GetTempUnit() const;
93 typedef enum _SPEED_UNIT
95 SPEED_UNIT_KMH=0, // kilemetre per hour
96 SPEED_UNIT_MPMIN, // metres per minute
97 SPEED_UNIT_MPS, // metres per second
98 SPEED_UNIT_FTH, // feet per hour
99 SPEED_UNIT_FTMIN, // feet per minute
100 SPEED_UNIT_FTS, // feet per second
101 SPEED_UNIT_MPH, // miles per hour
102 SPEED_UNIT_KTS, // knots
103 SPEED_UNIT_BEAUFORT, // beaufort
104 SPEED_UNIT_INCHPS, // inch per second
105 SPEED_UNIT_YARDPS, // yard per second
106 SPEED_UNIT_FPF // Furlong per Fortnight
109 const CStdString& GetSpeedUnitString() const;
110 CLangInfo::SPEED_UNIT GetSpeedUnit() const;
112 void GetRegionNames(CStdStringArray& array);
113 void SetCurrentRegion(const CStdString& strName);
114 const CStdString& GetCurrentRegion() const;
116 static void LoadTokens(const TiXmlNode* pTokens, std::vector<CStdString>& vecTokens);
125 CRegion(const CRegion& region);
129 void SetTempUnit(const CStdString& strUnit);
130 void SetSpeedUnit(const CStdString& strUnit);
131 void SetTimeZone(const CStdString& strTimeZone);
132 void SetGlobalLocale();
133 CStdString m_strGuiCharSet;
134 CStdString m_strSubtitleCharSet;
135 CStdString m_strDVDMenuLanguage;
136 CStdString m_strDVDAudioLanguage;
137 CStdString m_strDVDSubtitleLanguage;
138 CStdString m_strLangLocaleName;
139 CStdString m_strRegionLocaleName;
140 bool m_forceUnicodeFont;
141 CStdString m_strName;
142 CStdString m_strDateFormatLong;
143 CStdString m_strDateFormatShort;
144 CStdString m_strTimeFormat;
145 CStdString m_strMeridiemSymbols[MERIDIEM_SYMBOL_MAX];
146 CStdString m_strTimeZone;
148 TEMP_UNIT m_tempUnit;
149 SPEED_UNIT m_speedUnit;
153 typedef std::map<CStdString, CRegion> MAPREGIONS;
154 typedef std::map<CStdString, CRegion>::iterator ITMAPREGIONS;
155 typedef std::pair<CStdString, CRegion> PAIR_REGIONS;
156 MAPREGIONS m_regions;
157 CRegion* m_currentRegion; // points to the current region
158 CRegion m_defaultRegion; // default, will be used if no region available via langinfo.xml
160 CStdString m_audioLanguage;
161 CStdString m_subtitleLanguage;
162 // this is the general (not win32-specific) three char language code
163 CStdString m_languageCodeGeneral;
167 extern CLangInfo g_langInfo;