Community articlesetCurrentThreadLocale method
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Description

This method sets the language that the API uses for error reporting. By default, the API uses the language set by the application.
The API can report errors in the following languages:
Table 1. API supported languages
LanguageLocaleLocale Name
ArabicAlgeriaar_DZ

Bahrain ar_BH

Egyptar_EG

Iraqar_IQ

Jordanar_JO

Kuwaitar_KW

Lebanonar_LB

Libyaar_LY

Moroccoar_MA

Omanar_OM

Qatarar_QA

Saudi Arabiaar_SA

Sudanar_SD

Syriaar_SY

Tunisiaar_TN

United Arab Emiratesar_AE

Yemenar_YE
ChineseSimplified Han, Chinazh_Hans_CN

Simplified Han, Singaporezh_Hans_SG

Traditional Han, Hong Kong S.A.R., Chinazh_Hant_HK

Traditional Han, Taiwanzh_Hant_TW
CroatianCroatiahr_HT
CzechCzech Republiccs_CZ
DanishDenmarkda_DK
DutchBelgiumnl_BE

The Netherlandsnl_NL
EnglishAustraliaen_AU

Belgiumen_BE

Canadaen_CA

Hong Kong S.A.R., Chinaen_HK

Indiaen_IN

Irelanden_IE

New Zealanden_NZ

Philippinesen_PH

Singaporeen_SG

South Africaen_ZA

United Kingdomen_GB

United Statesen_US
FinnishFinlandfi_FI
FrenchBelgiumfr_BE

Canadafr_CA

Francefr_FR

Luxembourgfr_LU

Switzerlandfr_CH
GermanAustriade_AT

Germanyde_DE

Luxembourgde_LU

Switzerlandde_CH
GreekGreeceel_GR
HebrewIsraelhe_IL
HungarianHungaryhu_HU
ItalianItalyit_IT

Switzerlandit_CH
JapaneseJapanja_JP
KoreanSouth Koreako_KR
Norwegian BokmålNorwaynb_NO
PolishPolandpl_PL
PortugueseBrazilpt_BR

Portugalpt_PT
RomanianRomaniaro_RO
RussianRussianru_RU
SlovakSlovakiask_SK
SloveneSloveniasl_SI
SpanishArgentinaes_AR

Boliviaes_BO

Chilees_CL

Colombiaes_CO

Costa Ricaes_CR

Dominican Republices_DO

Ecuadores_EC

El Salvadores_SV

Guatemalaes_GT

Hondurases_HN

Mexicoes_MX

Nicaraguaes_NI

Panamaes_PA

Paraguayes_PY

Perues_PE

Puerto Ricoes_PR

Spaines_ES

United Stateses_US

Uruguayes_UY

Venezuelaes_VE
SwedishSwedensv_SE
TurkishTurkeytr_TR


The locale name consists of two parts: the language code and the country code, as shown
   <language code>_<COUNTRY CODE>

For example, to specify the Japanese locale, you would type:
   jp_JP

If you need a more specific locale, you may add additional codes after the country code. For example, to indicate French in France with a Euro dialect, you would type:
   fr_FR_EU


Method

   public void setCurrentThreadLocale(
      String theLocale
      ) throws UWIException;


Parameters

Table 2. set current thread locale parameters
ExpressionTypeDescription
theLocaleStringThe name of the locale.


Returns

Returns nothing if the call is successful, or throws a generic exception (UWIException) if an error occurs.

Example

The following method checks the language string to determine which locale to use. It then calls setCurrentThreadLocale to set the appropriate locale.
   public void setCurrentLanguage(String language) throws Exception
   {
   LocalizationManager theManager;
 
      theManager = IFSSingleton.GetLocalizationManager();
      if (language.equalsIgnoreCase("english"))
         theManager.setCurrentThreadLocale("en_US");
      else
         theManager.setCurrentThreadLocale("fr_CA");
   }