Giter VIP home page Giter VIP logo

Comments (17)

Swepool avatar Swepool commented on May 18, 2024 2

Interesting 🤔 hmmm... that's strange..

from lib.

Swepool avatar Swepool commented on May 18, 2024 1

Make sure you changed the log level or remove it. It's whenever I'm switching page 🤔

from lib.

kevin192291 avatar kevin192291 commented on May 18, 2024 1

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.

jarda-svoboda avatar jarda-svoboda commented on May 18, 2024

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.

Swepool avatar Swepool commented on May 18, 2024

Hmm, think it's referring to my static folder for whatever reason 🤔

from lib.

jarda-svoboda avatar jarda-svoboda commented on May 18, 2024

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.

Swepool avatar Swepool commented on May 18, 2024

Hmm weird, haven't really changed anything 🤔

https://github.com/Swepool/nbx-site

from lib.

Swepool avatar Swepool commented on May 18, 2024

debug doesn't really give me anything, but everything seems work.

from lib.

jarda-svoboda avatar jarda-svoboda commented on May 18, 2024

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.

jarda-svoboda avatar jarda-svoboda commented on May 18, 2024

i just tried and i'm not getting the warning - was it some specific page/app state?

from lib.

jarda-svoboda avatar jarda-svoboda commented on May 18, 2024

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.

R3D2 avatar R3D2 commented on May 18, 2024

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.

jarda-svoboda avatar jarda-svoboda commented on May 18, 2024

Not tested yet, but I guess it’s probably the same issue with SvelteKit..

from lib.

R3D2 avatar R3D2 commented on May 18, 2024
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.

iverks avatar iverks commented on May 18, 2024

I got this warning for using 'nn' which is in the list.

from lib.

ruudtimmermans avatar ruudtimmermans commented on May 18, 2024

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.

jarda-svoboda avatar jarda-svoboda commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.