Cannot format a message without first setting the initial locale when open _error route
See original GitHub issueDescribe the bug
When I try open _error
route with some translate in it or in _layout
, library throw error
Logs
To Reproduce
- Clone i18n example repo
- Add some translate in
_error
OR_layout
({$_('title.index', { default: 'Sapper project template!' })}
, for example) - Open dont exist page (http://localhost:3000/ds)
Information about your project:
-
Browser: Chrome 82.0.4067.0
-
OS: Windows 10
-
svelte-i18n
version: latest -
Bundler: Rollup
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:15 (3 by maintainers)
Top Results From Across the Web
that's some error regarding svelte-i18n follow this instructions ...
Cannot format a message without first setting the initial locale. :( that's some error regarding svelte-i18n follow this instructions to make ...
Read more >Spring framework: No message found under code for locale
In general such issue appears not because of non-existence locale, but because MessageBundle is configured improperly.
Read more >How to Localize a Svelte App with svelte-i18n | Phrase
Walkthrough of the starter project code; Installing and setting up the svelte-i18n library; Dynamic, per-locale translation file loading ...
Read more >Locale settings are not right. How can I reset them? - Ask Ubuntu
Using the fallback 'C' locale. The locale command produces error messages locale: Cannot set LC_CTYPE to default locale: No such file or directory...
Read more >Svelte i18n Internationalization: how to localize a Svelte app
This Svelte localization tutorial explains how to setup and utilize ... an error that it cannot load without an initial locale being set....
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
For everyone coming across this issue using svelte@next. Here is my solution for now. Note that this is not prerendered at build-time.
routes/$layout.svelte
routes/index.svelte
static/lang/en.json.js
For me it was a problem that I use i18n-keys before they where actually initialized, so I needed to await the result: