最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do I disable i18next console warnings? - Stack Overflow

programmeradmin2浏览0评论

I am using i18next with react app, however:

Logs like this on every re-render are really slowing down my application:

i18next::languageUtils: rejecting non-whitelisted language code: en

How do I disable them?

I have debug set to false.

I am using i18next with react app, however:

Logs like this on every re-render are really slowing down my application:

i18next::languageUtils: rejecting non-whitelisted language code: en

How do I disable them?

I have debug set to false.

Share Improve this question edited Feb 13, 2017 at 19:26 Ľubomír asked Feb 13, 2017 at 18:49 ĽubomírĽubomír 1,1612 gold badges12 silver badges22 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 17

Just change debug flag which goes in init function to false

i18n.init({
    resources,
    debug: false, // It should be false
    lng: 'en',
    fallbackLng: 'en',
  });

Maybe you can fix these errors one by one, for example, i18next has an option for non-whitelisted language codes: https://github.com/i18next/i18next/blob/6aa81cd22f5e7fe0989d6920471e8e32d173af8c/src/defaults.js#L12

There are other options too, can be helpful if you get other types of errors.

发布评论

评论列表(0)

  1. 暂无评论