黑莓手机:本地化资源包 [英] BlackBerry: Localization, Resource Bundle

查看:262
本文介绍了黑莓手机:本地化资源包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助与黑莓本地化。我跟着在 http://na.blackberry.com/eng/的教训开发商/资源/ developer_labs.jsp#tab_tab_jde
题为本地化应用即可。我创建了我的资源头文件(.rrh)和我的资源内容文件(.rrc)。我很困惑,在那里他们得到这个CityInfoBResource?它是一个被称为CityInfoBResource.java文件,它包含了一些定义。见注1.如何生成这个文件?请给我一些线索,我怎么能生成此文件或点我在正确的方向,谢谢你。

 注1:
包com.rim.samples.cityinfo.i18n;公共接口CityInfoBResource {
    //的哈希:com.rim.training.cityinfo.i18n.CityInfoB。
    bundle_ID的长= 0x14bf5713287b65c0L;
    字符串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;
}


解决方案

您已经pretty多少得到了它。当你创建一个名为资源头文件'MyFile.rrh'(以及相应的.rrc文件(S)),黑莓编译器会自动生成一个名为在同一个包'MyFileResource一个接口(或者更具体地说,在相应的包该目录中.rrh文件中)。

这是在编译时完成的,这样你就不会真正得到相应的在任何一点上,接口的.java文件。但是,JDE和JDE Eclipse插件也将认识到,当您将更改保存到您的.rrh文件并提供给编辑环境这些变化所以当你正在开发你没有得到警告。

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;
}

解决方案

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.

这篇关于黑莓手机:本地化资源包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆