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

#include <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

◆ ReInit()

void MythLocale::ReInit ( )

Definition at line 52 of file mythlocale.cpp.

Referenced by MythCoreContext::ReInitLocale().

◆ GetCountryCode()

QString MythLocale::GetCountryCode ( ) const

◆ GetCountry()

QString MythLocale::GetCountry ( ) const

ISO3166 2-letter.

Definition at line 64 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetNativeCountry()

QString MythLocale::GetNativeCountry ( ) const

Name of country in English.

Definition at line 69 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetLanguageCode()

QString MythLocale::GetLanguageCode ( ) const

Name of country in the native language.

Definition at line 74 of file mythlocale.cpp.

Referenced by GetLanguage(), and GetNativeLanguage().

◆ GetLanguage()

QString MythLocale::GetLanguage ( ) const

ISO639 2-letter.

Definition at line 81 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ GetNativeLanguage()

QString MythLocale::GetNativeLanguage ( ) const

Name of language in English.

Definition at line 86 of file mythlocale.cpp.

Referenced by MythTranslation::getLanguages().

◆ 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().

◆ ToQLocale()

QLocale MythLocale::ToQLocale ( ) const
inline

◆ LoadDefaultsFromXML()

bool MythLocale::LoadDefaultsFromXML ( void  )

Definition at line 91 of file mythlocale.cpp.

Referenced by GetLocaleSetting(), and SaveLocaleDefaults().

◆ SaveLocaleDefaults()

void MythLocale::SaveLocaleDefaults ( bool  overwrite = false)

Definition at line 171 of file mythlocale.cpp.

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

◆ ResetToLocaleDefaults()

void MythLocale::ResetToLocaleDefaults ( void  )

Definition at line 193 of file mythlocale.cpp.

◆ ResetToStandardDefaults()

void MythLocale::ResetToStandardDefaults ( void  )

Definition at line 198 of file mythlocale.cpp.

◆ GetLocaleSetting()

QString MythLocale::GetLocaleSetting ( const QString &  key)

Definition at line 205 of file mythlocale.cpp.

Referenced by LanguageSelection::Load().

◆ Init()

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

Definition at line 21 of file mythlocale.cpp.

Referenced by MythLocale(), and ReInit().

Member Data Documentation

◆ m_localeCode

QString MythLocale::m_localeCode
private

Definition at line 41 of file mythlocale.h.

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

◆ m_defaultsLoaded

bool MythLocale::m_defaultsLoaded {false}
private

Definition at line 42 of file mythlocale.h.

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

◆ m_qtLocale

QLocale MythLocale::m_qtLocale
private

Definition at line 43 of file mythlocale.h.

Referenced by Init().

◆ 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().


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