BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-04-2007, 03:39 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: GPRS
Posts: 68
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default problem of localizaton

Please Login to Remove!

Hi,everyone:

I'm learning the localization of a demo, and I do the steps as develop guid said ,but there is still a problem during building:cannot resolve symbol
symbol : class CountryInfoResource
Code:
/*
 * CountryInfo.java
 *
 * ?<your company here>, 2003-2005
 * Confidential and proprietary.
 */

package com.rim.samples.countryinfo.i18n;

import net.rim.device.api.ui.*;

import net.rim.device.api.ui.component.*;

import net.rim.device.api.ui.container.*;

import net.rim.device.api.system.*;

import net.rim.device.api.i18n.*;
//import com.resource.*;

 

public class CountryInfo extends UiApplication {

    public static void main(String[] args) {

       CountryInfo theApp = new CountryInfo();

       theApp.enterEventDispatcher();

       }

    

    public CountryInfo() {

       pushScreen(new CountryInfoScreen());

       }

}

 

final class CountryInfoScreen extends MainScreen implements CountryInfoResource {

    private InfoScreen _infoScreen;

    private ObjectChoiceField choiceField;

    private int select;

    private static ResourceBundle _resources = 

       ResourceBundle.getBundle( BUNDLE_ID, BUNDLE_NAME );

    

    public CountryInfoScreen() {

       super();

       LabelField title = new LabelField(_resources.getString(APPLICATION_TITLE),

              LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);

       

       setTitle(title);

       add(new RichTextField(_resources.getString(FIELD_TITLE)));

       String choices[] = _resources.getStringArray(FIELD_COUNTRIES);

       choiceField = new ObjectChoiceField(_resources.getString(FIELD_COUNTRIES), choices);

       add(choiceField);

       }

    

    public boolean onClose() {

       Dialog.alert(_resources.getString(CLOSE));

       System.exit(0);

       return true;

       }

    

    private MenuItem _viewItem = new MenuItem(_resources, MENUITEM_VIEW, 110, 10) {

       public void run() {

           select = choiceField.getSelectedIndex();

           _infoScreen = new InfoScreen();

           UiApplication.getUiApplication().pushScreen(_infoScreen);

           }

       };

       

    private MenuItem _closeItem = new MenuItem(_resources, MENUITEM_CLOSE, 200000, 10) {

       public void run() {

           onClose();

           }

       };

       

    protected void makeMenu( Menu menu, int instance ) {

       menu.add(_viewItem);

       menu.add(_closeItem);

       }

    

    private class InfoScreen extends MainScreen {

       public InfoScreen() {

           super();

           LabelField lf = new LabelField();

           BasicEditField popField = new BasicEditField(

                  _resources.getString(FIELD_POP), null, 20, Field.READONLY);

           BasicEditField langField = new BasicEditField(

                  _resources.getString(FIELD_LANG), null, 20, Field.READONLY);

           BasicEditField citiesField = new BasicEditField(

                  _resources.getString(FIELD_CITIES), null, 50, Field.READONLY);

           add(lf);

           add(new SeparatorField());

           add(popField);

           add(langField);

           add(citiesField);

           if (select == 0) {

              lf.setText("US");

              popField.setText("FIELD_US_POP");

              langField.setText("FIELD_US_LANG");

              citiesField.setText("FIELD_US_CITIES");

              } 

           else if (select == 1) {

              lf.setText(_resources.getString(FIELD_CHINA));

              //popField.setText(_resources.getString(FIELD_CHINA_POP));

              //langField.setText(_resources.getString(FIELD_CHINA_LANG));

              //citiesField.setText(_resources.getString(FIELD_CHINA_CITIES));

              } 

           else if (select == 2) {

              lf.setText("FIELD_GERMANY");

              //popField.setText(_resources.getString(FIELD_GERMANY_POP));

              //langField.setText(_resources.getString(FIELD_GERMANY_LANG));

              //citiesField.setText(_resources.getString(FIELD_GERMANY_CITIES));

              }

           }

       }

    }
I'm doing this in JDE4.2.1, and I have added the files "CountryInfo.rrc" and "CountryInfo.rrh" to the project, and there at the folder of "com\rim\samples\countryinfo\i18n" with the file CountryInfo.java.

when I'm building the program, it says that: cannot resolve symbol
symbol : class CountryInfoResource
location: class com.rim.samples.countryinfo.i18n.CountryInfoScreen
final class CountryInfoScreen extends MainScreen implements CountryInfoResource {

that means it can't find the class CountryInfoResource, but the CountryInfoResource should be automaticlly produced by JDE? Is there any wrong?
or where should I change it?

I did the lab "Localizing an application" in blackberry's lab , and did the steps as it suggesting, finally I successed in building the cityinfob.jdw. but I still din't find the file "CityInfoBResource.java", it's strange for me!

Does anyone have any ideas?
Thank you very much!

Last edited by streamh : 09-04-2007 at 03:46 AM.
Offline  
Old 09-04-2007, 05:01 AM   #2 (permalink)
New Member
 
Join Date: May 2007
Model: 8707
PIN: N/A
Carrier: vodafone
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you import the resuorce package path defined under options in the .rrh file?
//jol
Offline  
Old 09-04-2007, 08:01 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: GPRS
Posts: 68
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, i have done that
the resuorce package path is "com.rim.samples.cityinfo.i18n" under options!
Offline  
Old 09-05-2007, 01:23 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

streamh,

See the following URL:
BlackBerry - BlackBerry | Wireless Handheld Devices, Software & Services from Research In Motion (RIM)

Hope, this will help!

Enjoy,
ARIF
Offline  
Old 09-05-2007, 10:57 PM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: GPRS
Posts: 68
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you ,ARIF.
I read the article carefully and did what he said step by step, but I still could not solve the problem:it could not resolve the symbol CountryInfo.
I didn't find any words about how to create the file CountryInfoResource.java in the article , and I think that this file should be created by the JDE's compiler, is it right?

Finally , I got a demo from official website and there is an file CityInfoBResource.java which I didn't know where is it from. And I created a CountryInfoResource.java according the format of CityInfoBResource.java. Though I builded the program successfully, it made an error while in executing for the reason of cann't get a valid bundlexxx8230;xxx8230;

I don't know what's the problem of it ?
anyone please give me any ideas if you have localized an application!
Thank you very much!
Offline  
Old 09-06-2007, 12:44 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Location: Bangladesh
Model: 8800
PIN: N/A
Carrier: EDGE
Posts: 93
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Welcome streamh!

Quote:
Originally Posted by streamh View Post
I got a demo from official website and there is an file CityInfoBResource.java which I didn't know where is it from. And I created a CountryInfoResource.java according the format of CityInfoBResource.java. Though I builded the program successfully, it made an error while in executing for the reason of cann't get a valid bundlexxx8230;xxx8230;
I'm not sure, what is the actual problem that you are facing. One thing, are you going with the steps that are described in the following Link to modify cityinfob application to support localization?

URL:
BlackBerry - BlackBerry | Wireless Handheld Devices, Software & Services from Research In Motion (RIM)

Cheers,
ARIF

Last edited by arifzaman : 09-06-2007 at 12:46 AM.
Offline  
Old 09-06-2007, 05:15 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2007
Model: 8800
PIN: N/A
Carrier: GPRS
Posts: 68
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ARIF,thank you very much for your help! I have solved the problem according the artical from you!
By compared with the two articles, I made mistakes during the creation of .rrh file . I input the wrong package path and the program can not find it!
And also the AppnameResource.java will not created in the project folder , maybe it's a temprorary file!
Thanks again!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.