Initialization Explanation
FFXV opened this issue · 6 comments
Hi!
I have successfully created the messages.js file.
Now I want to use it. However, "Lang" is not recognized.
E.g., if I take from the documentation the following (not even using messages.js):
var lang = new Lang({
messages: {
'en.greetings': {
'hi': 'Hi'
},
}
});
lang.get('greetings.hi');
// > "Hi"
.. I cannot get any output. Actually the script stops there. I guess, I have make an import or something similar.
Thanks for any help!
var lang = new Lang({
messages: '/public/messages.js',
locale: 'en',
});
This is in my java script. Now, the browser console says "ReferenceError: Lang is not defined".
The same with the code I posted some weeks ago. Sorry, I moved.
I had this problem when I passed the generated js through webpack. I changed it to bypass webpack and just output the js file to the public/ directory. I don't know what about webpack makes it break the file, but it apparently does.
Interesting @ameenross, we will need to see what webpack does with these files.