royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Idylog - Nicolas Granon" <>
Subject RE: Struggling with resource files
Date Mon, 02 Oct 2017 06:35:38 GMT
>From our point of view (app development), the Flex way Alex describes is simple and easy
to grab.

The only "complaint" is that you cannot alias the resource file to a var/const inside the
metatag which would be more convenient than declaring a separate constant.
I believe that most people using resource bundles use an "alias" const like this :

[ResourceBundle ("mybundlefilename")]

private const THE_BUNDLE:String="mybundlefilename");


This avoids misspelling the bundle name at each call to resourceManager.getXXX(bundle_name,

The cleanest way would be to be able to use a const inside the metatag like :

[ResourceBundle (THE_BUNDLE)]
Private const THE_BUNDLE:String="mybundlefilename";

...but I know that usually, you cannot use a declared const inside a metatag...

Maybe it is possible to "autodeclare" a const alias inside the metatag itself like :


Where MY_ALIAS would be automatically declared as a String const ? (possibly conflicting with
another declaration...)

But this is a minor inconvenience.

Nicolas Granon

> -----Message d'origine-----
> De : Alex Harui []
> Envoyé : lundi 2 octobre 2017 01:28
> À :
> Objet : Re: Struggling with resource files
> On 10/1/17, 7:31 AM, "Harbs" <> wrote:
> >I’d really like for the compiler to include resources as strings, but
> >I’m not sure what the best way to declare it is.
> >
> >How can we declare a reference to the resource and have the compiler
> >include it?
> Well, that depends...
> The [ResourceBundle] metadata and the compiler's -locale option seemed
> to make people happy.  I don't remember any complaints about it, my
> only issue was that it didn't seem to be efficient for String-only
> resources.
> [ResourceBundle] allows the strings to be managed in separate
> .properties files that are packaged with a SWC.  That's probably
> important because you probably don't want to have to list out every
> component's resources as beads in your app.  It probably needs to be
> driven automatically by metadata.
> So, if we decide to stick with it, the challenge will be to teach the
> compiler to do something different with the resource properties.
> Thoughts?
> -Alex
> >

View raw message