From 30ba739374df01d8ce6f2149e8f750289e9a763b Mon Sep 17 00:00:00 2001 From: huaak <50967309+huaak@users.noreply.github.com> Date: Sun, 16 Apr 2023 18:28:11 +0200 Subject: [PATCH] Add files via upload --- www/i18n-ext.js | 16 +++++++++++++++- www/i18n.d.ts | 4 ++++ www/list.json | 10 ++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 www/list.json diff --git a/www/i18n-ext.js b/www/i18n-ext.js index 63193cc..1cfe535 100644 --- a/www/i18n-ext.js +++ b/www/i18n-ext.js @@ -17,6 +17,7 @@ var I18nExtensions = (function() { 'en-US': English, 'zh-CN': Chinese, 'de-DE': German, + 'nl-NL': Dutch, 'ar': Arabic }; @@ -113,7 +114,20 @@ var I18nExtensions = (function() { } } } - + /** + * @type {ExtensionOf<'nl-NL'>} + */ + function Dutch(things, conditions) { + if (typeof conditions === 'string') + return conditions; + for (let index in things) { + let value = things[index]; + if (typeof value === 'number') { + if (value == 1) return conditions['single']; + else return conditions['multiple']; + } + } + } /** * @type {ExtensionOf<'ar'>} */ diff --git a/www/i18n.d.ts b/www/i18n.d.ts index 5deacaa..04c7545 100644 --- a/www/i18n.d.ts +++ b/www/i18n.d.ts @@ -29,6 +29,10 @@ type AllConditions = { 'single': string, 'multiple': string }, + 'nl-NL': { + 'single': string, + 'multiple': string + }, 'zh-CN': { 'measure': string } diff --git a/www/list.json b/www/list.json new file mode 100644 index 0000000..20f77dd --- /dev/null +++ b/www/list.json @@ -0,0 +1,10 @@ +{ + "en-US": "English (US)", + "de-DE": "Deutsch", + "nl-NL": "Nederlands", + "zh-CN": "中文(简体字)", + "zh-TW": "中文(正體字)", + "zh-HK": "中文(香港字)", + "lolcat": "LOLCAT", + "zh-Hant-CN": "中文(傳統字)" +} \ No newline at end of file