Well when creating a swf Flex only includes stuff that is somehow
directly or indirectly referenced from the main class. You can use
resource bundles without using the ResourceBundle Metadata Tag but I
think without it the compiler will not know what you are referencing.
Have you added the following to you application somewhere?
<fx:Metadata>
[ResourceBundle("Samples")]
</fx:Metadata>
Chris
2011/7/28 pawel <[email protected]>:
>
> Ok, lets take sample application as example. So I generate is with:
>
> mvn archetype:generate \
> -DarchetypeRepository=http://repository.sonatype.org/content/groups/
> public\
> -DarchetypeGroupId=org.sonatype.flexmojos \
> -DarchetypeArtifactId=flexmojos-archetypes-library \
> -DarchetypeVersion=3.5.0
>
> I named it MySample. Under MySample\src\main\locales\en_US\ I add file
> Samples.properties and add some properties in it. Now, I want to
> compile this project, and create resource bundle for en_US locale. I
> want resource bundle to include my Sample.properties. So I add to my
> pom.xml such lines:
> <configuration>
> <resourceBundlePath>${basedir}/src/main/locales/{locale}</
> resourceBundlePath>
> <runtimeLocales>
> <locale>en_US</locale>
> </runtimeLocales>
> </configuration>
>
> Then I compile it, but when creating resource bundles, my resource
> Sample.properties is not taken(mvn output below). It only takes some
> resouces that are declared by dependencies, that is 'containers core
> effects skins styles'. So my question is how to create resource bundle
> containing my resources? I think it's very basic thing you want to do
> while creating locale resources, probably I'm missing some basic thing
> I have to do. Below I copied mvn output, and whole pom I'm using.
> $ mvn compile
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building MySample Flex 1.0-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @
> MySample ---
> [debug] execute contextualize
> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> resources, i.e. build is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- flexmojos-maven-plugin:3.5.0:compile-swf (default-compile-
> swf) @ MySample ---
> [INFO] Flexmojos 3.5.0
> [INFO] Apache License - Version 2.0 (NO WARRANTY) - See COPYRIGHT
> file
> [WARNING] Source file was not defined, flexmojos will guess one.
> [WARNING] Unable to find license.jar on classpath. Check wiki for
> instructions about how to add it:
> https://docs.sonatype.org/display/FLEXMOJOS/FAQ#FAQ-1.3
> [INFO] Flex compiler configurations:
> -compiler.accessible=false
> -compiler.actionscript-file-encoding UTF-8
> -compiler.allow-source-path-overlap=false
> -compiler.as3=true
> -compiler.debug=false
> -compiler.es=false
> -compiler.external-library-path C:\Temp\FlexTest\MySample\target
> \classes\libraries\playerglobal.swc
> -compiler.fonts.local-fonts-snapshot C:\Temp\FlexTest\MySample\target
> \classes\fonts.ser
> -compiler.fonts.managers flash.fonts.JREFontManager
> flash.fonts.AFEFontManager flash.fonts.BatikFontManager
> -compiler.headless-server=false
> -compiler.include-libraries=
> -compiler.keep-all-type-selectors=false
> -compiler.keep-generated-actionscript=false
> -compiler.library-path C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\applicationupdater
> \3.3.0.4852\applicationupdater-3.3.0.4852.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework
> \applicationupdater_ui\3.3.0.4852\applicationupdater_ui-3.3.0.4852.swc
> C:\Documents and Settings\sg0212057\.m2\repository\com\adobe\flex
> \framework\flex\3.3.0.4852\flex-3.3.0.4852.swc C:\Documents and
> Settings\sg0212057\.m2\repository\com\adobe\flex\framework\framework
> \3.3.0.4852\framework-3.3.0.4852.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\rpc
> \3.3.0.4852\rpc-3.3.0.4852.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\utilities
> \3.3.0.4852\utilities-3.3.0.4852.swc
> -compiler.locale=
> -compiler.namespaces.namespace http://www.adobe.com/2006/mxml C:\Temp
> \FlexTest\MySample\target\classes\config-3.3.0.4852\mxml-manifest.xml
> -compiler.optimize=true
> -compiler.source-path C:\Temp\FlexTest\MySample\src\main\flex
> -compiler.strict=true
> -compiler.use-resource-bundle-metadata=true
> -compiler.verbose-stacktraces=false
> -default-background-color 8821927
> -default-frame-rate 24
> -default-script-limits 1000 60
> -default-size 500 375
> -licenses.license flashbuilder4 952307006650319154206597
> -metadata.date Thu Jul 28 13:34:25 CEST 2011
> -metadata.localized-title MySample Flex x-default
> -target-player 9.0.0
> -use-network=true
> -verify-digests=true -static-link-runtime-shared-libraries=false -load-
> config=
> -metadata.language+=en_US
> [INFO] Compiling resources bundles!
> [INFO] Installing resource bundle beacon: C:\cygwin\tmp\MySample-1.0-
> SNAPSHOT6573606085086044243.rb.swc
> [INFO] Generating resource bundle for locale: en_US
> [INFO] Flex compiler configurations:
> -compiler.accessible=false
> -compiler.actionscript-file-encoding UTF-8
> -compiler.allow-source-path-overlap=false
> -compiler.as3=true
> -compiler.debug=false
> -compiler.es=false
> -compiler.external-library-path C:\Temp\FlexTest\MySample\target
> \classes\libraries\playerglobal.swc
> -compiler.fonts.local-fonts-snapshot C:\Temp\FlexTest\MySample\target
> \classes\fonts.ser
> -compiler.fonts.managers flash.fonts.JREFontManager
> flash.fonts.AFEFontManager flash.fonts.BatikFontManager
> -compiler.headless-server=false
> -compiler.keep-all-type-selectors=false
> -compiler.keep-generated-actionscript=false
> -compiler.library-path C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\applicationupdater
> \3.3.0.4852\applicationupdater-3.3.0.4852.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework
> \applicationupdater_ui\3.3.0.4852\applicationupdater_ui-3.3.0.4852.swc
> C:\Documents and Settings\sg0212057\.m2\repository\com\adobe\flex
> \framework\flex\3.3.0.4852\flex-3.3.0.4852.swc C:\Documents and
> Settings\sg0212057\.m2\repository\com\adobe\flex\framework\framework
> \3.3.0.4852\framework-3.3.0.4852.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\rpc
> \3.3.0.4852\rpc-3.3.0.4852.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\utilities
> \3.3.0.4852\utilities-3.3.0.4852.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\rpc
> \3.3.0.4852\rpc-3.3.0.4852-en_US.rb.swc C:\Documents and Settings
> \sg0212057\.m2\repository\com\adobe\flex\framework\framework
> \3.3.0.4852\framework-3.3.0.4852-en_US.rb.swc
> -compiler.locale en_US
> -compiler.namespaces.namespace http://www.adobe.com/2006/mxml C:\Temp
> \FlexTest\MySample\target\classes\config-3.3.0.4852\mxml-manifest.xml
> -compiler.optimize=true
> -compiler.source-path C:\Temp\FlexTest\MySample\src\main\locales\en_US
> -compiler.strict=true
> -compiler.use-resource-bundle-metadata=true
> -compiler.verbose-stacktraces=false
> -default-background-color 8821927
> -default-frame-rate 24
> -default-script-limits 1000 60
> -default-size 500 375
> -include-resource-bundles containers core effects skins styles
> -licenses.license flashbuilder4 952307006650319154206597
> -metadata.date Thu Jul 28 13:34:25 CEST 2011
> -metadata.localized-title MySample Flex x-default
> -target-player 9.0.0
> -use-network=true
> -verify-digests=true -static-link-runtime-shared-libraries=false -load-
> config=
> -metadata.language+=en_US
> [WARNING] Artifact com.my.samples:MySample:swf:en_US:1.0-SNAPSHOT
> already attached to project, ignoring duplicate
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 6.531s
> [INFO] Finished at: Thu Jul 28 13:34:29 CEST 2011
> [INFO] Final Memory: 14M/214M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
>
> <-------------------------------pom.xml-------------------------------
>>
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
>
> Copyright 2008 Marvin Herman Froeder
> Licensed under the Apache License, Version 2.0 (the "License");
> you may not use this file except in compliance with the License.
> You may obtain a copy of the License at
>
> http://www.apache.org/licenses/LICENSE-2.0
>
> Unless required by applicable law or agreed to in writing,
> software
> distributed under the License is distributed on an "AS IS" BASIS,
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> See the License for the specific language governing permissions
> and
> limitations under the License.
>
> -->
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://
> www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://
> maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>com.my.samples</groupId>
> <artifactId>MySample</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>swf</packaging>
>
> <name>MySample Flex</name>
>
> <build>
> <sourceDirectory>src/main/flex</sourceDirectory>
> <testSourceDirectory>src/test/flex</testSourceDirectory>
> <plugins>
> <plugin>
> <groupId>org.sonatype.flexmojos</groupId>
> <artifactId>flexmojos-maven-plugin</artifactId>
> <version>3.5.0</version>
> <extensions>true</extensions>
> <configuration>
>
> <resourceBundlePath>${basedir}/src/main/locales/{locale}</
> resourceBundlePath>
> <runtimeLocales>
> <locale>en_US</locale>
> </runtimeLocales>
> </configuration>
>
> <dependencies>
> <dependency>
> <groupId>com.adobe.flex</groupId>
> <artifactId>compiler</artifactId>
> <version>3.3.0.4852</version>
> <type>pom</type>
> </dependency>
> </dependencies>
>
> </plugin>
> </plugins>
> </build>
>
> <dependencies>
> <dependency>
> <groupId>com.adobe.flex.framework</groupId>
> <artifactId>flex-framework</artifactId>
> <version>3.3.0.4852</version>
> <type>pom</type>
> </dependency>
>
> <dependency>
> <groupId>com.adobe.flexunit</groupId>
> <artifactId>flexunit</artifactId>
> <version>0.90</version>
> <type>swc</type>
> <scope>test</scope>
> </dependency>
>
> </dependencies>
>
>
> </project>
>
>
> On Jul 28, 1:19 pm, Christofer Dutz <[email protected]>
> wrote:
>> Well if you user "includeResourceBundles" you tell the compiler to
>> INCLUDE them ... that's why he is packing them in the main swf.
>> I think you should use runtimeLocales and set the resourceBundlePath.
>> Then your application should load the resource bundles from the given
>> path.
>> The copy-resources plugin should take care of copying the resource
>> files to the right place, but I would double check this, if I were
>> you.
>>
>> And by the way ... the tutorial tells you how to use resource bundles
>> ... not how to make them.
>>
>> Chris
>>
>> 2011/7/28 pawel <[email protected]>:
>>
>>
>>
>>
>>
>>
>>
>> > Ok, to make things more clear, lets take this page
>> >https://docs.sonatype.org/display/FLEXMOJOS/Application+Localization.
>> > It explains how to make resource bundle, it explains how to set
>> > resource bundle path. The basic question is, how can I make flexmojos
>> > to actually take something from that folder and pack it into resource
>> > bundle? Because if I use includeResourceBundle, than it tries to pack
>> > it into main swf, not the resource bundle.
>>
>> > Thanks,
>> > Pawel
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Flex Mojos" group.
>> > To post to this group, send email to [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> >http://groups.google.com/group/flex-mojos
>>
>> >http://flexmojos.sonatype.org/
>
> --
> You received this message because you are subscribed to the Google
> Groups "Flex Mojos" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/flex-mojos
>
> http://flexmojos.sonatype.org/
>
--
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos
http://flexmojos.sonatype.org/