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
8d23b474
Kaydet (Commit)
8d23b474
authored
Şub 16, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added LanguageTag::getFallbackStrings()
Change-Id: Ia597cb184e0402e776cde50967541f008e22d4c9
üst
ca04dec8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
languagetag.hxx
i18npool/inc/i18npool/languagetag.hxx
+21
-0
languagetag.cxx
i18npool/source/languagetag/languagetag.cxx
+40
-0
No files found.
i18npool/inc/i18npool/languagetag.hxx
Dosyayı görüntüle @
8d23b474
...
...
@@ -16,6 +16,8 @@
#include <i18npool/i18npooldllapi.h>
#include <i18npool/lang.h>
#include <vector>
typedef
struct
_rtl_Locale
rtl_Locale
;
// as in rtl/locale.h
...
...
@@ -212,6 +214,25 @@ public:
*/
LanguageTag
&
makeFallback
();
/** Return a vector of fall-back strings.
In order:
full BCP 47 tag, same as getBcp47()
lll-Ssss-CC
lll-Ssss
lll-CC
lll
Only strings that differ from a higher order are included, for example
if there is no script the elements will be bcp47, lll-CC, lll; if the
bcp47 string is identical to lll-CC then only lll-CC, lll.
Note that lll is only ISO 639-1/2 alpha code and CC is only ISO 3166
alpha code. If the region can not be expressed as ISO 3166 then no -CC
tags are included.
*/
::
std
::
vector
<
OUString
>
getFallbackStrings
()
const
;
/* Test equality of two LangageTag. */
bool
operator
==
(
const
LanguageTag
&
rLanguageTag
)
const
;
...
...
i18npool/source/languagetag/languagetag.cxx
Dosyayı görüntüle @
8d23b474
...
...
@@ -1003,6 +1003,46 @@ LanguageTag & LanguageTag::makeFallback()
}
::
std
::
vector
<
OUString
>
LanguageTag
::
getFallbackStrings
()
const
{
::
std
::
vector
<
OUString
>
aVec
;
OUString
aLanguage
(
getLanguage
());
OUString
aCountry
(
getCountry
());
if
(
isIsoLocale
())
{
if
(
!
aCountry
.
isEmpty
())
aVec
.
push_back
(
aLanguage
+
"-"
+
aCountry
);
aVec
.
push_back
(
aLanguage
);
return
aVec
;
}
aVec
.
push_back
(
getBcp47
());
OUString
aTmp
;
if
(
hasScript
())
{
OUString
aScript
(
getScript
());
if
(
!
aCountry
.
isEmpty
())
{
aTmp
=
aLanguage
+
"-"
+
aScript
+
"-"
+
aCountry
;
if
(
aTmp
!=
aVec
[
0
])
aVec
.
push_back
(
aTmp
);
}
aTmp
=
aLanguage
+
"-"
+
aScript
;
if
(
aTmp
!=
aVec
[
0
])
aVec
.
push_back
(
aTmp
);
}
if
(
!
aCountry
.
isEmpty
())
{
aTmp
=
aLanguage
+
"-"
+
aCountry
;
if
(
aTmp
!=
aVec
[
0
])
aVec
.
push_back
(
aTmp
);
}
aTmp
=
aLanguage
;
if
(
aTmp
!=
aVec
[
0
])
aVec
.
push_back
(
aTmp
);
return
aVec
;
}
bool
LanguageTag
::
operator
==
(
const
LanguageTag
&
rLanguageTag
)
const
{
// Compare full language tag strings but SYSTEM unresolved.
...
...
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