Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e68074d6
Kaydet (Commit)
e68074d6
authored
Agu 28, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use Bcp47CountryEntry
Change-Id: I604e4be0ff126153e163322aa7dc14acabd29138
üst
c5381977
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
isolang.cxx
i18nlangtag/source/isolang/isolang.cxx
+36
-0
No files found.
i18nlangtag/source/isolang/isolang.cxx
Dosyayı görüntüle @
e68074d6
...
...
@@ -753,6 +753,19 @@ static IsoLangOtherEntry const aImplPrivateUseEntries[] =
void
MsLangId
::
Conversion
::
convertLanguageToLocaleImpl
(
LanguageType
nLang
,
::
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
)
{
// Search for LangID in BCP47
for
(
const
Bcp47CountryEntry
*
pBcp47Entry
=
aImplBcp47CountryEntries
;
pBcp47Entry
->
mnLang
!=
LANGUAGE_DONTKNOW
;
++
pBcp47Entry
)
{
if
(
pBcp47Entry
->
mnLang
==
nLang
)
{
rLocale
.
Language
=
I18NLANGTAG_QLT
;
rLocale
.
Country
=
OUString
::
createFromAscii
(
pBcp47Entry
->
maCountry
);
rLocale
.
Variant
=
pBcp47Entry
->
getTagString
();
return
;
}
}
// Search for LangID in ISO lll-Ssss-CC
for
(
const
IsoLanguageScriptCountryEntry
*
pScriptEntry
=
aImplIsoLangScriptEntries
;
pScriptEntry
->
mnLang
!=
LANGUAGE_DONTKNOW
;
++
pScriptEntry
)
...
...
@@ -809,6 +822,15 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
if
(
rLocale
.
Language
==
I18NLANGTAG_QLT
)
{
// Search in BCP47, only full match, only LanguageTag can decide the
// proper fallback.
for
(
const
Bcp47CountryEntry
*
pBcp47Entry
=
aImplBcp47CountryEntries
;
pBcp47Entry
->
mnLang
!=
LANGUAGE_DONTKNOW
;
++
pBcp47Entry
)
{
if
(
rLocale
.
Variant
.
equalsIgnoreAsciiCase
(
pBcp47Entry
->
getTagString
()))
return
pBcp47Entry
->
getLocale
();
}
// Search in ISO lll-Ssss-CC
const
IsoLanguageScriptCountryEntry
*
pFirstScript
=
NULL
;
for
(
const
IsoLanguageScriptCountryEntry
*
pScriptEntry
=
aImplIsoLangScriptEntries
;
...
...
@@ -840,6 +862,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
}
return
pFirstScript
->
getLocale
();
}
// Extract language from tag string, country is used as present in
// Locale because in the tables that follow we have only ISO 3166
// countries and if that is in the tag string we also have it in the
...
...
@@ -928,6 +951,14 @@ LanguageType MsLangId::Conversion::convertLocaleToLanguageImpl(
if
(
rLocale
.
Variant
.
startsWithIgnoreAsciiCase
(
"x-"
)
||
(
rLocale
.
Variant
==
"*"
))
return
convertPrivateUseToLanguage
(
rLocale
.
Variant
);
// Search in BCP47
for
(
const
Bcp47CountryEntry
*
pBcp47Entry
=
aImplBcp47CountryEntries
;
pBcp47Entry
->
mnLang
!=
LANGUAGE_DONTKNOW
;
++
pBcp47Entry
)
{
if
(
rLocale
.
Variant
.
equalsIgnoreAsciiCase
(
pBcp47Entry
->
getTagString
()))
return
pBcp47Entry
->
mnLang
;
}
// Search in ISO lll-Ssss-CC
for
(
const
IsoLanguageScriptCountryEntry
*
pScriptEntry
=
aImplIsoLangScriptEntries
;
pScriptEntry
->
mnLang
!=
LANGUAGE_DONTKNOW
;
++
pScriptEntry
)
...
...
@@ -1149,6 +1180,11 @@ LanguageType MsLangId::convertUnxByteStringToLanguage(
::
std
::
vector
<
MsLangId
::
LanguagetagMapping
>
MsLangId
::
getDefinedLanguagetags
()
{
::
std
::
vector
<
LanguagetagMapping
>
aVec
;
for
(
const
Bcp47CountryEntry
*
pEntry
=
aImplBcp47CountryEntries
;
pEntry
->
mnLang
!=
LANGUAGE_DONTKNOW
;
++
pEntry
)
{
aVec
.
push_back
(
LanguagetagMapping
(
pEntry
->
getTagString
(),
pEntry
->
mnLang
));
}
for
(
const
IsoLanguageScriptCountryEntry
*
pEntry
=
aImplIsoLangScriptEntries
;
pEntry
->
mnLang
!=
LANGUAGE_DONTKNOW
;
++
pEntry
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment