Flex Localization
Hi,
I am having problems defining the source file for localization. Compiler argument that I have provided is -source-path ./locale/{locale}. When compiling, I receive "command line: unable to open './locale/en_US'" error. locale folder is under src directory.
How can I fix this, I tried many combinations but couldn't succeed.
Thanks.
Please sign in to leave a comment.
In IntelliJ IDEA you don't need to add -source-path option.
First, you need to mark all subfolders of 'locale' folder as source roots (not locale folder itself !). You can do it in the Project View from context menu (Mark Dirtectory As), or at Project Structure | Modules | [your module] dialog.
Second, you need to specify the full list of supported locales at Project Structure | Modules | [your module] | [your build configuration subnode] | Compiler Options tab. Just click to teh right from 'Locales' option in the table. Make sure that your Additional compiler options do not contain -locale, as it overrides options set in the table.
Thanks for the fast response!
I did everything you said. Now I am having resource bundle error.
could not find source for resource bundle LocalizedStrings.
<fx:Metadata>
[ResourceBundle("LocalizedStrings")]
</fx:Metadata>
I have put this on top my <fx:Script> part in my mxml file.
Thanks.
I think you mean <fx:Metadata> which is the child of a parent tag.
Make sure that LocalizedStrings.properties file exists in all locale-specific source roots. Paste full content of the Messages tool window command line here if you still have problems (use 'Export to text file' action at its left side to copy content).
Well I found the problem :)
I have 2 modules in a project and I wrote metadata part in the 2nd project, whereas localization part was in the 1st project.
Thanks again for your help.