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
6c89f2e7
Kaydet (Commit)
6c89f2e7
authored
Şub 18, 2013
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
prepare LanguageTag(rtl_Locale) for handling variant/modifier
Change-Id: Ic500bb2eecd090d5568703740c3700c6d50635ae
üst
961ffaa7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
languagetag.cxx
i18npool/source/languagetag/languagetag.cxx
+41
-7
No files found.
i18npool/source/languagetag/languagetag.cxx
Dosyayı görüntüle @
6c89f2e7
...
@@ -44,6 +44,15 @@ using namespace com::sun::star;
...
@@ -44,6 +44,15 @@ using namespace com::sun::star;
#define ISO639_LANGUAGE_TAG "qlt"
#define ISO639_LANGUAGE_TAG "qlt"
// Helper to ensure lt_error_t is free'd
struct
myLtError
{
lt_error_t
*
p
;
myLtError
()
:
p
(
NULL
)
{}
~
myLtError
()
{
if
(
p
)
lt_error_unref
(
p
);
}
};
// "statics" to be returned as const reference to an empty locale and string.
// "statics" to be returned as const reference to an empty locale and string.
namespace
{
namespace
{
struct
theEmptyLocale
:
public
rtl
::
Static
<
lang
::
Locale
,
theEmptyLocale
>
{};
struct
theEmptyLocale
:
public
rtl
::
Static
<
lang
::
Locale
,
theEmptyLocale
>
{};
...
@@ -239,6 +248,37 @@ LanguageTag::LanguageTag( const rtl_Locale & rLocale )
...
@@ -239,6 +248,37 @@ LanguageTag::LanguageTag( const rtl_Locale & rLocale )
mbCachedCountry
(
false
),
mbCachedCountry
(
false
),
mbIsFallback
(
false
)
mbIsFallback
(
false
)
{
{
// The rtl_Locale follows the Open Group Base Specification,
// 8.2 Internationalization Variables
// language[_territory][.codeset][@modifier]
// On GNU/Linux systems usually being glibc locales.
// sal/osl/unx/nlsupport.c _parse_locale() parses them into
// Language: language 2 or 3 alpha code
// Country: [territory] 2 alpha code
// Variant: [.codeset][@modifier]
// Variant effectively contains anything that follows the territory, not
// looking for '.' dot delimiter or '@' modifier content.
if
(
!
maLocale
.
Variant
.
isEmpty
())
{
/* FIXME: let liblangtag parse this entirely with
* lt_tag_convert_from_locale() but that needs a patch to pass the
* string. */
#if 0
OString aStr = OUStringToOString( maLocale.Language + "-" + maLocale.Country + maLocale.Variant,
RTL_TEXTENCODING_UTF8);
myLtError aError;
theDataRef::get().incRef();
mpImplLangtag = lt_tag_convert_from_locale( aStr.getStr(), &aError.p);
maBcp47 = OStringToOUString( lt_tag_get_string( MPLANGTAG), RTL_TEXTENCODING_UTF8);
mbInitializedBcp47 = true;
maLocale = lang::Locale();
mbInitializedLocale = false;
#else
SAL_WARN
(
"i18npool.langtag"
,
"rtl_Locale Variant modifier not handled"
);
// For now clear anything unknown to us.
maLocale
.
Variant
=
OUString
();
#endif
}
}
}
...
@@ -480,13 +520,7 @@ bool LanguageTag::canonicalize()
...
@@ -480,13 +520,7 @@ bool LanguageTag::canonicalize()
mpImplLangtag
=
lt_tag_new
();
mpImplLangtag
=
lt_tag_new
();
}
}
// ensure error is free'd
myLtError
aError
;
struct
myerror
{
lt_error_t
*
p
;
myerror
()
:
p
(
NULL
)
{}
~
myerror
()
{
if
(
p
)
lt_error_unref
(
p
);
}
}
aError
;
if
(
lt_tag_parse
(
MPLANGTAG
,
OUStringToOString
(
maBcp47
,
RTL_TEXTENCODING_UTF8
).
getStr
(),
&
aError
.
p
))
if
(
lt_tag_parse
(
MPLANGTAG
,
OUStringToOString
(
maBcp47
,
RTL_TEXTENCODING_UTF8
).
getStr
(),
&
aError
.
p
))
{
{
...
...
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