fallback doesn't work
See original GitHub issuei18n.mjs:1 Uncaught Error: [svelte-i18n] Locale "it-IT" not found.
at Object.ct.set (i18n.mjs:1)
at locale.js:17
at main.js:12
I have english (en) and german (de) defined as my locales, but if I change my language in Chrome to Italian (it-IT). It fails with the above error.
Here is my config:
import { locale, dictionary, getClientLocale } from 'svelte-i18n'
import { de, fr, en } from './i18n'
// Define a locale dictionary
dictionary.set({
de,
fr,
en,
})
// This is a store, so we can subscribe to its changes
locale.subscribe(() => {
console.log('locale change')
})
// svelte-i18n exports a method to help getting the current client locale
locale.set(
getClientLocale({
// the fallback locale, if didn't find any
fallback: 'en',
// set to 'true' to check the 'window.navigator.language'
navigator: true,
// // set the key name to look for a locale on 'window.location.search'
// // 'example.com?locale=en-US'
// search: 'lang'
}),
)
// Set the current locale to en-US
// locale.set('en')
I just get a blank page (demo: https://puump.com)
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Fallback function does not work solidity
A fallback function is invoked when the contract receives some Ether(or a non existent function is called) but the gas provided is only ......
Read more >Fallback doesn't work - WordPress.org
Hi Johan,. The fallback image is mostly used in preview.php (on archive pages) and in the recent posts widget. It's not used for...
Read more >Fallback image when autoplay doesn't work - Stack Overflow
I'm developing my portfolio using React and Gatsby and I am using a video to create an animated shadow. The video is in...
Read more >Language fallback doesn't work properly · Issue #389 - GitHub
the fallbacks variable is re-evaluate on each failure, because the parameter passed to this.fallbackStrategy.getNextLangs(lang) is the current failed language.
Read more >Fallback - i18next documentation
If you can not provide the preferred language for a user, you can specify another language as fallback. This is useful to indicate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m downgrading until you figure out how to fix your bugs.
Fixed on
v2.0.1
. Please, see https://github.com/kaisermann/svelte-i18n/wiki#setting-the-initial-locale to set the initial and fallback locales in a simpler way 😁