mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-18 14:55:34 +08:00
language checks use startsWith() (#3502) neezacoto
* replacing otchecking for languages uses startsWith * renamed language file to not include decimal places * replacing remaing underscore characters * removing language size Co-authored-by: Miodec <bartnikjack@gmail.com>
This commit is contained in:
parent
d461255be1
commit
1a9e2c4134
5 changed files with 10 additions and 8 deletions
|
|
@ -93,7 +93,7 @@ async function submitReport(): Promise<void> {
|
|||
}
|
||||
|
||||
const quoteId = state.quoteToReport?.id.toString();
|
||||
const quoteLanguage = Config.language;
|
||||
const quoteLanguage = Config.language.replace(/_\d*k$/g, "");
|
||||
const reason = $("#quoteReportPopup .reason").val() as string;
|
||||
const comment = $("#quoteReportPopup .comment").val() as string;
|
||||
const captcha = captchaResponse as string;
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ export function restart(options = {} as RestartOptions): void {
|
|||
if (
|
||||
Config.repeatQuotes === "typing" &&
|
||||
Config.mode === "quote" &&
|
||||
Config.language.replace(/_\d*k$/g, "") === TestWords.randomQuote.language
|
||||
Config.language.startsWith(TestWords.randomQuote.language)
|
||||
) {
|
||||
options.withSameWordset = true;
|
||||
}
|
||||
|
|
@ -748,7 +748,7 @@ function applyFunboxesToWord(word: string, wordset?: Wordset.Wordset): string {
|
|||
word = Misc.getArrows();
|
||||
} else if (Config.funbox === "58008") {
|
||||
word = Misc.getNumbers(7);
|
||||
if (Config.language.split("_")[0] === "kurdish") {
|
||||
if (Config.language.startsWith("kurdish")) {
|
||||
word = Misc.convertNumberToArabicIndic(word);
|
||||
}
|
||||
} else if (Config.funbox === "specials") {
|
||||
|
|
@ -847,7 +847,7 @@ async function getNextWord(
|
|||
if (Math.random() < 0.1) {
|
||||
randomWord = Misc.getNumbers(4);
|
||||
|
||||
if (Config.language.split("_")[0] === "kurdish") {
|
||||
if (Config.language.startsWith("kurdish")) {
|
||||
randomWord = Misc.convertNumberToArabicIndic(randomWord);
|
||||
}
|
||||
}
|
||||
|
|
@ -1064,7 +1064,9 @@ export async function init(): Promise<void> {
|
|||
if (quotesCollection.length === 0) {
|
||||
TestUI.setTestRestarting(false);
|
||||
Notifications.add(
|
||||
`No ${Config.language.replace(/_\d*k$/g, "")} quotes found`,
|
||||
`No ${Config.language
|
||||
.replace(/_\d*k$/g, "")
|
||||
.replace(/_/g, " ")} quotes found`,
|
||||
0
|
||||
);
|
||||
if (Auth.currentUser) {
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@
|
|||
},
|
||||
{
|
||||
"name": "hungarian",
|
||||
"languages": ["hungarian", "hungarian_2.5k"]
|
||||
"languages": ["hungarian", "hungarian_2k"]
|
||||
},
|
||||
{
|
||||
"name": "norwegian",
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
,"danish_1k"
|
||||
,"danish_10k"
|
||||
,"hungarian"
|
||||
,"hungarian_2.5k"
|
||||
,"hungarian_2k"
|
||||
,"norwegian"
|
||||
,"norwegian_1k"
|
||||
,"norwegian_5k"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "hungarian_2.5k",
|
||||
"name": "hungarian_2k",
|
||||
"leftToRight": true,
|
||||
"bcp47": "hu-HU",
|
||||
"words": [
|
||||
Loading…
Add table
Reference in a new issue