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
99899543
Kaydet (Commit)
99899543
authored
Eyl 19, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
accept (DIGIT 3*ALNUM) variant in place of (4*ALPHA) script
Change-Id: If622619bd2e282ab8298ac8a29f8bb57a8fe968f
üst
1eccc6de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
test_languagetag.cxx
i18nlangtag/qa/cppunit/test_languagetag.cxx
+19
-1
languagetag.cxx
i18nlangtag/source/languagetag/languagetag.cxx
+19
-7
No files found.
i18nlangtag/qa/cppunit/test_languagetag.cxx
Dosyayı görüntüle @
99899543
...
...
@@ -318,6 +318,24 @@ void TestLanguageTag::testAllTags()
CPPUNIT_ASSERT
(
de_DE
.
getLanguageType
()
==
LANGUAGE_GERMAN
);
}
// 'de-1901' derived from 'de-DE-1901' grandfathered to check that it is
// accepted as (DIGIT 3*ALNUM) variant
{
OUString
s_de_1901
(
"de-1901"
);
LanguageTag
de_1901
(
s_de_1901
);
lang
::
Locale
aLocale
=
de_1901
.
getLocale
();
CPPUNIT_ASSERT
(
de_1901
.
getBcp47
()
==
s_de_1901
);
CPPUNIT_ASSERT
(
aLocale
.
Language
==
"qlt"
);
CPPUNIT_ASSERT
(
aLocale
.
Country
==
""
);
CPPUNIT_ASSERT
(
aLocale
.
Variant
==
s_de_1901
);
CPPUNIT_ASSERT
(
de_1901
.
getLanguageType
()
==
LANGUAGE_SYSTEM
);
CPPUNIT_ASSERT
(
de_1901
.
isValidBcp47
()
==
true
);
CPPUNIT_ASSERT
(
de_1901
.
isIsoLocale
()
==
false
);
CPPUNIT_ASSERT
(
de_1901
.
isIsoODF
()
==
false
);
CPPUNIT_ASSERT
(
de_1901
.
getLanguageAndScript
()
==
"de"
);
CPPUNIT_ASSERT
(
de_1901
.
getVariants
()
==
"1901"
);
}
// 'en-GB-oed' is known grandfathered for English, Oxford English
// Dictionary spelling
{
...
...
@@ -327,7 +345,7 @@ void TestLanguageTag::testAllTags()
CPPUNIT_ASSERT
(
en_GB_oed
.
getBcp47
()
==
s_en_GB_oed
);
CPPUNIT_ASSERT
(
aLocale
.
Language
==
"qlt"
);
CPPUNIT_ASSERT
(
aLocale
.
Country
==
"GB"
);
// only 'GB' because we handle it, liblangtag would not fill this
CPPUNIT_ASSERT
(
aLocale
.
Variant
==
"en-GB-oed"
);
CPPUNIT_ASSERT
(
aLocale
.
Variant
==
s_en_GB_oed
);
CPPUNIT_ASSERT
(
en_GB_oed
.
getLanguageType
()
==
LANGUAGE_USER_ENGLISH_UK_OED
);
CPPUNIT_ASSERT
(
en_GB_oed
.
isValidBcp47
()
==
true
);
CPPUNIT_ASSERT
(
en_GB_oed
.
isIsoLocale
()
==
false
);
...
...
i18nlangtag/source/languagetag/languagetag.cxx
Dosyayı görüntüle @
99899543
...
...
@@ -1789,16 +1789,28 @@ LanguageTagImpl::Extraction LanguageTagImpl::simpleExtract( const OUString& rBcp
eRet
=
EXTRACTED_LSC
;
}
}
else
if
(
(
nHyph1
==
2
&&
nLen
==
7
)
// ll-Ssss
||
(
nHyph1
==
3
&&
nLen
==
8
))
// lll-Ssss
else
if
(
(
nHyph1
==
2
&&
nLen
==
7
)
// ll-Ssss
or ll-vvvv
||
(
nHyph1
==
3
&&
nLen
==
8
))
// lll-Ssss
or lll-vvvv
{
/* TODO: also accept a (DIGIT 3*ALNUM) vvvv variant instead of Ssss */
if
(
nHyph2
<
0
)
{
rLanguage
=
rBcp47
.
copy
(
0
,
nHyph1
).
toAsciiLowerCase
();
rScript
=
rBcp47
.
copy
(
nHyph1
+
1
,
1
).
toAsciiUpperCase
()
+
rBcp47
.
copy
(
nHyph1
+
2
,
3
).
toAsciiLowerCase
();
rCountry
=
rVariants
=
OUString
();
eRet
=
EXTRACTED_LSC
;
sal_Unicode
c
=
rBcp47
[
nHyph1
+
1
];
if
(
'0'
<=
c
&&
c
<=
'9'
)
{
// (DIGIT 3*ALNUM) vvvv variant instead of Ssss script
rLanguage
=
rBcp47
.
copy
(
0
,
nHyph1
).
toAsciiLowerCase
();
rScript
=
rCountry
=
OUString
();
rVariants
=
rBcp47
.
copy
(
nHyph1
+
1
);
eRet
=
EXTRACTED_LV
;
}
else
{
rLanguage
=
rBcp47
.
copy
(
0
,
nHyph1
).
toAsciiLowerCase
();
rScript
=
rBcp47
.
copy
(
nHyph1
+
1
,
1
).
toAsciiUpperCase
()
+
rBcp47
.
copy
(
nHyph1
+
2
,
3
).
toAsciiLowerCase
();
rCountry
=
rVariants
=
OUString
();
eRet
=
EXTRACTED_LSC
;
}
}
}
else
if
(
(
nHyph1
==
2
&&
nHyph2
==
7
&&
nLen
==
10
)
// ll-Ssss-CC
...
...
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