More info:

This is my Interface:
package pt.solidsoft.gc.language
{
    [Bindable]
    public interface ILanguage
    {
        function get LoginCompany():String
        function get LoginEMail():String
        function get LoginPassword():String
    }
}

This is my LocaleManager:
package pt.solidsoft.gc.language
{
    public class LocaleManager
    {
        public static const LANGUAGE_PORTUGUESE:String =
"LanguagePortuguese";
        public static const LANGUAGE_SPANISH:String = "LanguageSpanish";
        public static const LANGUAGE_ENGLISH:String = "LanguageEnglish";

        private static var languagePortuguese:ILanguage = new Portuguese();
        private static var languageSpanish:ILanguage = new Spanish();
        private static var languageEnglish:ILanguage = new English();

        private static var selectedLanguage:String = LANGUAGE_PORTUGUESE;

        public static function setLanguage(language:String):void
        {
            selectedLanguage = language;
        }

        [Bindable]
        public static function get localeStrings():ILanguage
        {
            switch (selectedLanguage)
            {
                case LANGUAGE_PORTUGUESE:
                    return languagePortuguese;
                    break;
                case LANGUAGE_SPANISH:
                    return languageSpanish;
                    break;
                default:
                    return languageEnglish;
                    break;
            }
        }
    }
}

And finally the use of the localization:
...
                <c:FormItem
label="{LocaleManager.localeStrings.LoginCompany}"
                            stackedLayout="true">
                    <c:TextInput width="250"/>
                </c:FormItem>
...

I get a compile warning (DataBinding) on LoginCompany however the
DataBinding works.

If I change
from: function get LoginCompany():String 
to:   function LoginCompany():String
and the caller
from: {LocaleManager.localeStrings.LoginCompany()}
to:   {LocaleManager.localeStrings.LoginCompany}
It works the same but the compile warning is gone.

I would prefer the getter method but without the warning.



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Reply via email to