mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-19 17:53:06 -05:00
Migrate Prettier/Eslint/Stylelint setup to Biome (#1772)
* Initial * CSS lint * Test CI * Add 1v1, 2v2, and 3v3 Tags (#1771) * Initial * CSS lint * Test CI * Rename step --------- Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
This commit is contained in:
@@ -1,52 +1,51 @@
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import path from "node:path";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import type euEn from "./dicts/langs/EUen.json";
|
||||
|
||||
import { fileURLToPath } from "url";
|
||||
import { fileURLToPath } from "node:url";
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const LANG_DICTS_PATH = path.join(__dirname, "dicts", "langs");
|
||||
|
||||
export const LANG_JSONS_TO_CREATE = [
|
||||
"EUen",
|
||||
"CNzh",
|
||||
"EUde",
|
||||
"EUes",
|
||||
"USes",
|
||||
"EUfr",
|
||||
"EUit",
|
||||
"EUnl",
|
||||
"EUru",
|
||||
"JPja",
|
||||
"KRko",
|
||||
"USfr",
|
||||
"EUen",
|
||||
"CNzh",
|
||||
"EUde",
|
||||
"EUes",
|
||||
"USes",
|
||||
"EUfr",
|
||||
"EUit",
|
||||
"EUnl",
|
||||
"EUru",
|
||||
"JPja",
|
||||
"KRko",
|
||||
"USfr",
|
||||
];
|
||||
|
||||
export async function loadLangDicts() {
|
||||
const result: Array<[langCode: string, translations: typeof euEn]> = [];
|
||||
const result: Array<[langCode: string, translations: typeof euEn]> = [];
|
||||
|
||||
const files = await fs.promises.readdir(LANG_DICTS_PATH);
|
||||
for (const file of files) {
|
||||
if (file === ".gitkeep") continue;
|
||||
const files = await fs.promises.readdir(LANG_DICTS_PATH);
|
||||
for (const file of files) {
|
||||
if (file === ".gitkeep") continue;
|
||||
|
||||
const translations = JSON.parse(
|
||||
fs.readFileSync(path.join(LANG_DICTS_PATH, file), "utf8"),
|
||||
);
|
||||
const translations = JSON.parse(
|
||||
fs.readFileSync(path.join(LANG_DICTS_PATH, file), "utf8"),
|
||||
);
|
||||
|
||||
result.push([file.replace(".json", ""), translations]);
|
||||
}
|
||||
result.push([file.replace(".json", ""), translations]);
|
||||
}
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
export function translationJsonFolderName(langCode: string) {
|
||||
if (langCode === "EUes") return "es-ES";
|
||||
if (langCode === "USes") return "es-US";
|
||||
if (langCode === "EUfr") return "fr-EU";
|
||||
if (langCode === "USfr") return "fr-CA";
|
||||
return langCode.slice(2);
|
||||
if (langCode === "EUes") return "es-ES";
|
||||
if (langCode === "USes") return "es-US";
|
||||
if (langCode === "EUfr") return "fr-EU";
|
||||
if (langCode === "USfr") return "fr-CA";
|
||||
return langCode.slice(2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user