You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/12/19 22:46:30 UTC

[royale-asjs] branch develop updated: update test to include source bundles

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new d300897  update test to include source bundles
d300897 is described below

commit d300897b83268c27fa7ebfe3af30a2e675942197
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Dec 19 14:46:10 2018 -0800

    update test to include source bundles
---
 manualtests/ResourceManagerTest/build.xml          |  3 +++
 .../locale/en_US/messages.properties               | 24 ++++++++++++++++++++++
 .../locale/tr_TR/messages.properties               | 24 ++++++++++++++++++++++
 .../src/ResourceManagerTest.mxml                   | 18 ++++++++++++++--
 4 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/manualtests/ResourceManagerTest/build.xml b/manualtests/ResourceManagerTest/build.xml
index 7f57311..4d29627 100644
--- a/manualtests/ResourceManagerTest/build.xml
+++ b/manualtests/ResourceManagerTest/build.xml
@@ -28,6 +28,9 @@
 	<property file="${ROYALE_HOME}/build.properties"/>
     <property name="FLEX_HOME" value="${ROYALE_HOME}"/>
 	
+    <property name="config_arg" value="flex" />
+    <property name="optional_arg" value="-source-path+=${basedir}/locale/tr_TR" />
+    <property name="theme_arg" value="-locale=tr_TR" />
     
     <include file="${basedir}/../build_example.xml" />
 
diff --git a/manualtests/ResourceManagerTest/locale/en_US/messages.properties b/manualtests/ResourceManagerTest/locale/en_US/messages.properties
new file mode 100644
index 0000000..6260d68
--- /dev/null
+++ b/manualtests/ResourceManagerTest/locale/en_US/messages.properties
@@ -0,0 +1,24 @@
+################################################################################
+##
+##  Licensed to the Apache Software Foundation (ASF) under one or more
+##  contributor license agreements.  See the NOTICE file distributed with
+##  this work for additional information regarding copyright ownership.
+##  The ASF licenses this file to You 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.
+##
+################################################################################
+# Symbols
+
+##login
+loginTitle = Login
+userName = User Name
+password = Password
diff --git a/manualtests/ResourceManagerTest/locale/tr_TR/messages.properties b/manualtests/ResourceManagerTest/locale/tr_TR/messages.properties
new file mode 100644
index 0000000..975ee13
--- /dev/null
+++ b/manualtests/ResourceManagerTest/locale/tr_TR/messages.properties
@@ -0,0 +1,24 @@
+################################################################################
+##
+##  Licensed to the Apache Software Foundation (ASF) under one or more
+##  contributor license agreements.  See the NOTICE file distributed with
+##  this work for additional information regarding copyright ownership.
+##  The ASF licenses this file to You 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.
+##
+################################################################################
+# Symbols
+
+##login
+loginTitle = Giriş
+userName = Kullanıcı Adı
+password = Şifre
\ No newline at end of file
diff --git a/manualtests/ResourceManagerTest/src/ResourceManagerTest.mxml b/manualtests/ResourceManagerTest/src/ResourceManagerTest.mxml
index 65e964b..d3c2f46 100644
--- a/manualtests/ResourceManagerTest/src/ResourceManagerTest.mxml
+++ b/manualtests/ResourceManagerTest/src/ResourceManagerTest.mxml
@@ -21,7 +21,17 @@ limitations under the License.
                xmlns:js="library://ns.apache.org/royale/basic"
                xmlns:mx="library://ns.apache.org/royale/mx"
                xmlns:local="*">
-
+    <fx:Metadata>
+        [ResourceBundle("messages")]
+    </fx:Metadata>
+    
+    <!-- Core requires Flex resources on library-path
+    <fx:Metadata>
+        [ResourceBundle("messages")]
+        [ResourceBundle("core")]
+    </fx:Metadata>
+    -->
+    
     <fx:Script>
 		<![CDATA[
             import mx.collections.ArrayList;
@@ -43,7 +53,11 @@ limitations under the License.
 
     <mx:Label text="ResourceManager Test"/>
 
-    <mx:Button label="Test" click="test()"/>
+    <mx:Button label="{resourceManager.getString('messages', 'userName')}" click="test()"/>
+    
+    <!-- this one requires Flex resources on library-path
+    <mx:Button label="{resourceManager.getString('core', 'userName')}" click="test()"/>
+    -->
     
     <mx:Label id="output" text="output goes here"/>
 </mx:Application>