我已经通过BB应用程序世界的供应商门户上传了我的应用程序。我已经用英语和西班牙语给出了我的应用程序的描述。但是当我看到提交的应用程序的链接时,描述仅以英文显示。无论如何,我可以将西班牙语作为主要语言。
这是该应用的链接: http://appworld.blackberry.com/webstore/content/107905/?lang=es
答案 0 :(得分:0)
使用可以解决您的解决方案的ResourceBundle
这可能会帮助您创建ResourceBundle 下面是一个示例程序,可以通过单击按钮
将英语转换为法语,反之亦然public class Screen extends MainScreen implements AppResource{
LabelField lf1,lf2;
ResourceBundle rb;
ButtonField Convertor;
boolean eng;
Screen()
{
Convertor=new ButtonField("Convert to French");
eng=true;
rb=ResourceBundle.getBundle(AppResource.BUNDLE_ID, AppResource.BUNDLE_NAME);
lf1=new LabelField(rb.getString(LABEL));
lf2=new LabelField(rb.getString(TEXT));
add(lf1);
add(lf2);
add(Convertor);
}
protected boolean navigationClick(int status, int time) {
// TODO Auto-generated method stub
Field f=getFieldWithFocus();
if(f==Convertor)
{
if(eng==true)
{
Locale.setDefault(Locale.get(Locale.LOCALE_fr, null));
lf1.setText(rb.getString(LABEL));
lf2.setText(rb.getString(TEXT));
eng=false;
Convertor.setLabel("Convert to English");
}
else if(eng==false)
{
Locale.setDefault(Locale.get(Locale.LOCALE_en, null));
lf1.setText(rb.getString(LABEL));
lf2.setText(rb.getString(TEXT));
eng=true;
Convertor.setLabel("Convert to French");
}
}
return super.navigationClick(status, time);
}
}
答案 1 :(得分:0)
查看链接以获取更多信息
http://www.javabeat.net/qna/37-what-is-the-use-of-resourcebundle-in-java/
如果我没有错......资源包就是答案