Skip to content

Commit

Permalink
lang: use user language
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed May 28, 2024
1 parent 8af3f2e commit 37d981f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DeputyLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { DeputyResources } from './DeputyResources';
import cloneRegex from './util/cloneRegex';
import error from './util/error';
import warn from './util/warn';
import { USER_LOCALE } from './wiki/Locale';

/**
* Handles internationalization and localization for Deputy and sub-modules.
Expand Down Expand Up @@ -67,7 +68,7 @@ export default class DeputyLanguage {
*
* @param locale The locale to load. `window.deputyLang` by default.
*/
static async loadMomentLocale( locale = window.deputyLang ) {
static async loadMomentLocale( locale = USER_LOCALE ) {
if ( locale === 'en' ) {
// Always loaded.
return;
Expand Down
1 change: 1 addition & 0 deletions src/wiki/Locale.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const USER_LOCALE = window.deputyLang ?? mw.config.get( 'wgUserLanguage' );

0 comments on commit 37d981f

Please sign in to comment.