Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 23
Registered: ‎12-10-2010
My Device: Not Specified

Locale / Resource Bundle - File or directory does not exist

Hi All,

 

I have been trying to get Locale / Resource Bundle working but it seems nothing works. Please take a look below and I would be grateful for any help. The code compile install and run - but a "File or directory does not exist" error stopped it.

 

 

 
private function retrieveMainMenuLabel():void{
	var bundle:LocaleResourceBundle = 
	        new LocaleResourceBundle();
			
	bundle.open(File.applicationDirectory.resolvePath
		("locale/en_US/resource.properties"));
			
	...

}

 

The red line is what is failing. The debug message is:

 

 

Error: Error #3003: File or directory does not exist.
	at flash.filesystem::FileStream/open()
	at qnx.locale::LocaleResourceBundle/open()[E:\hudson\workspace\Weekly-SWF_deckard_sdk\src\screen\src\qnx\locale\LocaleResourceBundle.as:123]
	at AppX/retrieveMainMenuLabel()[C:\Users\Default\Adobe Flash Builder 4\AppX\src\AppX.as:255]
	at AppX()[C:\Users\Default\Adobe Flash Builder 4\Bargain\src\AppX.as:64]

 

My directory structure is as follows:

 

 

AppX (dir)
  + src (dir)
    + AppX.as (file)
    + locale (dir)
       + en_US (dir)
         + resource.properties (file)
       + zh_TW (dir)
         + resource.properties (file)

 

I have set the following project properties:

 

Flex Build Path / Source Path / Additional source folders outside of the main source folder:   src\locale\en_US
   src\locale\zh_TW

Flex Compiler / Compiler Option / Additional compiler arguments:
   -locale=en_US,zh_TW

 

Many thanks in advance.

 

Happy holidays,

H

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Locale / Resource Bundle - File or directory does not exist

Contributor
Posts: 23
Registered: ‎12-10-2010
My Device: Not Specified

Re: Locale / Resource Bundle - File or directory does not exist

Hi John,

 

Thanks for your reply. Unfortunately it still does not seem to work. I got a little further though, when I compile the application, under the "bin-debug" directory, the "locale" directories are not there while the "asset" directory which contains JPEGs do.

 

Does this mean there are some issue with the compiler parameter that I use which means it is not automatically copying across the "resource.properties" file? Or are these text documents included in the compiled SWF?

 

I am using Adobe Flash Builder 4.

 

Many Thanks,

H

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Locale / Resource Bundle - File or directory does not exist

Try moving the "locale" directory under the "assets" directory so its /assets/locale/myresfiles.  See if that does the trick.

Contributor
Posts: 23
Registered: ‎12-10-2010
My Device: Not Specified

Re: Locale / Resource Bundle - File or directory does not exist

Hi John,

 

I tried your suggestion but unfortunately, it is not working. It seems to not like to include "properties" file. I also took a look at the bin-debug folder and the properties file is not there.

 

Any other ideas?

 

Many Thanks,

H

Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Locale / Resource Bundle - File or directory does not exist

Sorry about that.  I am not working on an app yet that needs localization.  I expect I will after the release of the PB and I get a feel of the launguages that have an interest in the system.  I hope someone else on this forum is going thr that process and can better help you.

Contributor
Posts: 23
Registered: ‎12-10-2010
My Device: Not Specified

Re: Locale / Resource Bundle - File or directory does not exist

Hi John,

 

No worries. I am appreciative of your help. At least, I can ticked a couple more possible errors off  - definitely worth "kudos" in my view.

 

Let's hope that RIM will publish more sample apps and documentation before playbook's launch (hint hint).

 

Cheers,

H

BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: Locale / Resource Bundle - File or directory does not exist

To open this file it has to be packaged in a bar file. If you open bar file (unzip) you should be able to see air/locale folder - if it is not there it is not packaged properly. To test - manually copy locale folder in the bin-debug and try to re-package. 

Contributor
Posts: 23
Registered: ‎12-10-2010
My Device: Not Specified

Re: Locale / Resource Bundle - File or directory does not exist

Hi Elena,

 

Thanks for the suggestion. Unfortunately the properties files are not copied under the bin-debug directory and as a result is not packaged into the bin file. Any suggestions on configuration settings?

 

I have follow this official Adobe tutorial (in terms of configuration / settings) but it does not seem to work with the Playbook SDK:

http://www.adobe.com/devnet/flex/articles/flex_localization_pt1.html

 

Any suggestions please let me know.

 

Many Thanks,

Hoi

Developer
Posts: 43
Registered: ‎12-22-2010
My Device: Not Specified

Re: Locale / Resource Bundle - File or directory does not exist

HI

I think you have to embed the files in your code, i.e. use them somewhere or use the [Embed( source="")]... method. Otherwise, they are not embeded with your code, I think that is why you see your images while you can not see other resources.

---------------------
a) If you like my response/post, please provide a Kudo (white star to the left).
b) If my post solved your problem please click on the Accept as Solution button.
----------------------