</target>
<!-- delete and create the DEPLOY dir again -->
- <target name="init" depends="git-buildnumber,svn-buildnumber">
+ <target name="init" depends="git-buildnumber,svn-buildnumber,deployLocales">
<echo>Build Number ${build_number}</echo>
<copy file="version.as.template" tofile="version.as" overwrite="true" />
<replace file="version.as" token="@@@buildnumber@@@" value="${build_number}" />
<target name="test" depends="init, compileTestRunner, runTestsAndReport" description="Compiles unit tests and generates test report artifacts." />
+ <!-- ======================================= -->
+ <!-- Locale Targets -->
+ <!-- ======================================= -->
+
+ <!-- Deploy compiled Localization Resource Bundles and resources. -->
+ <macrodef name="deployLocale" description="Deploying the compiled swfs">
+ <attribute name="locale" default="en_GB"/>
+ <sequential>
+ <echo>Copying @{locale}.swf to deploy directory...</echo>
+
+ <mkdir dir="${basedir}/resources/locales"/>
+ <copy file="${basedir}/l10n/locale/bundles/@{locale}.swf" tofile="${basedir}/resources/locales/@{locale}.swf" />
+
+ </sequential>
+ </macrodef>
+
+ <!-- Compiles Localization Resource Bundle. -->
+ <macrodef name="compileLocale" description="Compiles the Resource package for the given locale">
+ <attribute name="locale" default="en_GB"/>
+ <sequential>
+
+ <!--
+ Invoke MXMLC
+ - also include the MX Framework locale assets
+ Note: this requires user to invoke copyLocale.exe prior to running this script
+ -->
+ <mxmlc output="${basedir}/l10n/locale/bundles/@{locale}.swf">
+<!-- <locale>@{locale}</locale> -->
+
+
+ <source-path path-element="${basedir}/l10n/locale/@{locale}"/>
+ <include-resource-bundles>help_dialog</include-resource-bundles>
+
+<!-- <source-path path-element="${src.dir}/locale/framework/bundles/{locale}/src"/>
+ <include-resource-bundles>collections</include-resource-bundles>
+ <include-resource-bundles>containers</include-resource-bundles>
+ <include-resource-bundles>controls</include-resource-bundles>
+ <include-resource-bundles>core</include-resource-bundles>
+ <include-resource-bundles>effects</include-resource-bundles>
+ <include-resource-bundles>formatters</include-resource-bundles>
+ <include-resource-bundles>logging</include-resource-bundles>
+ <include-resource-bundles>SharedResources</include-resource-bundles>
+ <include-resource-bundles>skins</include-resource-bundles>
+ <include-resource-bundles>states</include-resource-bundles>
+ <include-resource-bundles>styles</include-resource-bundles>
+ <include-resource-bundles>utils</include-resource-bundles>
+ <include-resource-bundles>validators</include-resource-bundles>-->
+ </mxmlc>
+
+ </sequential>
+ </macrodef>
+
+ <target name="buildLocales">
+ <echo>Building Localization .swf's</echo>
+ <compileLocale locale="en_GB" />
+ <compileLocale locale="fr_FR" />
+ </target>
+
+
+ <target name="deployLocales" depends="buildLocales">
+ <echo>Deploying the compiled swf and assets package for the given locales</echo>
+ <deployLocale locale="en_GB" />
+ <deployLocale locale="fr_FR" />
+ </target>
+
</project>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LocaleMap enableLog="true"
+ xmlns:mx="http://www.adobe.com/2006/mxml"
+ xmlns:factory="mx.core.*"
+ xmlns="library://ns.babelfx.org/l10n/flex/" >
+
+ <!-- Support for Locale ResourceBundle changes -->
+ <mx:Script>
+ <![CDATA[
+ import com.mindspace.l10n.commands.ExternalLocaleCommand;
+
+ import net.systemeD.potlatch2.help.HelpDialog;
+ ]]>
+ </mx:Script>
+
+ <commandFactory>
+ <factory:ClassFactory generator="{ExternalLocaleCommand}">
+ <factory:properties>
+ <mx:Object externalPath="locales/\{0\}.swf"/>
+ </factory:properties>
+ </factory:ClassFactory>
+ </commandFactory>
+
+ <!--
+ SmartResourceInjectors for targeted class instantiations. Instead of dependency injection of UI instances,
+ we use SRI(s) here to remove any need to know view hierarchy relationships... we simply want a reference
+ to the UI instance when ready.
+ -->
+
+ <SmartResourceInjector bundleName="help_dialog" target="{HelpDialog}">
+ <ResourceProxy property="gettingStarted.text" key="help.gettingStarted" />
+ <ResourceProxy property="welcome.label" key="help.welcome" />
+ </SmartResourceInjector>
+
+</LocaleMap>
\ No newline at end of file
]]>
</mx:Script>
<mx:TabNavigator id="helpTN" width="100%" height="100%" styleName="helpTN" creationPolicy="all">
- <mx:VBox label="Welcome" width="100%" height="100%">
+ <mx:VBox label="Welcome" id="welcome" width="100%" height="100%">
<mx:Grid width="100%"><!-- prepare for a column of icons, at some point -->
<mx:GridRow width="100%">
<mx:GridItem width="100%">
</mx:GridRow>
<mx:GridRow width="100%">
<mx:GridItem width="100%">
- <mx:Label text="Getting Started" textAlign="center" width="100%" styleName="helpPageHeader" />
+ <mx:Label id="gettingStarted" text="Getting Started" textAlign="center" width="100%" styleName="helpPageHeader" />
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%">
<mx:Button label="Save" icon="@Embed('embedded/upload.svg')" disabledIcon="@Embed('embedded/upload_disabled.svg')" styleName="appBarButton"
click="SaveManager.saveChanges();" id="saveButton" enabled="false"/>
</mx:ApplicationControlBar>
+
+ <map:LocalizationMap xmlns:map="l10n.map.*" />
<mx:HDividedBox width="100%" height="100%">
import mx.managers.DragManager;
import mx.core.DragSource;
import mx.controls.Alert;
+ import com.mindspace.l10n.events.LocaleEvent;
public var theMap:Map;
public var theController:EditController;
private function initApp():void {
+ /* For reasons that I don't yet understand, the en_US locale is the default and doesn't work at all. Use en_GB instead. */
+ /* Change this to another locale (e.g. fr_FR) to see the differences. This will obviously become done differently at some point. */
+ dispatchEvent(new LocaleEvent(LocaleEvent.LOAD_LOCALE,'en_GB'));
+
Globals.vars.map_area = map_area;
Globals.vars.root = map_area.rawChildren; // set up global reference to root level
var _root:IChildList = map_area.rawChildren; // convenient local shorthand