![]() |
Qt 6.x
The Qt SDK
|
#include <qlocale_p.h>
Public Member Functions | |
bool | operator== (QLocaleId other) const |
bool | operator!= (QLocaleId other) const |
bool | isValid () const |
bool | matchesAll () const |
bool | acceptLanguage (quint16 lang) const |
bool | acceptScriptTerritory (QLocaleId other) const |
QLocaleId | withLikelySubtagsAdded () const |
Fill in blank fields of a locale ID. | |
QLocaleId | withLikelySubtagsRemoved () const |
QByteArray | name (char separator='-') const |
Static Public Member Functions | |
static Q_AUTOTEST_EXPORT QLocaleId | fromName (QStringView name) |
Public Attributes | |
ushort | language_id = 0 |
ushort | script_id = 0 |
ushort | territory_id = 0 |
Definition at line 176 of file qlocale_p.h.
|
inline |
Definition at line 193 of file qlocale_p.h.
References language_id.
Referenced by contradicts(), and findLocaleIndexById().
|
inline |
Definition at line 199 of file qlocale_p.h.
References other(), script_id, and territory_id.
Referenced by contradicts(), and findLocaleIndexById().
|
static |
Definition at line 609 of file qlocale.cpp.
References QLocale::AnyLanguage, QLocale::C, QLocalePrivate::codeToLanguage(), QLocalePrivate::codeToScript(), QLocalePrivate::codeToTerritory(), and qt_splitLocaleName().
Referenced by contradicts(), Q_GLOBAL_STATIC(), and QLocale::uiLanguages().
|
inline |
Definition at line 183 of file qlocale_p.h.
References language_id, QLocale::LastLanguage, QLocale::LastScript, QLocale::LastTerritory, script_id, and territory_id.
|
inline |
Definition at line 188 of file qlocale_p.h.
References language_id, script_id, and territory_id.
Referenced by withLikelySubtagsAdded().
QByteArray QLocaleId::name | ( | char | separator = '-' | ) | const |
Definition at line 404 of file qlocale.cpp.
References QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyTerritory, QLocale::C, AlphaCode::decode(), language_id, languageCodeList, QByteArrayLiteral, script_code_list, script_id, territory_code_list, territory_id, and Qt::Uninitialized.
Referenced by QLocalePrivate::bcp47Name(), and QLocale::uiLanguages().
|
inline |
Definition at line 181 of file qlocale_p.h.
References operator==(), and other().
|
inline |
Definition at line 179 of file qlocale_p.h.
References language_id, other(), script_id, and territory_id.
Referenced by operator!=().
QLocaleId QLocaleId::withLikelySubtagsAdded | ( | ) | const |
Fill in blank fields of a locale ID.
An ID in which some fields are zero stands for any locale that agrees with it in its non-zero fields. CLDR's likely-subtag data is meant to help us chose which candidate to prefer. (Note, however, that CLDR does have some cases where it maps an ID to a "best match" for which CLDR does not provide data, even though there are locales for which CLDR does provide data that do match the given ID. It's telling us, unhelpfully but truthfully, what locale would (most likely) be meant by (someone using) the combination requested, even when that locale isn't yet supported.) It may also map an obsolete or generic tag to a modern or more specific replacement, possibly filling in some of the other fields in the process (presently only for countries). Note that some fields of the result may remain blank, but there is no more specific recommendation available.
For the formal specification, see https://www.unicode.org/reports/tr35/#Likely_Subtags
Definition at line 296 of file qlocale.cpp.
References language_id, likely_subtags, matchesAll(), Q_ASSERT, script_id, and territory_id.
Referenced by QLocaleData::findLocaleIndex(), QLocale::uiLanguages(), and withLikelySubtagsRemoved().
QLocaleId QLocaleId::withLikelySubtagsRemoved | ( | ) | const |
Definition at line 380 of file qlocale.cpp.
References language_id, script_id, territory_id, and withLikelySubtagsAdded().
Referenced by QLocalePrivate::bcp47Name(), and QLocale::uiLanguages().
ushort QLocaleId::language_id = 0 |
Definition at line 210 of file qlocale_p.h.
Referenced by acceptLanguage(), contradicts(), QLocaleData::findLocaleIndex(), findLocaleIndexById(), isValid(), matchesAll(), name(), operator==(), withLikelySubtagsAdded(), and withLikelySubtagsRemoved().
ushort QLocaleId::script_id = 0 |
Definition at line 210 of file qlocale_p.h.
Referenced by acceptScriptTerritory(), QLocaleData::findLocaleIndex(), isValid(), matchesAll(), name(), operator==(), withLikelySubtagsAdded(), and withLikelySubtagsRemoved().
ushort QLocaleId::territory_id = 0 |
Definition at line 210 of file qlocale_p.h.
Referenced by acceptScriptTerritory(), QLocaleData::findLocaleIndex(), isValid(), matchesAll(), name(), operator==(), QLocale::uiLanguages(), withLikelySubtagsAdded(), and withLikelySubtagsRemoved().