I have a small requirement to internationalize strings. Honestly the topic itself is so wide. but I only wish to use its ResourceBundle
functionality where I only wish to include strings.json
files for each language and use $L("some key")
in my enyo
app. Is it possible with minimum number of individual dependent javascript files ?
This is what I am talking about. Thanks in advance for your efforts.
The enyo-ilib package has 3 "sizes" of ilib in it. By default, you get the "standard" size which has a reasonable set of things that people might need in it like date formatting, number formatting, etc. What you want is the "core" size which includes only the resource bundle class and the string formatter plus all the classes they depend on like the locale class. In order to use the core size of ilib in your enyo app, you would do the following in your package.js file:
Then, set up a resources directory right beside where your index.html is:
Then you should be able to use $L without the memory footprint of the standard size of ilib.