fabi1cazenave / webL10n

Client-side internationalization / localization library
http://fabi1cazenave.github.com/webL10n/
279 stars 71 forks source link

Callback parameter for setLanguage() #56

Closed paulguz closed 9 years ago

paulguz commented 9 years ago

I'm using setLanguage() in my unit tests to ensure my localisation is functioning.

Now that resources are loaded asynchronously, you must wait for setLanguage() to complete before continuing.

I've made it work using the 'localized' event, but I don't find that intuitive - I would expect 'localized' to fire after translation, not just loading a language.

If there were a callback parameter to setLanguage, it wouldn't be so ambiguous.

Paul

Rob--W commented 9 years ago

Could you try out #57 and see if it resolves your issue?

paulguz commented 9 years ago

Yeah, that seems to work. Many thanks.