source: josm/trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java@ 1862

Last change on this file since 1862 was 1755, checked in by stoecker, 15 years ago

fixed build error due to slippy map change, i18n update, added pt_BR

File size: 1.0 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.tools;
3
4import java.util.Locale;
5
6public class LanguageInfo {
7 static public String getLanguageCodeWiki()
8 {
9 String languageCode = getLanguageCode();
10 if(languageCode.equals("en"))
11 return "";
12 else if(languageCode.equals("pt_BR"))
13 return "Pt:";
14 return languageCode.substring(0,1).toUpperCase() + languageCode.substring(1) + ":";
15 }
16 static public String getLanguageCode()
17 {
18 String full = Locale.getDefault().toString();
19 if (full.equals("iw_IL"))
20 return "he";
21 /* list of non-single codes supported by josm */
22 else if (full.equals("en_GB"))
23 return full;
24 return Locale.getDefault().getLanguage();
25 }
26 static public String getLanguageCodeXML()
27 {
28 return getLanguageCode()+".";
29 }
30 static public String getLanguageCodeManifest()
31 {
32 return getLanguageCode()+"_";
33 }
34}
Note: See TracBrowser for help on using the repository browser.