mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 22:02:18 +02:00
Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
This commit is contained in:
parent
44832eb709
commit
9c830de743
@ -71,16 +71,15 @@ const alternativeFonts = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadFont(language: string) {
|
function loadFont(language: string) {
|
||||||
Object.keys(alternativeFonts).forEach(l => {
|
let altFontLanguages = Object.keys(alternativeFonts);
|
||||||
if (language == l) {
|
if (!alternativeFonts[language]) { language = language.split(/[-_/]/)[0]; }
|
||||||
alternativeFonts[l].forEach(f=> { document.fonts.add(f); });
|
if (alternativeFonts[language]) {
|
||||||
|
alternativeFonts[language].forEach(f => { document.fonts.add(f); });
|
||||||
|
altFontLanguages.splice(altFontLanguages.indexOf(language), 0);
|
||||||
}
|
}
|
||||||
else {
|
altFontLanguages.forEach(f=> {
|
||||||
alternativeFonts[l].forEach(f=> {
|
|
||||||
if (f && f.status == "loaded") { document.fonts.delete(f); }
|
if (f && f.status == "loaded") { document.fonts.delete(f); }
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initI18n(): void {
|
export function initI18n(): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user