Flex - 本地化和资源模块 - 运行时错误
我创建了一个应用程序,其中包含许多模块并使用 Parsley 框架。 Ant 用于构建应用程序。 最近想到使用Resource Bundles,并通过在src下创建locale/en_US文件夹的方式在系统中实现。我添加了一个 Portal.properties 文件,其中定义了所有字符串。
在我的模块中,我添加了元数据
<fx:Metadata>
[ResourceBundle("portal")]
</fx:Metadata>
在 ant 构建文件中,我在 mxmlc 中添加了以下行。
<locale>@{locale}</locale>
<source-path path-element="${myapp.flex.app.locale}/{locale}"/>
<include-resource-bundles>portal</include-resource-bundles>
构建工作正常,当我部署应用程序并在浏览器中打开它时,我遇到了 Flash 播放器抛出的许多错误。 但如果我忽略这些消息,它工作正常。我的字符串被属性文件中的值替换,但是如何阻止抛出运行时错误?
我收到以下错误。
Error: Unable to load resource module from portal
at MethodInfo-637()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfo/errorHandler()
任何帮助将不胜感激。
I've created an application that includes a number of Modules and uses Parsley framework.
Ant is used to build the application.
Recently I thought of using Resource Bundles and implemented it in the system by creating a locale/en_US folder under the src. I added a portal.properties file with all my strings defined.
In my modules, I added the metadata
<fx:Metadata>
[ResourceBundle("portal")]
</fx:Metadata>
In the ant build file, I added the below lines within mxmlc.
<locale>@{locale}</locale>
<source-path path-element="${myapp.flex.app.locale}/{locale}"/>
<include-resource-bundles>portal</include-resource-bundles>
The build works fine and when I deploy the application and open it in my browser, I'm greeted with many errors thrown by the Flash player.
But if I dismiss the messages, its working fine. My strings are replaced with the values in the property file, but how do I stop the runtime errors being thrown up?
I get the below error.
Error: Unable to load resource module from portal
at MethodInfo-637()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfo/errorHandler()
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否将以下内容包含到您的 ant 构建中
?
Do you include into your ant build the following
?