it just works

This commit is contained in:
2023-01-12 12:05:53 +01:00
parent 4c7faa1b46
commit 733e2ab006
54 changed files with 336 additions and 3608 deletions

View File

@@ -0,0 +1,28 @@
// @ts-nocheck
import i18n from "../../assets/i18n.yaml";
export default class I18nBuilder {
private language: string;
private textMap = i18n.languages;
constructor(language: string) {
this.language = language;
}
getLanguage(): string {
return this.language;
}
setLanguage(language: string): void {
this.language = language;
}
t(key: string): string {
const map = this.textMap[this.language]
if (map) {
const translation = map[key];
return translation ?? 'caption not defined';
}
return 'caption not defined';
}
}