[enyo-ilib] How to use separated strings.json files into a same Enyo project

edited December 2013 in General
Hi folks,

I would like to know if it is possible (and if yes, how to do that) to use different strings.json files placed in different locations into a same enyo project.
My goal is to use separated strings.json files for a specific code coverage instead of a huge one for the whole project.
Acting like this could ease the collaborative developement and enlight the string translations management. Handling a part of the project code as an autonomous block enforces its convenience.

I.e.:
MyProject/
    MyApp/
        package.js (depends: "$lib/enyo-ilib", "sources/", "MyBrick#1", "MyBrick#2"...)
        resources/
             string.json
             cn/
                 string.json
             fr/
                 strings.json
        sources/
             myApp.js
    MyBrick#1/
        package.js (depends: "sources/"...)
        resources/
             string.json
             cn/
                 string.json
             fr/
                 strings.json
        sources/
             myBrick#1.js
    MyBrick#2/
        ....
Currently I've found that only the MyApp resources are handeled with.
How to say the app/project that MyBrick#1 resources must be involved too?

Thanks for your support

--Vincent

Comments

  • edited December 2013
    my bad... Here's a better example of the project structure:
    MyProject/
    -MyApp/
    --package.js (depends: "$lib/enyo-ilib", "sources/", "MyBrick#1", "MyBrick#2"...)
    --resources/
    ---string.json
    ---cn/
    ----string.json
    ---fr/
    ----strings.json
    --sources/
    ----myApp.js
    -MyBrick#1/
    --package.js (depends: "sources/"...)
    --resources/
    ---string.json
    ---cn/
    ----string.json
    ---fr/
    ----strings.json
    --sources/
    ----myBrick#1.js
    -MyBrick#2/
    ...
  • Is this using the older G11N library or the new enyo-ilib library?
  • edited December 2013
    It is using the brand new enyo-ilib library
  • If you look at the glue.js file, you'll see that $L() is implemented by just a small amount of code that loads a specific string bundle. Look at the $L.setLocale call defined there. It would be pretty simple to directly use ilib's resource bundle loader to load an alternate filename other than strings.json for a specific domain of the program and use that directly, maybe wrapping it in a $L2 object.
  • Ok thanks, I'll do a try on this way
Sign In or Register to comment.