Cannot resolve resource bundle in Flex source code in Ultimate 2016.3

Answered

Hi,

Since I have upgraded to IDEA Ultimate 2016.3, the following lines of code get flagged with "Cannot resolve resource bundle" error.

<fx:Metadata>
[ResourceBundle("foo")]
</fx:Metadata>

this.resourceManager.getString('foo', 'bar');

The project directory structure is as follows:

myProject/src
myProject/src/main
myProject/src/main/flex
myProject/src/main/flex/...mxml
myProject/src/main/resources
myProject/src/main/resources/locale
myProject/src/main/resources/locale/en_US
myProject/src/main/resources/locale/en_US/foo.properties
myProject/src/test

The project iml file has the following segment:

<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/flex" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
</content>

For some reason, IDE cannot pick up "foo.properies" under source directory with the default locale, i.e. "myProject/src/main/resources/locale/en_US. Interestingly I didn't have this problem with version 15 before the upgrade.

Any help is appreciated.

0
2 comments

Hello, Jiang!

 

Please mark en_US folder as sources in File | Project structure | Modules.

1
Avatar
Permanently deleted user

@..., thanks, it worked for me ! 

0

Please sign in to leave a comment.