Searching...
Sunday, 4 December 2016

Java program to print available Locales

12:44

Here is one java program to print all java supported locales and its countries.

package com.vinod.testt;


import java.text.SimpleDateFormat;
import java.util.Locale;


public class LocaleTest {

    public static void main(String[] args) {
        Locale locales[] = SimpleDateFormat.getAvailableLocales();
        for (int i = 0; i < locales.length; i++) {
            System.out.printf("%10s - %s, %s \n" , locales[i].toString(),
                locales[i].getDisplayName(), locales[i].getDisplayCountry());
        }}

}

Output

     ar_AE - Arabic (United Arab Emirates), United Arab Emirates
     ar_JO - Arabic (Jordan), Jordan
     ar_SY - Arabic (Syria), Syria
     hr_HR - Croatian (Croatia), Croatia
     fr_BE - French (Belgium), Belgium
     es_PA - Spanish (Panama), Panama
     mt_MT - Maltese (Malta), Malta
     es_VE - Spanish (Venezuela), Venezuela
        bg - Bulgarian,
     zh_TW - Chinese (Taiwan), Taiwan
        it - Italian,
        ko - Korean,
        uk - Ukrainian,
        lv - Latvian,
     da_DK - Danish (Denmark), Denmark
     es_PR - Spanish (Puerto Rico), Puerto Rico
     vi_VN - Vietnamese (Vietnam), Vietnam
     en_US - English (United States), United States
     sr_ME - Serbian (Montenegro), Montenegro
     sv_SE - Swedish (Sweden), Sweden
     es_BO - Spanish (Bolivia), Bolivia
     en_SG - English (Singapore), Singapore
     ar_BH - Arabic (Bahrain), Bahrain
        pt - Portuguese,
     ar_SA - Arabic (Saudi Arabia), Saudi Arabia
        sk - Slovak,
     ar_YE - Arabic (Yemen), Yemen
     hi_IN - Hindi (India), India
        ga - Irish,
     en_MT - English (Malta), Malta
     fi_FI - Finnish (Finland), Finland
        et - Estonian,
        sv - Swedish,
        cs - Czech,
sr_BA_#Latn - Serbian (Latin,Bosnia and Herzegovina), Bosnia and Herzegovina
        el - Greek,
     uk_UA - Ukrainian (Ukraine), Ukraine
        hu - Hungarian,
     fr_CH - French (Switzerland), Switzerland
        in - Indonesian,
     es_AR - Spanish (Argentina), Argentina
     ar_EG - Arabic (Egypt), Egypt
ja_JP_JP_#u-ca-japanese - Japanese (Japan,JP), Japan
     es_SV - Spanish (El Salvador), El Salvador
     pt_BR - Portuguese (Brazil), Brazil
        be - Belarusian,
     is_IS - Icelandic (Iceland), Iceland
     cs_CZ - Czech (Czech Republic), Czech Republic
        es - Spanish,
     pl_PL - Polish (Poland), Poland
        tr - Turkish,
     ca_ES - Catalan (Spain), Spain
     sr_CS - Serbian (Serbia and Montenegro), Serbia and Montenegro
     ms_MY - Malay (Malaysia), Malaysia
        hr - Croatian,
        lt - Lithuanian,
     es_ES - Spanish (Spain), Spain
     es_CO - Spanish (Colombia), Colombia
     bg_BG - Bulgarian (Bulgaria), Bulgaria
        sq - Albanian,
        fr - French,
        ja - Japanese,
     sr_BA - Serbian (Bosnia and Herzegovina), Bosnia and Herzegovina
        is - Icelandic,
     es_PY - Spanish (Paraguay), Paraguay
        de - German,
     es_EC - Spanish (Ecuador), Ecuador
     es_US - Spanish (United States), United States
     ar_SD - Arabic (Sudan), Sudan
        en - English,
     ro_RO - Romanian (Romania), Romania
     en_PH - English (Philippines), Philippines
        ca - Catalan,
     ar_TN - Arabic (Tunisia), Tunisia
sr_ME_#Latn - Serbian (Latin,Montenegro), Montenegro
     es_GT - Spanish (Guatemala), Guatemala
        sl - Slovenian,
     ko_KR - Korean (South Korea), South Korea
     el_CY - Greek (Cyprus), Cyprus
     es_MX - Spanish (Mexico), Mexico
     ru_RU - Russian (Russia), Russia
     es_HN - Spanish (Honduras), Honduras
     zh_HK - Chinese (Hong Kong), Hong Kong
  no_NO_NY - Norwegian (Norway,Nynorsk), Norway
     hu_HU - Hungarian (Hungary), Hungary
     th_TH - Thai (Thailand), Thailand
     ar_IQ - Arabic (Iraq), Iraq
     es_CL - Spanish (Chile), Chile
        fi - Finnish,
     ar_MA - Arabic (Morocco), Morocco
     ga_IE - Irish (Ireland), Ireland
        mk - Macedonian,
     tr_TR - Turkish (Turkey), Turkey
     et_EE - Estonian (Estonia), Estonia
     ar_QA - Arabic (Qatar), Qatar
 sr__#Latn - Serbian (Latin),
     pt_PT - Portuguese (Portugal), Portugal
     fr_LU - French (Luxembourg), Luxembourg
     ar_OM - Arabic (Oman), Oman
        th - Thai,
     sq_AL - Albanian (Albania), Albania
     es_DO - Spanish (Dominican Republic), Dominican Republic
     es_CU - Spanish (Cuba), Cuba
        ar - Arabic,
        ru - Russian,
     en_NZ - English (New Zealand), New Zealand
     sr_RS - Serbian (Serbia), Serbia
     de_CH - German (Switzerland), Switzerland
     es_UY - Spanish (Uruguay), Uruguay
        ms - Malay,
     el_GR - Greek (Greece), Greece
     iw_IL - Hebrew (Israel), Israel
     en_ZA - English (South Africa), South Africa
th_TH_TH_#u-nu-thai - Thai (Thailand,TH), Thailand
        hi - Hindi,
     fr_FR - French (France), France
     de_AT - German (Austria), Austria
        nl - Dutch,
     no_NO - Norwegian (Norway), Norway
     en_AU - English (Australia), Australia
        vi - Vietnamese,
     nl_NL - Dutch (Netherlands), Netherlands
     fr_CA - French (Canada), Canada
     lv_LV - Latvian (Latvia), Latvia
     de_LU - German (Luxembourg), Luxembourg
     es_CR - Spanish (Costa Rica), Costa Rica
     ar_KW - Arabic (Kuwait), Kuwait
        sr - Serbian,
     ar_LY - Arabic (Libya), Libya
        mt - Maltese,
     it_CH - Italian (Switzerland), Switzerland
        da - Danish,
     de_DE - German (Germany), Germany
     ar_DZ - Arabic (Algeria), Algeria
     sk_SK - Slovak (Slovakia), Slovakia
     lt_LT - Lithuanian (Lithuania), Lithuania
     it_IT - Italian (Italy), Italy
     en_IE - English (Ireland), Ireland
     zh_SG - Chinese (Singapore), Singapore
        ro - Romanian,
     en_CA - English (Canada), Canada
     nl_BE - Dutch (Belgium), Belgium
        no - Norwegian,
        pl - Polish,
     zh_CN - Chinese (China), China
     ja_JP - Japanese (Japan), Japan
     de_GR - German (Greece), Greece
sr_RS_#Latn - Serbian (Latin,Serbia), Serbia
        iw - Hebrew,
     en_IN - English (India), India
     ar_LB - Arabic (Lebanon), Lebanon
     es_NI - Spanish (Nicaragua), Nicaragua
        zh - Chinese,
     mk_MK - Macedonian (Macedonia), Macedonia
     be_BY - Belarusian (Belarus), Belarus
     sl_SI - Slovenian (Slovenia), Slovenia
     es_PE - Spanish (Peru), Peru
     in_ID - Indonesian (Indonesia), Indonesia
     en_GB - English (United Kingdom), United Kingdom

0 comments: