add isEnglish helper

This commit is contained in:
Doug MacEachern 2007-03-04 16:55:58 +00:00
parent 77cde94e95
commit 3b5ce46c4d
1 changed files with 18 additions and 5 deletions

View File

@ -69,8 +69,25 @@ public class LocaleInfo extends Win32 {
this.id = id; this.id = id;
} }
private static int getPrimaryLangId(int id) {
return id & 0x3ff;
}
public int getPrimaryLangId() { public int getPrimaryLangId() {
return this.id & 0x3ff; return getPrimaryLangId(this.id);
}
private static int getSubLangId(int id) {
return id >> 10;
}
public int getSubLangId() {
return getSubLangId(this.id);
}
public static boolean isEnglish() {
int id = getSystemDefaultLCID();
return getPrimaryLangId(id) == LANG_ENGLISH;
} }
public String getPerflibLangId() { public String getPerflibLangId() {
@ -88,10 +105,6 @@ public class LocaleInfo extends Win32 {
return fid.toString(); return fid.toString();
} }
public int getSubLangId() {
return this.id >> 10;
}
public String getAttribute(int attr) { public String getAttribute(int attr) {
return getAttribute(this.id, attr); return getAttribute(this.id, attr);
} }