Comments (17)
Interesting 🤔 hmmm... that's strange..
from lib.
Make sure you changed the log level or remove it. It's whenever I'm switching page 🤔
from lib.
Hello all,
I believe the error is due to you NOT using a standard language code. An example of this would be using "jp" for Japan. The correct country abreviation is "ja".
For a full list see here: language_codes.
Possibly you have "static" as a language Code????
from lib.
There is other unmentioned possibility that your locale static
value comes from locale.set(…)
(and not from your config). This warning should be definitely updated..
anyway you could use log.level = 'debug'
config which should give you more detailed information so maybe then you could see where the wrong locale input comes from..
from lib.
Hmm, think it's referring to my static folder for whatever reason 🤔
from lib.
That’s weird, there has to be something wrong in your config (I didn’t notice similar behavior in any of examples and also tests work well).. could you provide some repro?.)
from lib.
Hmm weird, haven't really changed anything 🤔
https://github.com/Swepool/nbx-site
from lib.
debug doesn't really give me anything, but everything seems work.
from lib.
Ok, I’ll run it during today, but on a first look I would say there is some bad img src (or other static asset) with route-like url so it’s probably accepted here and/or here
from lib.
i just tried and i'm not getting the warning - was it some specific page/app state?
from lib.
Ok, that's weird, but it seems that .woff
files go through the load
function in SvelteKit so it is recognized as a url to parse the locale from... Just tried to insert this supercool log console.log(`lang constant in the __layout 'load' function has '${lang}' value – parsed from '${pathname}' pathname.`);
after const lang = ...
and getting:
lang constant in the __layout 'load' function has 'static' value – parsed from '/static/fonts/basis-grotesque-bold-pro.woff' pathname.
[i18n]: Non-standard locale provided: 'static'. Check your 'translations' and 'loaders' in i18n config...
lang constant in the __layout 'load' function has 'static' value – parsed from '/static/fonts/basis-grotesque-off-white-pro.woff' pathname.
[i18n]: Non-standard locale provided: 'static'. Check your 'translations' and 'loaders' in i18n config...
lang constant in the __layout 'load' function has 'en' value – parsed from '/en/about' pathname.
// ^^^ This one is correct => no additional warnings
lang constant in the __layout 'load' function has 'static' value – parsed from '/static/fonts/basis-grotesque-regular-pro.woff' pathname.
[i18n]: Non-standard locale provided: 'static'. Check your 'translations' and 'loaders' in i18n config...
Not 100% sure yet, but It seems like a SvelteKit's bug to me...
from lib.
It also prompts this message when adding a “service-worker” file in the project.
[i18n]: Non-standard locale provided: 'service-worker.js'. Check your 'translations' and 'loaders' in i18n config...
from lib.
Not tested yet, but I guess it’s probably the same issue with SvelteKit..
from lib.
export const defaultLocale = 'fr';
export const { t, locale, locales, loading, loadTranslations, translations } = new i18n(config);
loading.subscribe(async ($loading) => {
if ($loading) {
await loading.toPromise();
}
});
I'm using 'en' and 'fr', which it seems to be ok.
from lib.
I got this warning for using 'nn' which is in the list.
from lib.
I had this problem, in my case the non standard locale message was 'images'. It was caused by a url to a file ('/images/arrow.svg') that didn't exist anymore. The url was in a scss file that i loaded globaly
from lib.
Correct me if i'm wrong, but i think that current version of SvelteKit no longer loads static assets through the load
function, so i'm closing this issue for now..
from lib.
Related Issues (20)
- How to extract missing translations? HOT 4
- A way to show or hide defaultLocale path HOT 3
- t is not loaded with dynamic url HOT 1
- Setting the page direction to "rtl"
- Does this library support cultures. Like en-uk and en-us? HOT 3
- Reasonable way to avoid locale resetting on preload? HOT 1
- Disabling localization for some routes
- error pages not translated when accessed in browser for the first time HOT 2
- Naming routes depending on selected locale HOT 8
- ICU format is not recognized HOT 2
- preprocess: preserveArrays do not work with string[] HOT 2
- Default locale flashes when reloading page HOT 3
- Adding log when no translation is found in provided local/fallback HOT 5
- Manage locals with same key HOT 3
- zu locale is non-standard HOT 2
- 'cy' locale is non-standard. HOT 1
- Dynamic translations inside each HOT 3
- Translations are not rendered during SSR HOT 3
- Error with Svelte 5.0.0, can't install package. HOT 2
- TS2353: Object literal may only specify known properties, and '<field>' does not exist in type 'PayloadDefault'. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lib.