-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getL10nData not working in Chrome #64
Comments
Yes, I see this too, intermittently. I think this is a knock-on from the fix for #48 and #52 made back in February which made loading of the properties files asynchronous at all times. A workaround for now would be to set gAsyncResourceLoading to false to load the files synchronously. You'll get a "Synchronous XMLHttpRequest" warning in Chrome, but it's only a temporary measure until there's a fix for this. |
Thanks :) my team member told me this workaround works for now. |
SIlly me. On second thoughts, this isn't a bug. Please see the comment above
So, start your application inside of an event handler for 'localized'. In my case, I have a Backbone application using require.js, so I start my application like so:
|
Use document.webL10n.ready(function() {
require(['app'], function (app) { Backbone.history.start(); });
}); |
Thanks Rob. That means this also works (which I prefer, as require is pretty fundamental to the operation of the application!)
|
Hmm, I thought webL10n.ready() was working, but it seems not - I'm still seeing the "undefined" warnings from time to time. I've reverted to using the localized event. |
@paulguz I've submitted a patch for your issue, could you check whether it solves your problem, and report back? |
@Rob--W Yes, that does seem to have made a difference. However, it only works if I put my require statement inside the ready() call; if I put the ready call inside the require(), I still see the warnings. So, this works:
But this doesn't:
Thanks. |
Hello again, after a whole year. I've been sidetracked in that time, but found myself looking at this again recently after upgrading dependencies in my project. It appears that the last commit by @Rob--W has reintroduced the console warnings. For the record, I'm not using Unfortunately I'm too busy right now to put together a sample project. |
Hi, as part of porting Loqui (which uses this library) we are seeing a lot of undefined warning logs according to the following code:
It looks like load and parse l10n data is happening AFTER the warning is printed (set breakpoints, above code executes first before the loading is complete). The code in index.html is:
However others are working:
Thanks for your help.
The text was updated successfully, but these errors were encountered: