BlackBerry: Localization, Resource Bundle

送分小仙女□ 提交于 2019-12-22 07:06:04

问题


I need some help with BlackBerry Localization. I followed the lesson at http://na.blackberry.com/eng/developers/resources/developer_labs.jsp#tab_tab_jde entitled Localizing an application. I have created my Resource Header File (.rrh) and my Resource Content File (.rrc). I am confused as to where they get this "CityInfoBResource"? It is a file that is called "CityInfoBResource.java" and it contains some definitions. See Note 1. How is this file generated? Please give me some clues as to how I can generate this file or point me in the right direction, thank you.

Note 1:
package com.rim.samples.cityinfo.i18n;

public interface CityInfoBResource {
    // Hash of: "com.rim.training.cityinfo.i18n.CityInfoB".
    long BUNDLE_ID = 0x14bf5713287b65c0L;
    String BUNDLE_NAME = "com.rim.training.cityinfo.i18n.CityInfoB";

    int FIELD_TITLE = 1;
    int FIELD_NEWYORK_POP = 17;
    int CLOSE = 20;
    int FIELD_LA_SIGHTS = 21;
    int FIELD_CITIES = 2;
    int FIELD_STATE = 7;
    int APPLICATION_TITLE = 0;
    int FIELD_LA_POP = 10;
    int FIELD_NEWYORK_STATE = 18;
    int FIELD_CHICAGO_SIGHTS = 15;
    int FIELD_CHICAGO_STATE = 14;
    int FIELD_CHOICE = 3;
    int FIELD_CHICAGO_POP = 13;
    int MENUITEM_VIEW = 4;
    int FIELD_LA = 9;
    int FIELD_NEWYORK = 16;
    int FIELD_LA_STATE = 11;
    int FIELD_CHICAGO = 12;
    int FIELD_NEWYORK_SIGHTS = 19;
    int FIELD_POP = 6;
    int MENUITEM_CLOSE = 5;
    int FIELD_SIGHTS = 8;
}

回答1:


You've pretty much got it. When you create a resource header file called 'MyFile.rrh' (and corresponding .rrc file(s)), the BlackBerry compiler will automatically generate an interface called 'MyFileResource' in the same package (or to be specific, in the package corresponding to the directory your .rrh file is in).

This is done at compile time, so you don't actually get a corresponding .java file for that interface at any point. But the JDE and the JDE Plugin for Eclipse will also recognize when you save changes to your .rrh file and make those changes available to the editing environment so you don't get warnings while you're developing.



来源:https://stackoverflow.com/questions/568079/blackberry-localization-resource-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!