use transliteration

This commit is contained in:
tresabhi committed 2026-07-31 11:21:50 -05:00
1 parent 0f47208f5e
commit 434d1ede3c
4 files changed
+7 -12

No files matched your search

@@ -1,9 +1,9 @@
import { assertSecret } from "@blitzkit/core";
import { AbstractVFS } from "../core/vfs/abstract";
import { LocalVFS } from "../core/vfs/local";
import { MixedVFS } from "../core/vfs/mixed";
import { SteamVFS } from "../core/vfs/steam";
import { ZipVFS } from "../core/vfs/zip";
import { MixedVFS } from "../core/vfs/mixed";
export const PATCHES_ROOT = "../../temp/patches";
@@ -34,20 +34,15 @@ import {
import { SUPPORTED_LOCALE_BLITZ_MAP } from "@blitzkit/i18n";
import locales from "@blitzkit/i18n/locales.json";
import { readFile } from "fs/promises";
import { deburr } from "lodash-es";
import { parse as parsePath } from "path";
import type { Vector3Tuple } from "three";
import { slugify } from "transliteration";
import { parse as parseYaml } from "yaml";
import { AssetUploader } from "../core/github/assetUploader";
import { vfs } from "./constants";
import type { Avatar } from "./skillIcons";
import type { TankParameters } from "./tankIcons";
const nonAlphanumericRegex = /[^a-z0-9]/g;
const multipleDashesRegex = /--+/g;
const trailingDashRegex = /-$/g;
const leadingDashRegex = /^-/g;
const nationSlugDiscriminators = {
china: "cn",
european: "eu",
@@ -770,11 +765,7 @@ export async function definitions() {
getString(tank.userString)
).locales.en;
let slug = deburr(name).toLowerCase();
slug = slug.replaceAll(nonAlphanumericRegex, "-");
slug = slug.replaceAll(multipleDashesRegex, "-");
slug = slug.replaceAll(trailingDashRegex, "");
slug = slug.replaceAll(leadingDashRegex, "");
let slug = slugify(name);
idToNation[tankId] = nation;