Closed mckabi closed 1 year ago
I had the same problem with is
, I used a noop for console.warn on prod to remove this.
if (process.env.NODE_ENV === 'production') {
console.warn = () => {}
}
As far as the mn
locale is not supported by Intl.Collator.supportedLocalesOf
you could avoid console warnings for production like this:
import type { Config } from 'sveltekit-i18n';
const config: Config = {
// ...
log: {
level: process.env.NODE_ENV === 'production' ? 'error' : 'warn',
}
};
Hello, thank you @jarda-svoboda for this solution.
Where is the recommended place to add this warning suppression configuration? Just once, inside /src/lib/translations/index.js
?
Is there anything different recommended for non-typescript implementation?
Hi @baisong!
Yes, the right place to avoid warning logs is log
setting in your config (you can place this config wherever you want, just import it for this lib).
There is no difference in comparison to typescript.
(It does not duplicate #75)
I received the following warning:
'mn' is Mongolian (Монгол) which is also in the IANA Language subtag registry