?? globalization.java
字號(hào):
package inline.sys;
import java.util.*;
public class Globalization extends Hashtable
{
private static Hashtable mytable;
public static final int ENGLISH_LCID = 1033;
public static final int RUSSIAN_LCID = 1049;
private static int system_lcid;
protected static final String[] langstmap = {"en-en", "ru-ru"};
protected static int[] langintmap = {ENGLISH_LCID, RUSSIAN_LCID};
public void remap(Integer[] langs, String[] table)
{
int syslcid = getSystemLCID();
int id = 0;
if (langs==null || table==null)
{
return;
}
// find id
for(int i=0;i<langs.length;i++)
{
if (langs[i].intValue() == syslcid)
{
id = i;
break;
}
}
clear();
// store in hashtable
for(int i=0;i<table.length;i=i+3)
{
String td = table[i];
String tx = table[i+1+id];
if (tx == null) tx = table[i+1]; // drop to defaults
if (put(td, tx) != null)
{
Log.fire("Dublicate lang string at "+Integer.toHexString(td.charAt(0)));
}
}
}
public String take(int code)
{
String res = (String)get(""+(char)code);
if (res == null) res = "?";
return res;
}
public static void setSystemLCID(int olcid)
{
system_lcid = olcid;
}
public static int getSystemLCID()
{
int syslcid = ENGLISH_LCID; // default
if (system_lcid != 0)
{
syslcid = system_lcid;
}
else
{
// detect
String locale = System.getProperty("microedition.locale").toLowerCase();
for(int i=0;i<langstmap.length;i++)
{
if (langstmap[i].compareTo(locale)==0)
{
syslcid = langintmap[i];
break;
}
}
system_lcid = syslcid;
};
return syslcid;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -