Closed dewrano closed 2 years ago
Hi @dewrano!
Currently there is no way how to disable the sanitizer, but you have probably found a bug. This lib should work even without standard locales - in that case should only warn and use lower-cased form of the input locale.
I'll try to fix this in the next couple of days, thanks.)
Ok, this does not yield any error https://github.com/sveltekit-i18n/base/blob/a5df0f1c63b23504e7dbcbe7a62461f573a78149/src/utils.ts#L32 for ku
locale, so sanitized locale is undefined
...
Definitely needs to be fixed.
Will be included in sveltekit-i18n@2.1.3
and @sveltekit-i18n/base@1.1.2
@jarda-svoboda Thank you for the quick response. I've updated to 2.1.3 and now I see new warnings, but I still can't seem to get it to work. When I print out locales
, it returns undefined
for ku
. See attached screenshot.
Oh, that’s weird… there are tests for it and it worked..🤔 https://github.com/sveltekit-i18n/base/blob/master/tests/specs/index.spec.ts#L138
i’ll look at it again soon..!
It seems it already works on server side, but still does not work on client for some reason... server:
client:
It seems there is a difference between Node's and JS's Intl
so that's probably the reason why all tests were passing for ku
locale.
Anyway now it's fixed and it works on client as well in sveltekit-i18n@2.1.4
and @sveltekit-i18n/base@1.1.3
@jarda-svoboda Thank you so much, I can confirm it works. :) Hopefully we can expect #55 soon to disable the many warnings.
Hi
I'm not sure but I think this method filters away unsupported locales: https://github.com/sveltekit-i18n/base/blob/a5df0f1c63b23504e7dbcbe7a62461f573a78149/src/utils.ts#L26
I'm trying to add the Kurdish language ("ku"), but unfortunately, it's not supported when I try to run this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/supportedLocalesOf
Is there a way for us to disable the sanitizer?