public static synchronized String getText(int i, String as[]) {
try {
    if(loc == null)
    loc = new Local();
    InputStream inputstream = loc.getClass().getResourceAsStream
                                             ("/lang." + phoneLang);
    if(inputstream == null)
        inputstream = loc.getClass().getResourceAsStream("/lang.xx");
    if(inputstream == null)
        return "NoLang";
    DataInputStream datainputstream = new DataInputStream(inputstream);
    datainputstream.skipBytes(i * 2);
    short word0 = datainputstream.readShort();
    datainputstream.skipBytes(word0 - i * 2 - 2);
    String s = datainputstream.readUTF();
    datainputstream.close();
    if(as != null)
        if(as.length == 1) {
            s = replace(s, "%U", as[0]);
        } else {
            for(int j = 0; j < as.length; j++)
                s = replace(s, "%" + j + "U", as[j]);
        }
    return s;
}
catch(Exception exception) {
    return "Err";
}
}
...
public static final String phoneLang = 
                           System.getProperty("microedition.locale");
