digitalascetic / iron-router-i18n

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

"already the current language" warnings since v1.2.2 #75

Open laurentpayot opened 9 years ago

laurentpayot commented 9 years ago

Since version 1.2.2 (#74 fix) I get "Warning: asked to change language to [en] but this is already the current language." console warnings every time I'm moving from one page to another within the English version of my app.

My configuration is (in CoffeeScript, hope you don't mind):

I18NConf.configure(
    autoConfLanguage: true
    defaultLanguage: 'en'
    languages: ['en', 'fr']
)

I18NConf.onLanguageChange((oldLang, newLang) ->
    if newLang isnt oldLang
        TAPi18n.setLanguage(newLang)
        T9n.setLanguage(newLang)
)
erdgrau commented 8 years ago

I have the same problem.

Kostanos commented 8 years ago

+1

Xiangshen-Meng commented 8 years ago

+1

gregorvand commented 8 years ago

+1

sunstorymvp commented 8 years ago

any news here?

ipa1981 commented 8 years ago

+1

martinopic commented 8 years ago

Sorry for reacting so late, version 1.2.3 should solve the problem (it use new 0.3.4 i18n-conf version). Please let me know.

gregorvand commented 8 years ago

Fixes for me, thanks!

laurentpayot commented 8 years ago

Still having the message when loading/reloading the page (F5) but not between pages anymore so it's good enough for me. Thanks ! :+1:

martinopic commented 8 years ago

@laurentpayot you shouldn't have these messages at all, are you sure? maybe if you paste part of your configuration... (or maybe if you can replicate the wrong behaviour by using one of the examples or making an simple example)

cedrisk commented 8 years ago

@laurentpayot maybe it's because you configure lang selection in a client "Meteor.startup" function

martinopic commented 8 years ago

@laurentpayot if this is the case you should just disable language autoconf and have your language configuration. Just remember that in any case you can always get the current language with I18NConf.getLanguage() and know if it's the default language or if it was explicitly set with I18NConf.isLanguageSet()