Skip to content

Commit

Permalink
Update i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederisk committed Dec 21, 2021
1 parent 244a523 commit d5a1537
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A Mediawiki Gadget for Wikitext Extension based on MediaWiki. To allow users to

## Usage

### For ordinary users(such as WikiMedia Sister Project editors)
### For ordinary users (such as WikiMedia Sister Project editors)

First make sure that your [VSCode](https://code.visualstudio.com/) has installed the [Wikitext Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=RoweWilsonFrederiskHolme.wikitext) v3.4.0 or upper. Then you only need to log in to your site, open the User Preferences, Appearance, and add a new line of code for Custom JavaScript:

Expand Down
47 changes: 41 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,50 @@ jQuery.when(window.mw.loader.using('mediawiki.util'), $.ready).then((): void =>
},
cantonese: {
text: '開啟於 VSCode',
tooltip: '開啟此頁於 Visual Studio Code',
tooltip: ' Visual Studio Code 開呢個頁面',
},
simplified_chinese: {
text: '在 VSCode 中打开',
tooltip: '在 Visual Studio Code 中打开此页',
tooltip: '在 Visual Studio Code 中打开此页面',
},
traditional_chinese: {
text: ' VSCode 中打開',
tooltip: ' Visual Studio Code 中打開此頁',
text: '使用 VSCode 開啟',
tooltip: ' Visual Studio Code 開啟此頁面',
},
korean: {
text: 'VSCode 에서 열기',
tooltip: '이 페이지를 Visual Studio Code 에서 열기',
},
thai: {
text: 'เปิดใน VSCode',
tooltip: 'เปิดหน้านี้ใน Visual Studio Code',
},
vietnamese: {
text: 'Mở trong VSCode',
tooltip: 'Mở trang này trong Visual Studio Code',
},
indonesian: {
text: 'Buka di VSCode',
tooltip: 'Buka halaman ini di Visual Studio Code',
},
polish: {
text: 'Otwórz w VSCode',
tooltip: 'Otwórz tę stronę w Visual Studio Code',
},
dutch: {
text: 'Open in VSCode',
tooltip: 'Open deze pagina in Visual Studio Code',
},
french: {
text: 'Ouvrir dans VSCode',
tooltip: 'Ouvrir cette page dans Visual Studio Code',
},
german: {
text: 'Öffnen in VSCode',
tooltip: 'Öffne diese Seite in Visual Studio Code',
},
};
const i18n: Record<string, DisplayInfo> = {
// English: default
'en': i18nSource['english'],
'ru': i18nSource['russian'],
'ja': i18nSource['japanese'],
Expand All @@ -61,6 +88,13 @@ jQuery.when(window.mw.loader.using('mediawiki.util'), $.ready).then((): void =>
'zh-tw': i18nSource['traditional_chinese'],
'zh-hk': i18nSource['traditional_chinese'],
'zh-mo': i18nSource['traditional_chinese'],
'th': i18nSource['thai'],
'vi': i18nSource['vietnamese'],
'id': i18nSource['indonesian'],
'pl': i18nSource['polish'],
'nl': i18nSource['dutch'],
'fr': i18nSource['french'],
'de': i18nSource['german'],
};
const lang: string = window.mw.config.get('wgUserLanguage');
const displayInfo: DisplayInfo = {
Expand Down Expand Up @@ -94,5 +128,6 @@ jQuery.when(window.mw.loader.using('mediawiki.util'), $.ready).then((): void =>
'wikitext-extension-gadget',
displayInfo['tooltip'],
undefined,
isMinerva ? undefined : '#ca-history');
isMinerva ? undefined : '#ca-history'
);
});

0 comments on commit d5a1537

Please sign in to comment.