|
|
(35 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| function getLang()
| |
| {
| |
| if (navigator.languages !== undefined)
| |
| return navigator.languages[0];
| |
| return navigator.language;
| |
| }
| |
|
| |
| function localizeDates()
| |
| {
| |
| const lang = getLang();
| |
| const root = document.querySelector(':root');
| |
|
| |
| if (root == undefined || lang == undefined)
| |
| return;
| |
|
| |
| if (lang == "en-US")
| |
| {
| |
| root.style.setProperty('--month-order', '1');
| |
| root.style.setProperty('--day-order', '2');
| |
| }
| |
| else
| |
| {
| |
| root.style.setProperty('--month-order', '2');
| |
| root.style.setProperty('--day-order', '1');
| |
| }
| |
| }
| |
| $(localizeDates);
| |
|
| |
| mw.hook('wikiEditor.toolbarReady').add(function($textarea) | | mw.hook('wikiEditor.toolbarReady').add(function($textarea) |
| { | | { |