diff --git a/packages/hydrooj/src/lib/i18n.ts b/packages/hydrooj/src/lib/i18n.ts index 6608d9281..15e6c4953 100644 --- a/packages/hydrooj/src/lib/i18n.ts +++ b/packages/hydrooj/src/lib/i18n.ts @@ -54,9 +54,8 @@ export class I18nService extends Service { // So if it doesn't exist, we should use the original text instead of fallback. return this.get(str, languages[0]) || this.get(str, 'en') || str.toString(); } - for (const language of languages.filter(Boolean)) { - const curr = this.get(str, language) || this.get(str, language.split('_')[0]) - || this.get(str, language.split('-')[0]); + for (const language of languages.filter(Boolean).map((i) => i.replace(/-/g, '_'))) { + const curr = this.get(str, language) || this.get(str, language.split('_')[0]); if (curr) return curr; } return str.toString();