ebidel / i18n-msg

Polymer element for i18n string replacement
https://ebidel.github.io/i18n-msg/
63 stars 21 forks source link

Set messagesUrl before Language on ready #18

Closed matthewlawson closed 9 years ago

matthewlawson commented 9 years ago

Using this strategy to setup localisation the url will not be set correctly in the first _fetchLanguage call.

<script>
document.addEventListener('HTMLImportsLoaded', function() {
    I18nMsg.url = "/locales";
    I18nMsg.lang = 'es';
});
</script>

This pull request sets language after the messagesUrl so that when the languages observer is triggered the messageUrl will be correct and load the correct translation file.

ebidel commented 9 years ago

LGTM. Thanks.