mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-18 05:11:52 +08:00
fix(word generation): display proper period and numbers for hindi (#5366)
This commit is contained in:
parent
7fd31dcc72
commit
e88601d344
2 changed files with 15 additions and 1 deletions
|
|
@ -77,7 +77,10 @@ export async function punctuateWord(
|
|||
if (rand <= 0.8) {
|
||||
if (currentLanguage === "kurdish") {
|
||||
word += ".";
|
||||
} else if (currentLanguage === "nepali") {
|
||||
} else if (
|
||||
currentLanguage === "nepali" ||
|
||||
currentLanguage === "hindi"
|
||||
) {
|
||||
word += "।";
|
||||
} else if (
|
||||
currentLanguage === "japanese" ||
|
||||
|
|
@ -864,6 +867,8 @@ export async function getNextWord(
|
|||
randomWord = Misc.convertNumberToArabic(randomWord);
|
||||
} else if (Config.language.startsWith("nepali")) {
|
||||
randomWord = Misc.convertNumberToNepali(randomWord);
|
||||
} else if (Config.language.startsWith("hindi")) {
|
||||
randomWord = Misc.convertNumberToHindi(randomWord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,15 @@ export function convertNumberToNepali(numString: string): string {
|
|||
return ret;
|
||||
}
|
||||
|
||||
export function convertNumberToHindi(numString: string): string {
|
||||
const hindiIndic = "०१२३४५६७८९";
|
||||
let ret = "";
|
||||
for (const char of numString) {
|
||||
ret += hindiIndic[parseInt(char)];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function findGetParameter(
|
||||
parameterName: string,
|
||||
getOverride?: string
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue