mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-20 12:24:55 +01:00
locale slugs
This commit is contained in:
3 files changed
+6
-7
No files matched your search
@@ -182,15 +182,14 @@ export abstract class ServerBlitzKitAPI0 extends AbstractBlitzKitAPI {
|
|||||||
` Cache miss for ${supported.locale} (this will take a while...)`
|
` Cache miss for ${supported.locale} (this will take a while...)`
|
||||||
);
|
);
|
||||||
|
|
||||||
const localLocale = supported.variant_blitz_local ?? supported.locale;
|
const stringsLocale = supported.variant_blitz_strings ?? supported.locale;
|
||||||
const cdnLocale = supported.variant_blitz_cdn ?? supported.locale;
|
|
||||||
const networkStrings = (await fetch(
|
const networkStrings = (await fetch(
|
||||||
`https://stufficons.wgcdn.co/localizations/${cdnLocale}.yaml`
|
`https://stufficons.wgcdn.co/localizations/${stringsLocale}.yaml`
|
||||||
)
|
)
|
||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then(parseYaml)) as BlitzStrings;
|
.then(parseYaml)) as BlitzStrings;
|
||||||
const localStrings = await this.vfs.yaml<BlitzStrings>(
|
const localStrings = await this.vfs.yaml<BlitzStrings>(
|
||||||
`Data/Strings/${localLocale}.yaml`
|
`Data/Strings/${stringsLocale}.yaml`
|
||||||
);
|
);
|
||||||
const combined = { ...networkStrings, ...localStrings };
|
const combined = { ...networkStrings, ...localStrings };
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export abstract class ServerBlitzKitAPI10 extends ServerBlitzKitAPI9 {
|
|||||||
await Promise.all(
|
await Promise.all(
|
||||||
locales.supported.map(async (supported) => {
|
locales.supported.map(async (supported) => {
|
||||||
const glossary = await fetchGlossary(
|
const glossary = await fetchGlossary(
|
||||||
supported.variant_blitz_local ?? supported.locale,
|
supported.variant_blitz_glossary ?? supported.locale,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
{
|
{
|
||||||
"locale": "zh",
|
"locale": "zh",
|
||||||
|
|
||||||
"variant_blitz_local": "zh_Hans_SG",
|
"variant_blitz_glossary": "zh_Hans_SG",
|
||||||
"variant_blitz_cdn": "zh-Hans",
|
"variant_blitz_strings": "zh-Hans",
|
||||||
|
|
||||||
"flag": "🇨🇳"
|
"flag": "🇨🇳"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user