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
4806df61
Kaydet (Commit)
4806df61
authored
Nis 24, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added LanguageTagIcu::getIcuLocale() with additional variant
Change-Id: I5a5689f449ac7653bb716f2ce67ea1039fe2559c
üst
3ca2240e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
languagetagicu.cxx
i18nlangtag/source/languagetag/languagetagicu.cxx
+11
-0
languagetagicu.hxx
include/i18nlangtag/languagetagicu.hxx
+12
-0
No files found.
i18nlangtag/source/languagetag/languagetagicu.cxx
Dosyayı görüntüle @
4806df61
...
...
@@ -33,4 +33,15 @@ icu::Locale LanguageTagIcu::getIcuLocale( const LanguageTag & rLanguageTag )
OUStringToOString
(
rLanguageTag
.
getBcp47
(),
RTL_TEXTENCODING_ASCII_US
).
getStr
());
}
// static
icu
::
Locale
LanguageTagIcu
::
getIcuLocale
(
const
LanguageTag
&
rLanguageTag
,
const
OUString
&
rVariant
)
{
/* FIXME: how should this work with any BCP47? */
return
icu
::
Locale
(
OUStringToOString
(
rLanguageTag
.
getLanguage
(),
RTL_TEXTENCODING_ASCII_US
).
getStr
(),
OUStringToOString
(
rLanguageTag
.
getCountry
(),
RTL_TEXTENCODING_ASCII_US
).
getStr
(),
OUStringToOString
(
rVariant
,
RTL_TEXTENCODING_ASCII_US
).
getStr
());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/i18nlangtag/languagetagicu.hxx
Dosyayı görüntüle @
4806df61
...
...
@@ -12,6 +12,7 @@
#include <sal/config.h>
#include <i18nlangtag/i18nlangtagdllapi.h>
#include <rtl/ustring.hxx>
#include <unicode/locid.h>
class
LanguageTag
;
...
...
@@ -37,6 +38,17 @@ public:
Always resolves an empty tag to the system locale.
*/
static
icu
::
Locale
getIcuLocale
(
const
LanguageTag
&
rLanguageTag
);
/** Obtain language tag as ICU icu::Locale, adding variant data.
From the LanguageTag only language and country are used to construct
the icu:Locale, the variant field is copied from rVariant. For example
needed to create an icu::Collator instance where the variant field
denotes the algorithm to be used.
Always resolves an empty tag to the system locale.
*/
static
icu
::
Locale
getIcuLocale
(
const
LanguageTag
&
rLanguageTag
,
const
OUString
&
rVariant
);
};
#endif // INCLUDED_I18NLANGTAG_LANGUAGETAGICU_HXX
...
...
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