LibreOffice Module i18nlangtag (master) 1
Static Private Member Functions | Friends | List of all members
MsLangId::Conversion Class Reference

Encapsulated conversion methods used by LanguageTag and conversions, not to be used by anything else. More...

#include <mslangid.hxx>

Static Private Member Functions

static I18NLANGTAG_DLLPRIVATE LanguageType convertLocaleToLanguage (const css::lang::Locale &rLocale)
 Convert a Locale to a LanguageType with handling of an empty language name designating LANGUAGE_SYSTEM. More...
 
static I18NLANGTAG_DLLPRIVATE LanguageType convertLocaleToLanguageImpl (const css::lang::Locale &rLocale)
 Used by convertLocaleToLanguage(Locale) More...
 
static I18NLANGTAG_DLLPRIVATE LanguageType convertPrivateUseToLanguage (std::u16string_view rPriv)
 Convert x-... privateuse, used by convertLocaleToLanguageImpl(Locale) More...
 
static I18NLANGTAG_DLLPRIVATE css::lang::Locale getOverride (const css::lang::Locale &rLocale)
 Used by LanguageTag::canonicalize() More...
 
static I18NLANGTAG_DLLPRIVATE LanguageType convertIsoNamesToLanguage (const OUString &rLang, const OUString &rCountry, bool bSkipIsoTable)
 Used by convertLocaleToLanguageImpl(Locale) and LanguageTagImpl::convertLocaleToLang() More...
 
static I18NLANGTAG_DLLPRIVATE LanguageType convertIsoNamesToLanguage (std::string_view rLang, std::string_view rCountry)
 Used by convertUnxByteStringToLanguage(OString) More...
 
static I18NLANGTAG_DLLPRIVATE css::lang::Locale getLocale (const IsoLanguageCountryEntry *pEntry)
 Used by lookupFallbackLocale(Locale) More...
 
static I18NLANGTAG_DLLPRIVATE css::lang::Locale getLocale (const IsoLanguageScriptCountryEntry *pEntry)
 Used by lookupFallbackLocale(Locale) More...
 
static I18NLANGTAG_DLLPRIVATE css::lang::Locale getLocale (const Bcp47CountryEntry *pEntry)
 Used by lookupFallbackLocale(Locale) More...
 
static I18NLANGTAG_DLLPRIVATE css::lang::Locale convertLanguageToLocale (LanguageType nLang, bool bIgnoreOverride)
 Convert a LanguageType to a Locale. More...
 
static I18NLANGTAG_DLLPRIVATE void convertLanguageToLocaleImpl (LanguageType nLang, css::lang::Locale &rLocale, bool bIgnoreOverride)
 Used by convertLanguageToLocale(LanguageType,bool) and getLocale(IsoLanguageCountryEntry*) and getLocale(IsoLanguageScriptCountryEntry*) and getLocale(Bcp47CountryEntry*) More...
 
static I18NLANGTAG_DLLPRIVATE css::lang::Locale lookupFallbackLocale (const css::lang::Locale &rLocale)
 

Friends

class LanguageTag
 
class LanguageTagImpl
 
css::lang::Locale MsLangId::getFallbackLocale (const css::lang::Locale &rLocale)
 
LanguageType MsLangId::convertUnxByteStringToLanguage (std::string_view rString)
 

Detailed Description

Encapsulated conversion methods used by LanguageTag and conversions, not to be used by anything else.

Definition at line 238 of file mslangid.hxx.

Member Function Documentation

◆ convertIsoNamesToLanguage() [1/2]

LanguageType MsLangId::Conversion::convertIsoNamesToLanguage ( const OUString &  rLang,
const OUString &  rCountry,
bool  bSkipIsoTable 
)
staticprivate

◆ convertIsoNamesToLanguage() [2/2]

LanguageType MsLangId::Conversion::convertIsoNamesToLanguage ( std::string_view  rLang,
std::string_view  rCountry 
)
staticprivate

Used by convertUnxByteStringToLanguage(OString)

Definition at line 1404 of file isolang.cxx.

References LanguageTag::getLanguageType(), LANGUAGE_DONTKNOW, LANGUAGE_ENGLISH_US, LANGUAGE_SYSTEM, and SAL_WARN.

◆ convertLanguageToLocale()

css::lang::Locale MsLangId::Conversion::convertLanguageToLocale ( LanguageType  nLang,
bool  bIgnoreOverride 
)
staticprivate

◆ convertLanguageToLocaleImpl()

void MsLangId::Conversion::convertLanguageToLocaleImpl ( LanguageType  nLang,
css::lang::Locale &  rLocale,
bool  bIgnoreOverride 
)
staticprivate

Used by convertLanguageToLocale(LanguageType,bool) and getLocale(IsoLanguageCountryEntry*) and getLocale(IsoLanguageScriptCountryEntry*) and getLocale(Bcp47CountryEntry*)

Parameters
bIgnoreOverrideIf bIgnoreOverride==true, a matching entry is used even if mnOverride is set, for conversion to an even outdated tag. If bIgnoreOverride==false, a matching entry is skipped if mnOverride is set and instead the override is followed.
Returns
rLocale set to mapped values, unchanged if no mapping was found. E.g. pass empty Locale to obtain empty SYSTEM locale for that case.

Definition at line 968 of file isolang.cxx.

References aImplBcp47CountryEntries, aImplIsoLangEntries, aImplIsoLangScriptEntries, aImplPrivateUseEntries, I18NLANGTAG_QLT, LANGUAGE_DONTKNOW, and LANGUAGE_ENGLISH_US.

◆ convertLocaleToLanguage()

LanguageType MsLangId::Conversion::convertLocaleToLanguage ( const css::lang::Locale &  rLocale)
staticprivate

Convert a Locale to a LanguageType with handling of an empty language name designating LANGUAGE_SYSTEM.

Definition at line 214 of file mslangid.cxx.

References LANGUAGE_SYSTEM.

Referenced by LanguageTagImpl::convertLocaleToLang(), and LanguageTag::registerImpl().

◆ convertLocaleToLanguageImpl()

LanguageType MsLangId::Conversion::convertLocaleToLanguageImpl ( const css::lang::Locale &  rLocale)
staticprivate

Used by convertLocaleToLanguage(Locale)

Definition at line 1226 of file isolang.cxx.

References aImplBcp47CountryEntries, aImplIsoLangEntries, aImplIsoLangScriptEntries, I18NLANGTAG_QLT, and LANGUAGE_DONTKNOW.

◆ convertPrivateUseToLanguage()

LanguageType MsLangId::Conversion::convertPrivateUseToLanguage ( std::u16string_view  rPriv)
staticprivate

Convert x-... privateuse, used by convertLocaleToLanguageImpl(Locale)

Definition at line 1213 of file isolang.cxx.

References aImplPrivateUseEntries, o3tl::equalsIgnoreAsciiCase(), and LANGUAGE_DONTKNOW.

◆ getLocale() [1/3]

css::lang::Locale MsLangId::Conversion::getLocale ( const Bcp47CountryEntry pEntry)
staticprivate

Used by lookupFallbackLocale(Locale)

Definition at line 1094 of file isolang.cxx.

References Bcp47CountryEntry::getLocale(), Bcp47CountryEntry::mnLang, and Bcp47CountryEntry::mnOverride.

◆ getLocale() [2/3]

css::lang::Locale MsLangId::Conversion::getLocale ( const IsoLanguageCountryEntry pEntry)
staticprivate

Used by lookupFallbackLocale(Locale)

Definition at line 1068 of file isolang.cxx.

References IsoLanguageCountryEntry::getLocale(), IsoLanguageCountryEntry::mnLang, and IsoLanguageCountryEntry::mnOverride.

◆ getLocale() [3/3]

css::lang::Locale MsLangId::Conversion::getLocale ( const IsoLanguageScriptCountryEntry pEntry)
staticprivate

◆ getOverride()

css::lang::Locale MsLangId::Conversion::getOverride ( const css::lang::Locale &  rLocale)
staticprivate

Used by LanguageTag::canonicalize()

Definition at line 1271 of file isolang.cxx.

References aImplBcp47CountryEntries, aImplIsoLangEntries, aImplIsoLangScriptEntries, getLocale(), and I18NLANGTAG_QLT.

Referenced by LanguageTagImpl::canonicalize().

◆ lookupFallbackLocale()

css::lang::Locale MsLangId::Conversion::lookupFallbackLocale ( const css::lang::Locale &  rLocale)
staticprivate

Friends And Related Function Documentation

◆ LanguageTag

friend class LanguageTag
friend

Definition at line 242 of file mslangid.hxx.

◆ LanguageTagImpl

friend class LanguageTagImpl
friend

Definition at line 243 of file mslangid.hxx.

◆ MsLangId::convertUnxByteStringToLanguage

LanguageType MsLangId::convertUnxByteStringToLanguage ( std::string_view  rString)
friend

◆ MsLangId::getFallbackLocale

css::lang::Locale MsLangId::getFallbackLocale ( const css::lang::Locale &  rLocale)
friend

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