digitalascetic / iron-router-i18n

Meteor iron router support for i18n
MIT License
36 stars 5 forks source link

My Site crashes (Google Chrome says: "Aw, Snap!") with I18NConf #48

Closed Obiwarn closed 9 years ago

Obiwarn commented 9 years ago

Whenever I remove the languages from Router config and place them in my I18NConf. My Site crashes. No errors are displayed.

My config:

Router.configure i18n: serverSide: true defaultLanguage: 'de' languages: ['en', 'de', 'fr'] setLanguage: (lang) -> Language.setLanguage(lang) exclude: admin_paths: '^\/admin', server: exclude: sitemap: '^\/sitemap.xml'

martinopic commented 9 years ago

What is "Language.setLanguage(lang)" actually doing? Can you try to remove the setLanguage configuration and to put it in a

I18NConf.onLanguageChange(function(oldLang, newLang) {
  Language.setLanguage(newLang);
});

The reported error seems to come from a infinite loop as if the two setLanguage methods are calling each other repeatedly (there is a mechanism preventing this in Iron Router i18n setLanguage method).

martinopic commented 9 years ago

Also, this could be related to #50 fixed in 0.5.6 version just released today.

martinopic commented 9 years ago

Haven't received any further feedback on this for two weeks, closing.