Kaydet (Commit) 9000ee0e authored tarafından Eike Rathke's avatar Eike Rathke

added convertToLocaleWithFallback()

Change-Id: I9eb1418721026a0d869b97aa577bc3196f960488
üst cfe0862c
...@@ -1640,4 +1640,11 @@ LanguageType LanguageTag::convertToLanguageTypeWithFallback( const OUString& rBc ...@@ -1640,4 +1640,11 @@ LanguageType LanguageTag::convertToLanguageTypeWithFallback( const OUString& rBc
return LanguageTag( rBcp47).makeFallback().getLanguageType( true); return LanguageTag( rBcp47).makeFallback().getLanguageType( true);
} }
// static
com::sun::star::lang::Locale LanguageTag::convertToLocaleWithFallback( const OUString& rBcp47 )
{
return LanguageTag( rBcp47).makeFallback().getLocale( true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -448,6 +448,19 @@ public: ...@@ -448,6 +448,19 @@ public:
*/ */
static LanguageType convertToLanguageTypeWithFallback( const OUString& rBcp47 ); static LanguageType convertToLanguageTypeWithFallback( const OUString& rBcp47 );
/** Convert BCP 47 string to Locale with fallback, convenience method.
NOTE: exists only for consistency with the other convertTo...()
methods, internally uses a temporary LanguageTag instance for
conversion so does not save anything compared to
LanguageTag(rBcp47).makeFallback().getLocale(bResolveSystem).
@see makeFallback()
Always resolves an empty tag to the system locale.
*/
static com::sun::star::lang::Locale convertToLocaleWithFallback( const OUString& rBcp47 );
private: private:
enum Decision enum Decision
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment