When debug the code,

I see that the local is not initialized.

For tha AS source, the "getString" method is called with only two parameters :

resourceManager.getString('messages', 'userName')

and the js file function is called with null locale, but I think it should be called with some default locale info:

mx.resources.ResourceManagerImpl.prototype.getString = function(bundleName, resourceName, parameters, *locale*) {
  parameters = typeof parameters !== 'undefined' ? parameters : null;
  locale = typeof locale !== 'undefined' ? locale : null;
  var /** @type {mx.resources.IResourceBundle} */ resourceBundle = this.mx_resources_ResourceManagerImpl_findBundle(bundleName, resourceName, locale);
  if (!resourceBundle)
    return null;
  if (!(resourceName in resourceBundle.content))
    return null;
  var /** @type {string} */ value = String(resourceBundle.content[resourceName]);
  if (parameters)
    value = mx.utils.StringUtil.substitute(value, parameters);
  return value;
};


I guess the default locale is not set during function call and/or the locale string resources - messages.properties - are not included in the build process so does not exist in hjs output folder.

May you provide me example if any for reference of localization, in case I may be using in wrong way ?

Thanks,
Serkan

18.12.2018 01:28 tarihinde Alex Harui yazdı:

Hi Serkan

I’m not surprised that the Royale SWF does not run.  I haven’t spent any time ensuring that it does.  The JS version compiled with 0 errors.  What happens when you run the JS version?

-Alex

*From: *Serkan Taş <[email protected]>
*Reply-To: *"[email protected]" <[email protected]>
*Date: *Monday, December 17, 2018 at 12:44 PM
*To: *"[email protected]" <[email protected]>
*Subject: *Re: Work on Emulation

Hi Alex,

I created the application and compiled with FB :

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C915c54534ba347f301b908d6646068fd%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806762605362417&sdata=igDz6UkIjjBOLySbO9OzQMvFPKKbTzYEvctrVMplDdo%3D&reserved=0>
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

    <fx:Metadata>
        [ResourceBundle("messages")]
    </fx:Metadata>

    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>

    <s:layout>
        <s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" paddingTop="10" paddingBottom="20" />
    </s:layout>

    <s:Button id="button" width="100" label="{resourceManager.getString('messages', 'userName')}" />
    <s:Button id="button2" width="100" label="Password :" />

</s:Application>



It is working and requires the libraries :
framework_4.6.0.23201.swf
spark_4.6.0.23201.swf
textLayout_2.0.0.232.swf

cid:[email protected]


This file is for royale :

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C915c54534ba347f301b908d6646068fd%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636806762605372422&sdata=q4C7bq8x4qOObmQPFZulnAMJQiC8%2BFqts6Kw0gy8Nms%3D&reserved=0>
         xmlns:s="library://ns.apache.org/royale/spark"
         xmlns:mx="library://ns.apache.org/royale/mx"
         xmlns:comps="com.likya.pinara.comps.*"
         width="100%">

    <fx:Metadata>
        [ResourceBundle("messages")]
    </fx:Metadata>

    <fx:Script>
        <![CDATA[
        ]]>
    </fx:Script>

    <fx:Declarations>

    </fx:Declarations>

    <s:layout>
        <s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" paddingTop="10" paddingBottom="20" />
    </s:layout>

    <s:Button id="button" width="100" label="{resourceManager.getString('messages', 'userName')}" />
    <s:Button id="button2" width="100" label="Password :" />

</s:Application>

When compile with royale it gets the message with flash player :

cid:[email protected]

And the build output :

end of list of source files
Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager println WARNING: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/mx/controls/listClasses/VirtualDataItemRendererFactoryForICollectionViewData.js:144: WARNING - Variable referenced before declaration: dataGroup   ir = org.apache.royale.utils.Language.as(this.itemRendererFactory.createItemRenderer(dataGroup), org.apache.royale.core.ISelectableItemRenderer);
^^^^^^^^^

Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager println WARNING: WARNING - Failed to resolve sourcemap: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/mx/controls/listClasses/VirtualDataItemRendererFactoryForICollectionViewData.js.map

Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager println WARNING: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/mx/managers/SystemManager.js:196: WARNING - unreachable code
  return null;
  ^^^^^^^^^^^^

Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager println WARNING: WARNING - Failed to resolve sourcemap: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/mx/managers/SystemManager.js.map

Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager println WARNING: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/spark/components/Group.js:100: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?   if (this.spark_components_Group__mxmlContent != null && this.spark_components_Group__mxmlContent != value) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager println WARNING: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/spark/layouts/VerticalLayout.js:1050: WARNING - Redeclared variable: targetHeight   var /** @type {number} */ targetHeight = Math.max(0, layoutTarget.height - this.paddingTop - this.paddingBottom);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager println WARNING: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/spark/layouts/supportClasses/LayoutElementHelper.js:77: WARNING - Parse error. illegal use of unknown JSDoc tag "arg"; ignoring it
 *  @arg result :  optional Array to save an Array memory allocation
    ^

Dec 17, 2018 11:41:40 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 7 warning(s), 97.8% typed
The project 'FindBug' has been successfully compiled and optimized.
67.000541118 seconds

What else should I check ?

Thanks,
Serkan

17.12.2018 09:51 tarihinde [email protected] <mailto:[email protected]> yazdı:

    Alex,

    I do not want you to do anything if you do not want !

    I am just trying to make it clear for me what you mean. Thats all.

    Thanks,
    Serkan


    Alinti Alex Harui <[email protected]> <mailto:[email protected]>


        Serkan,

         You posted an example about Resources claiming it didn't work
        in Royale.  I don't think that example would work in Flex. 
        I'm not going to investigate why your example doesn't work in
        Royale until your prove that it did work in Flex.

        Thanks,
        -Alex




Reply via email to