royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <>
Subject Re: Struggling with resource files
Date Mon, 02 Oct 2017 07:24:37 GMT
Thanks for the links.

Some thoughts/questions:

The loading of the resource modules is something handled by the Flash runtime, or is that
internal to Flex?

Currently, do the compiler options do anything for the JS side of things?

If I understand correctly, the “inlining” option adds the resources to the ResourceManager.
I’m suggesting the ResourceManager is not necessarily needed if locales are configured at
compile time. A more PAYG way would be to inline the resource directly into a variable of
a bead which knows what to do with the resource. I don’t see any current annotation which
could do that (either in MXML or AS).

I don’t see how class references (and image references) could work in Royale (in JS). If
we could get that working, it would be huge.


> On Oct 2, 2017, at 9:57 AM, Alex Harui <> wrote:
> See the Adobe docs: [1][2]
> I think the functionality you are looking forward is supported by the
> compiler.  The compiler already has a set of options that dictate what
> bundles are "inline" in the app and I think they can be re-used to output
> different things.
> [ResourceBundle] metadata tells the compiler which bundles to link.  The
> compiler's -locale option dictates which language bundles for the
> [ResourceBundles] it saw when linking the app need to be baked into the
> app.  Separately, the ResourceManager in regular Flex has a way to load a
> SWF of other bundles.  The compiler has options to build a SWF with
> certain bundles.
> For JS, JSON might be a good format for a "ResourceModule".
> I've seen the packages be accepted by Flash Builder on both Mac and
> Windows.  There's a separate thread about when to merge packaging into
> develop, and how to do the "big rename".
> Later,
> -Alex
> [1] 
> -7f3a.html
> [2] 
> -7f3c.html
> On 10/1/17, 11:34 PM, "Harbs" <> wrote:
>> I should probably spend some time to learn how resource bundles worked in
>> Flex… ;-)
>> Metadata seems like a good solution, but it seems to me like there needs
>> to be two sets of metadata tags. Some comments and questions I have:
>> 1. We’d need metadata tags which would just inline the resource into the
>> compiled code for cases where a full-blown ResourceManager is overkill.
>> 2. We’d need the [ResourceBundle] tag for compiling downloadable resource
>> bundles. What would that look like in Javascript? A JS file which
>> evaluates to the resources? A JSON file? Would default resources get
>> auto-included in the main JS?
>> BTW, if there’s something I can do to help you with the packaging branch,
>> please let me know.
>> Harbs
>>> On Oct 2, 2017, at 2:28 AM, Alex Harui <> wrote:
>>> 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