Type: info
         Title: Language/locale fallback
     Posted by: [EMAIL PROTECTED]
      Affected: [EMAIL PROTECTED],[EMAIL PROTECTED],i18npool
Effective from: cws localefallback


*Summary*
--------
Implemented methods to convert between LanguageType and Locale and vice versa 
and obtain a fall-back locale if no exact match was found, matching the 
language if possible, else returning the en_US locale.

#include <i18npool/mslangid.hxx>

class MsLangId
{
    [...]

+   static
+       ::com::sun::star::lang::Locale
+           convertLanguageToLocaleWithFallback(
+               LanguageType eLang );

+   static
+       LanguageType
+           convertLocaleToLanguageWithFallback(
+               const ::com::sun::star::lang::Locale & rLocale );

+   static
+       ::com::sun::star::lang::Locale
+           getFallbackLocale(
+               const ::com::sun::star::lang::Locale & rLocale );

+   static
+       LanguageType
+           getFallbackLanguage(
+               LanguageType nLang );

    [...]
};


*Description*
-------------
/** Convert a LanguageType to a Locale, resolving LANGUAGE_SYSTEM, falling
    back to a default locale if no exact match was found.
 */
static ::com::sun::star::lang::Locale
convertLanguageToLocaleWithFallback( LanguageType eLang );


/** Convert a Locale to a LanguageType with handling of an empty language
    name designating the SYSTEM language, falling back to a default locale
    if no exact match was found.
  */
static LanguageType convertLocaleToLanguageWithFallback(
        const ::com::sun::star::lang::Locale & rLocale );


/** Get fall-back Locale for Locale with handling of an empty language
name
    designating the SYSTEM language. Returns the same Locale if an exact
    match was found.
  */
static ::com::sun::star::lang::Locale getFallbackLocale(
        const ::com::sun::star::lang::Locale & rLocale );


/** Get fall-back LanguageType for LanguageType, resolving
LANGUAGE_SYSTEM.
    Returns the same LanguageType if an exact match was found.
  */
static LanguageType getFallbackLanguage( LanguageType nLang );



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to