MythTV master
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MythLocale Class Reference

#include <libmythbase/mythlocale.h>

Public Member Functions

 MythLocale (const QString &localeName=QString())
 
void ReInit ()
 
QString GetCountryCode () const
 
QString GetCountry () const
 ISO3166 2-letter. More...
 
QString GetNativeCountry () const
 Name of country in English. More...
 
QString GetLanguageCode () const
 Name of country in the native language. More...
 
QString GetLanguage () const
 ISO639 2-letter. More...
 
QString GetNativeLanguage () const
 Name of language in English. More...
 
QString GetLocaleCode () const
 Name of language in that language. More...
 
QLocale ToQLocale () const
 
bool LoadDefaultsFromXML (void)
 
void SaveLocaleDefaults (bool overwrite=false)
 
void ResetToLocaleDefaults (void)
 
void ResetToStandardDefaults (void)
 
QString GetLocaleSetting (const QString &key)
 

Private Types

using SettingsMap = QMap< QString, QString >
 

Private Member Functions

void Init (const QString &localeName=QString())
 

Private Attributes

QString m_localeCode
 
bool m_defaultsLoaded {false}
 
QLocale m_qtLocale
 
SettingsMap m_globalSettings
 
SettingsMap m_hostSettings
 

Detailed Description

Definition at line 12 of file mythlocale.h.

Member Typedef Documentation

◆ SettingsMap

using MythLocale::SettingsMap = QMap<QString, QString>
private

Definition at line 45 of file mythlocale.h.

Constructor & Destructor Documentation

◆ MythLocale()

MythLocale::MythLocale ( const QString &  localeName = QString())
explicit

Definition at line 16 of file mythlocale.cpp.

Member Function Documentation

◆ GetCountry()

QString MythLocale::GetCountry ( ) const

ISO3166 2-letter.

Definition at line 66 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetCountryCode()

QString MythLocale::GetCountryCode ( void  ) const

◆ GetLanguage()

QString MythLocale::GetLanguage ( void  ) const

ISO639 2-letter.

Definition at line 83 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetLanguageCode()

QString MythLocale::GetLanguageCode ( void  ) const

Name of country in the native language.

Definition at line 76 of file mythlocale.cpp.

Referenced by GetLanguage(), and GetNativeLanguage().

◆ GetLocaleCode()

QString MythLocale::GetLocaleCode ( ) const
inline

Name of language in that language.

Definition at line 27 of file mythlocale.h.

Referenced by MythCoreContext::InitLocale(), MythCoreContext::ReInitLocale(), and MythCoreContext::SaveLocaleDefaults().

◆ GetLocaleSetting()

QString MythLocale::GetLocaleSetting ( const QString &  key)

Definition at line 207 of file mythlocale.cpp.

Referenced by LanguageSelection::Load().

◆ GetNativeCountry()

QString MythLocale::GetNativeCountry ( void  ) const

Name of country in English.

Definition at line 71 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetNativeLanguage()

QString MythLocale::GetNativeLanguage ( void  ) const

Name of language in English.

Definition at line 88 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ Init()

void MythLocale::Init ( const QString &  localeName = QString())
private

Definition at line 21 of file mythlocale.cpp.

Referenced by MythLocale(), and ReInit().

◆ LoadDefaultsFromXML()

bool MythLocale::LoadDefaultsFromXML ( void  )

Definition at line 93 of file mythlocale.cpp.

Referenced by GetLocaleSetting(), and SaveLocaleDefaults().

◆ ReInit()

void MythLocale::ReInit ( )

Definition at line 54 of file mythlocale.cpp.

Referenced by MythCoreContext::ReInitLocale().

◆ ResetToLocaleDefaults()

void MythLocale::ResetToLocaleDefaults ( void  )

Definition at line 195 of file mythlocale.cpp.

◆ ResetToStandardDefaults()

void MythLocale::ResetToStandardDefaults ( void  )

Definition at line 200 of file mythlocale.cpp.

◆ SaveLocaleDefaults()

void MythLocale::SaveLocaleDefaults ( bool  overwrite = false)

Definition at line 173 of file mythlocale.cpp.

Referenced by ResetToLocaleDefaults(), and MythCoreContext::SaveLocaleDefaults().

◆ ToQLocale()

QLocale MythLocale::ToQLocale ( ) const
inline

Member Data Documentation

◆ m_defaultsLoaded

bool MythLocale::m_defaultsLoaded {false}
private

Definition at line 42 of file mythlocale.h.

Referenced by GetLocaleSetting(), LoadDefaultsFromXML(), and SaveLocaleDefaults().

◆ m_globalSettings

SettingsMap MythLocale::m_globalSettings
private

Definition at line 46 of file mythlocale.h.

Referenced by GetLocaleSetting(), LoadDefaultsFromXML(), and SaveLocaleDefaults().

◆ m_hostSettings

SettingsMap MythLocale::m_hostSettings
private

Definition at line 47 of file mythlocale.h.

Referenced by GetLocaleSetting(), LoadDefaultsFromXML(), and SaveLocaleDefaults().

◆ m_localeCode

QString MythLocale::m_localeCode
private

Definition at line 41 of file mythlocale.h.

Referenced by GetCountryCode(), GetLanguageCode(), Init(), and LoadDefaultsFromXML().

◆ m_qtLocale

QLocale MythLocale::m_qtLocale
private

Definition at line 43 of file mythlocale.h.

Referenced by Init().


The documentation for this class was generated from the following files: