mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-04-22 10:42:10 +00:00
15 lines
446 B
TypeScript
15 lines
446 B
TypeScript
import LangList, { Langs } from "./interfaces/LangList";
|
|
|
|
type possibilities = "abilityType" | "category" | "rarity" | "tag" | "type"
|
|
|
|
export default class TranslationUtil {
|
|
public static translate(master: possibilities,a: number, lang: Langs): string|undefined {
|
|
const trans = require(`./${master}`).default as translations
|
|
const tmp = trans[lang]
|
|
if (!tmp) return
|
|
return tmp[a]
|
|
}
|
|
}
|
|
|
|
export type translations = LangList<Array<string>>
|