diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index 99c610b77..0a68c486a 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -745,7 +745,9 @@ function applyFunboxesToWord(word: string, wordset?: Wordset.Wordset): string { } else if (Config.funbox === "58008") { word = Misc.getNumbers(7); if (Config.language.startsWith("kurdish")) { - word = Misc.convertNumberToArabicIndic(word); + word = Misc.convertNumberToArabic(word); + } else if (Config.language.startsWith("nepali")) { + word = Misc.convertNumberToNepali(word); } } else if (Config.funbox === "specials") { word = Misc.getSpecials(); @@ -852,7 +854,9 @@ async function getNextWord( randomWord = Misc.getNumbers(4); if (Config.language.startsWith("kurdish")) { - randomWord = Misc.convertNumberToArabicIndic(randomWord); + randomWord = Misc.convertNumberToArabic(randomWord); + } else if (Config.language.startsWith("nepali")) { + randomWord = Misc.convertNumberToNepali(randomWord); } } } diff --git a/frontend/src/ts/utils/misc.ts b/frontend/src/ts/utils/misc.ts index cce62137e..bcbb267a1 100644 --- a/frontend/src/ts/utils/misc.ts +++ b/frontend/src/ts/utils/misc.ts @@ -573,7 +573,7 @@ export function getNumbers(len: number): string { } //convert numbers to arabic-indic -export function convertNumberToArabicIndic(numString: string): string { +export function convertNumberToArabic(numString: string): string { const arabicIndic = "٠١٢٣٤٥٦٧٨٩"; let ret = ""; for (let i = 0; i < numString.length; i++) { @@ -582,6 +582,15 @@ export function convertNumberToArabicIndic(numString: string): string { return ret; } +export function convertNumberToNepali(numString: string): string { + const nepaliIndic = "०१२३४५६७८९"; + let ret = ""; + for (let i = 0; i < numString.length; i++) { + ret += nepaliIndic[parseInt(numString[i])]; + } + return ret; +} + export function getSpecials(): string { const randLen = randomIntFromRange(1, 7); let ret = "";