Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <LangInfo.h>
Classes | |
class | CRegion |
Public Member Functions | |
CLangInfo () | |
~CLangInfo () override | |
void | OnSettingChanged (const std::shared_ptr< const CSetting > &setting) override |
The value of the given setting has changed. | |
void | OnSettingsLoaded () override |
Settings have been loaded. | |
LanguageResourcePtr | GetLanguageAddon (const std::string &locale="") const |
Returns the language addon for the given locale (or the current one). | |
std::string | GetGuiCharSet () const |
std::string | GetSubtitleCharSet () const |
const std::string & | GetLanguageCode () const |
std::string | GetEnglishLanguageName (const std::string &locale="") const |
Get the english language name from given locale, by searching in the installed language addons. | |
bool | SetLanguage (std::string strLanguage="", bool reloadServices=true) |
Sets and loads the given (or configured) language, its details and strings. | |
const std::string & | GetAudioLanguage () const |
void | SetAudioLanguage (const std::string &language, bool isIso6392=false) |
const std::string & | GetSubtitleLanguage () const |
void | SetSubtitleLanguage (const std::string &language, bool isIso6392=false) |
const std::string | GetDVDMenuLanguage () const |
const std::string | GetDVDAudioLanguage () const |
const std::string | GetDVDSubtitleLanguage () const |
const std::string & | GetTimeZone () const |
const std::string & | GetRegionLocale () const |
const std::locale & | GetOriginalLocale () const |
const CLocale & | GetLocale () const |
Returns the full locale of the current language. | |
const std::locale & | GetSystemLocale () const |
Returns the system's current locale. | |
bool | ForceUnicodeFont () const |
const std::string & | GetDateFormat (bool bLongDate=false) const |
void | SetDateFormat (const std::string &dateFormat, bool bLongDate=false) |
const std::string & | GetShortDateFormat () const |
void | SetShortDateFormat (const std::string &shortDateFormat) |
const std::string & | GetLongDateFormat () const |
void | SetLongDateFormat (const std::string &longDateFormat) |
const std::string & | GetTimeFormat () const |
void | SetTimeFormat (const std::string &timeFormat) |
bool | Use24HourClock () const |
void | Set24HourClock (bool use24HourClock) |
void | Set24HourClock (const std::string &str24HourClock) |
const std::string & | GetMeridiemSymbol (MeridiemSymbol symbol) const |
CTemperature::Unit | GetTemperatureUnit () const |
void | SetTemperatureUnit (CTemperature::Unit temperatureUnit) |
void | SetTemperatureUnit (const std::string &temperatureUnit) |
const std::string & | GetTemperatureUnitString () const |
std::string | GetTemperatureAsString (const CTemperature &temperature) const |
CSpeed::Unit | GetSpeedUnit () const |
void | SetSpeedUnit (CSpeed::Unit speedUnit) |
void | SetSpeedUnit (const std::string &speedUnit) |
const std::string & | GetSpeedUnitString () const |
std::string | GetSpeedAsString (const CSpeed &speed) const |
void | GetRegionNames (std::vector< std::string > &array) |
void | SetCurrentRegion (const std::string &strName) |
const std::string & | GetCurrentRegion () const |
std::set< std::string > | GetSortTokens () const |
bool | UseLocaleCollation () |
Public Member Functions inherited from ISettingCallback | |
virtual | ~ISettingCallback ()=default |
virtual bool | OnSettingChanging (const std::shared_ptr< const CSetting > &setting) |
The value of the given setting is being changed. | |
virtual void | OnSettingAction (const std::shared_ptr< const CSetting > &setting) |
The given setting has been activated. | |
virtual bool | OnSettingUpdate (const std::shared_ptr< CSetting > &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode) |
The given setting needs to be updated. | |
virtual void | OnSettingPropertyChanged (const std::shared_ptr< const CSetting > &setting, const char *propertyName) |
The given property of the given setting has changed. | |
Public Member Functions inherited from ISettingsHandler | |
virtual | ~ISettingsHandler ()=default |
virtual bool | OnSettingsLoading () |
Settings loading has been initiated. | |
virtual bool | OnSettingsSaving () const |
Settings saving has been initiated. | |
virtual void | OnSettingsSaved () const |
Settings have been saved. | |
virtual void | OnSettingsUnloaded () |
Setting values have been unloaded. | |
virtual void | OnSettingsCleared () |
Settings have been cleared. | |
Static Public Member Functions | |
static void | GetAddonsLanguageCodes (std::map< std::string, std::string > &languages) |
static std::string | ConvertEnglishNameToAddonLocale (const std::string &langName) |
Convert an english language name to an addon locale, by searching in the installed language addons. | |
static const std::string & | MeridiemSymbolToString (MeridiemSymbol symbol) |
static const std::string & | GetTemperatureUnitString (CTemperature::Unit temperatureUnit) |
static const std::string & | GetSpeedUnitString (CSpeed::Unit speedUnit) |
static std::string | GetLanguagePath () |
static std::string | GetLanguagePath (const std::string &language) |
static std::string | GetLanguageInfoPath (const std::string &language) |
static void | LoadTokens (const TiXmlNode *pTokens, std::set< std::string > &vecTokens) |
static void | SettingOptionsLanguageNamesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsAudioStreamLanguagesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsSubtitleStreamLanguagesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsSubtitleDownloadlanguagesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsISO6391LanguagesFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsRegionsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsShortDateFormatsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsLongDateFormatsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsTimeFormatsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptions24HourClockFormatsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsTemperatureUnitsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
static void | SettingOptionsSpeedUnitsFiller (const std::shared_ptr< const CSetting > &setting, std::vector< StringSettingOption > &list, std::string ¤t, void *data) |
Protected Types | |
typedef std::map< std::string, CRegion > | MAPREGIONS |
typedef std::map< std::string, CRegion >::iterator | ITMAPREGIONS |
typedef std::pair< std::string, CRegion > | PAIR_REGIONS |
Protected Member Functions | |
void | SetDefaults () |
bool | Load (const std::string &strLanguage) |
Static Protected Member Functions | |
static bool | DetermineUse24HourClockFromTimeFormat (const std::string &timeFormat) |
static bool | DetermineUseMeridiemFromTimeFormat (const std::string &timeFormat) |
static std::string | PrepareTimeFormat (const std::string &timeFormat, bool use24HourClock) |
static void | AddLanguages (std::vector< StringSettingOption > &list) |
Protected Attributes | |
MAPREGIONS | m_regions |
CRegion * | m_currentRegion |
CRegion | m_defaultRegion |
std::locale | m_systemLocale |
std::locale | m_originalLocale |
int | m_collationtype |
LanguageResourcePtr | m_languageAddon |
std::string | m_strGuiCharSet |
bool | m_forceUnicodeFont |
std::string | m_strSubtitleCharSet |
std::string | m_strDVDMenuLanguage |
std::string | m_strDVDAudioLanguage |
std::string | m_strDVDSubtitleLanguage |
std::set< std::string > | m_sortTokens |
std::string | m_shortDateFormat |
std::string | m_longDateFormat |
std::string | m_timeFormat |
bool | m_use24HourClock |
CTemperature::Unit | m_temperatureUnit |
CSpeed::Unit | m_speedUnit |
std::string | m_audioLanguage |
std::string | m_subtitleLanguage |
std::string | m_languageCodeGeneral |
|
protected |
|
protected |
|
protected |
CLangInfo::CLangInfo | ( | ) |
|
overridedefault |
|
staticprotected |
|
static |
Convert an english language name to an addon locale, by searching in the installed language addons.
langName | [IN] The english language name |
|
staticprotected |
|
staticprotected |
|
inline |
|
static |
const std::string & CLangInfo::GetAudioLanguage | ( | ) | const |
const std::string & CLangInfo::GetCurrentRegion | ( | ) | const |
const std::string & CLangInfo::GetDateFormat | ( | bool | bLongDate = false | ) | const |
const std::string CLangInfo::GetDVDAudioLanguage | ( | ) | const |
const std::string CLangInfo::GetDVDMenuLanguage | ( | ) | const |
const std::string CLangInfo::GetDVDSubtitleLanguage | ( | ) | const |
std::string CLangInfo::GetEnglishLanguageName | ( | const std::string & | locale = "" | ) | const |
Get the english language name from given locale, by searching in the installed language addons.
locale | [OPT] Locale of the language (current if empty) |
std::string CLangInfo::GetGuiCharSet | ( | ) | const |
LanguageResourcePtr CLangInfo::GetLanguageAddon | ( | const std::string & | locale = "" | ) | const |
Returns the language addon for the given locale (or the current one).
locale | (optional) Locale of the language (current if empty) |
|
inline |
|
static |
|
inlinestatic |
|
static |
const CLocale & CLangInfo::GetLocale | ( | ) | const |
Returns the full locale of the current language.
const std::string & CLangInfo::GetLongDateFormat | ( | ) | const |
const std::string & CLangInfo::GetMeridiemSymbol | ( | MeridiemSymbol | symbol | ) | const |
const std::locale & CLangInfo::GetOriginalLocale | ( | ) | const |
const std::string & CLangInfo::GetRegionLocale | ( | ) | const |
void CLangInfo::GetRegionNames | ( | std::vector< std::string > & | array | ) |
const std::string & CLangInfo::GetShortDateFormat | ( | ) | const |
std::set< std::string > CLangInfo::GetSortTokens | ( | ) | const |
std::string CLangInfo::GetSpeedAsString | ( | const CSpeed & | speed | ) | const |
CSpeed::Unit CLangInfo::GetSpeedUnit | ( | ) | const |
const std::string & CLangInfo::GetSpeedUnitString | ( | ) | const |
|
static |
std::string CLangInfo::GetSubtitleCharSet | ( | ) | const |
const std::string & CLangInfo::GetSubtitleLanguage | ( | ) | const |
|
inline |
Returns the system's current locale.
std::string CLangInfo::GetTemperatureAsString | ( | const CTemperature & | temperature | ) | const |
CTemperature::Unit CLangInfo::GetTemperatureUnit | ( | ) | const |
const std::string & CLangInfo::GetTemperatureUnitString | ( | ) | const |
|
static |
const std::string & CLangInfo::GetTimeFormat | ( | ) | const |
const std::string & CLangInfo::GetTimeZone | ( | ) | const |
|
protected |
|
static |
|
static |
|
overridevirtual |
The value of the given setting has changed.
This callback is triggered whenever the value of a setting has been successfully changed (i.e. none of the OnSettingChanging() handlers) has reverted the change.
setting | The setting whose value has been changed |
Reimplemented from ISettingCallback.
|
overridevirtual |
Settings have been loaded.
This callback can be used to trigger loading other settings.
Reimplemented from ISettingsHandler.
|
staticprotected |
void CLangInfo::Set24HourClock | ( | const std::string & | str24HourClock | ) |
void CLangInfo::SetCurrentRegion | ( | const std::string & | strName | ) |
|
protected |
Sets and loads the given (or configured) language, its details and strings.
strLanguage | (optional) Language to be loaded. |
reloadServices | (optional) Whether to reload services relying on localization. |
void CLangInfo::SetLongDateFormat | ( | const std::string & | longDateFormat | ) |
void CLangInfo::SetShortDateFormat | ( | const std::string & | shortDateFormat | ) |
void CLangInfo::SetSpeedUnit | ( | const std::string & | speedUnit | ) |
void CLangInfo::SetSpeedUnit | ( | CSpeed::Unit | speedUnit | ) |
void CLangInfo::SetTemperatureUnit | ( | const std::string & | temperatureUnit | ) |
void CLangInfo::SetTemperatureUnit | ( | CTemperature::Unit | temperatureUnit | ) |
void CLangInfo::SetTimeFormat | ( | const std::string & | timeFormat | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool CLangInfo::Use24HourClock | ( | ) | const |
bool CLangInfo::UseLocaleCollation | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |