之前写了flashbulid、initellij下的flex国际化配置,它们都是在本地打包发布的,那么我们的工程用maven管理了,需要自动发布。这时候如何修改flex的pom文件,来让它build的时候支持国际化呢?
同理,我们需要在Maven build flex的插件配置标签里配置国际化支持,看代码:
<build> <finalName>FlexI18nTest</finalName> <sourceDirectory>src</sourceDirectory> <outputDirectory>./out</outputDirectory> <plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>${flexmojos.version}</version> <extensions>true</extensions> <configuration> <sourceFile>FlexI18nTest.mxml</sourceFile> <outputDirectory>./out</outputDirectory> <localesSourcePath> ${basedir}/locale/{locale} </localesSourcePath> <localesCompiled> <locale>en_US</locale> <locale>zh_CN</locale> </localesCompiled> <policyFileUrls> <!--- cross domain policy for each RSL entry --> <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url> <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url> <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url> </policyFileUrls> <rslUrls> <url> http://fpdownload.adobe.com/pub/{extension}/flex/${flex.sdk.version}/{artifactId}_{version}.{extension} </url> <url> http://fpdownload.adobe.com/pub/{extension}/tlf/${flex.tlf.version}/{artifactId}_${flex.tlf.version}.{extension} </url> <url> http://fpdownload.adobe.com/pub/{extension}/flex/${flex.sdk.version}/{artifactId}_${flex.osmf.version}.{extension} </url> </rslUrls> <debug>true</debug> <swfVersion>11</swfVersion> <targetPlayer>10.2</targetPlayer> <storepass/> <optimize>true</optimize> <showWarnings>true</showWarnings> <allowSourcePathOverlap>true</allowSourcePathOverlap> </configuration> </plugin> </plugins> </build>
Flexmojos 版本号:4.0-RC2
Maven版本号:4.0.0
我添加了两种语言支持 ,中文和英文。
<localesSourcePath> ${basedir}/locale/{locale} </localesSourcePath>
<localesCompiled> <locale>en_US</locale> <locale>zh_CN</locale> </localesCompiled>