From 138b94b53960660ac70755dce8f36356b361c9ac Mon Sep 17 00:00:00 2001 From: sienori Date: Thu, 3 Mar 2022 00:07:58 +0900 Subject: [PATCH] Use split language list --- src/_locales/en/messages.json | 312 ++++++++++++++++++++++++++++++ src/_locales/ja/messages.json | 312 ++++++++++++++++++++++++++++++ src/common/generateLangOptions.js | 10 +- 3 files changed, 629 insertions(+), 5 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 7df467a..a80c7d4 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -400,5 +400,317 @@ }, "openPopupDescription": { "message": "Open toolbar popup" + }, + "lang_af": { + "message": "Afrikaans" + }, + "lang_sq": { + "message": "Albanian" + }, + "lang_am": { + "message": "Amharic" + }, + "lang_ar": { + "message": "Arabic" + }, + "lang_hy": { + "message": "Armenian" + }, + "lang_az": { + "message": "Azerbaijani" + }, + "lang_eu": { + "message": "Basque" + }, + "lang_be": { + "message": "Belarusian" + }, + "lang_bn": { + "message": "Bengali" + }, + "lang_bs": { + "message": "Bosnian" + }, + "lang_bg": { + "message": "Bulgarian" + }, + "lang_ca": { + "message": "Catalan" + }, + "lang_ceb": { + "message": "Cebuano" + }, + "lang_ny": { + "message": "Chewa" + }, + "lang_zh-CN": { + "message": "Chinese (Simplified)" + }, + "lang_zh-TW": { + "message": "Chinese (Traditional)" + }, + "lang_co": { + "message": "Corsican" + }, + "lang_hr": { + "message": "Croatian" + }, + "lang_cs": { + "message": "Czech" + }, + "lang_da": { + "message": "Danish" + }, + "lang_nl": { + "message": "Dutch" + }, + "lang_en": { + "message": "English" + }, + "lang_eo": { + "message": "Esperanto" + }, + "lang_et": { + "message": "Estonian" + }, + "lang_fi": { + "message": "Finnish" + }, + "lang_fr": { + "message": "French" + }, + "lang_fy": { + "message": "Frisian" + }, + "lang_gl": { + "message": "Galician" + }, + "lang_ka": { + "message": "Georgian" + }, + "lang_de": { + "message": "German" + }, + "lang_el": { + "message": "Greek" + }, + "lang_gu": { + "message": "Gujarati" + }, + "lang_ht": { + "message": "Haitian" + }, + "lang_ha": { + "message": "Hausa" + }, + "lang_haw": { + "message": "Hawaiian" + }, + "lang_he": { + "message": "Hebrew" + }, + "lang_hi": { + "message": "Hindi" + }, + "lang_hu": { + "message": "Hungarian" + }, + "lang_is": { + "message": "Icelandic" + }, + "lang_ig": { + "message": "Igbo" + }, + "lang_id": { + "message": "Indonesian" + }, + "lang_ga": { + "message": "Irish" + }, + "lang_it": { + "message": "Italian" + }, + "lang_ja": { + "message": "Japanese" + }, + "lang_jv": { + "message": "Javanese" + }, + "lang_kn": { + "message": "Kannada" + }, + "lang_kk": { + "message": "Kazakh" + }, + "lang_km": { + "message": "Khmer" + }, + "lang_ky": { + "message": "Kirghiz" + }, + "lang_ko": { + "message": "Korean" + }, + "lang_ku": { + "message": "Kurdish" + }, + "lang_lo": { + "message": "Laotian" + }, + "lang_la": { + "message": "Latin" + }, + "lang_lv": { + "message": "Latvian" + }, + "lang_lt": { + "message": "Lithuanian" + }, + "lang_lb": { + "message": "Luxembourgish" + }, + "lang_mk": { + "message": "Macedonian" + }, + "lang_mg": { + "message": "Malagasy" + }, + "lang_ms": { + "message": "Malay" + }, + "lang_ml": { + "message": "Malayalam" + }, + "lang_mt": { + "message": "Maltese" + }, + "lang_mi": { + "message": "Maori" + }, + "lang_mr": { + "message": "Marathi" + }, + "lang_mn": { + "message": "Mongolian" + }, + "lang_hmn": { + "message": "Monk" + }, + "lang_my": { + "message": "Myanmar" + }, + "lang_ne": { + "message": "Nepali" + }, + "lang_no": { + "message": "Norwegian" + }, + "lang_fa": { + "message": "Persian" + }, + "lang_pl": { + "message": "Polish" + }, + "lang_pt": { + "message": "Portuguese" + }, + "lang_pa": { + "message": "Punjabi" + }, + "lang_ps": { + "message": "Pushto" + }, + "lang_ro": { + "message": "Romanian" + }, + "lang_ru": { + "message": "Russian" + }, + "lang_sm": { + "message": "Samoan" + }, + "lang_gd": { + "message": "Scottish Gaelic" + }, + "lang_sr": { + "message": "Serbian" + }, + "lang_sn": { + "message": "Shona" + }, + "lang_sd": { + "message": "Sindhi" + }, + "lang_si": { + "message": "Sinhala" + }, + "lang_sk": { + "message": "Slovak" + }, + "lang_sl": { + "message": "Slovenian" + }, + "lang_so": { + "message": "Somali" + }, + "lang_sx": { + "message": "Sotho" + }, + "lang_es": { + "message": "Spanish" + }, + "lang_su": { + "message": "Sundanese" + }, + "lang_sw": { + "message": "Swahili" + }, + "lang_sv": { + "message": "Swedish" + }, + "lang_tl": { + "message": "Tagalog" + }, + "lang_tg": { + "message": "Tajiki" + }, + "lang_ta": { + "message": "Tamil" + }, + "lang_te": { + "message": "Telugu" + }, + "lang_th": { + "message": "Thai" + }, + "lang_tr": { + "message": "Turkish" + }, + "lang_uk": { + "message": "Ukrainian" + }, + "lang_ur": { + "message": "Urdu" + }, + "lang_uz": { + "message": "Uzbek" + }, + "lang_vi": { + "message": "Vietnamese" + }, + "lang_cy": { + "message": "Welsh" + }, + "lang_xh": { + "message": "Xosa" + }, + "lang_yi": { + "message": "Yiddish" + }, + "lang_yo": { + "message": "Yoruba" + }, + "lang_zu": { + "message": "Zulu" } } \ No newline at end of file diff --git a/src/_locales/ja/messages.json b/src/_locales/ja/messages.json index d0909ff..c3283aa 100644 --- a/src/_locales/ja/messages.json +++ b/src/_locales/ja/messages.json @@ -400,5 +400,317 @@ }, "openPopupDescription": { "message": "ツールバーポップアップを開く" + }, + "lang_af": { + "message": "アフリカーンス語" + }, + "lang_sq": { + "message": "アルバニア語" + }, + "lang_am": { + "message": "アムハラ語" + }, + "lang_ar": { + "message": "アラビア語" + }, + "lang_hy": { + "message": "アルメニア語" + }, + "lang_az": { + "message": "アゼルバイジャン語" + }, + "lang_eu": { + "message": "バスク語" + }, + "lang_be": { + "message": "ベラルーシ語" + }, + "lang_bn": { + "message": "ベンガル語" + }, + "lang_bs": { + "message": "ボスニア語" + }, + "lang_bg": { + "message": "ブルガリア語" + }, + "lang_ca": { + "message": "カタルーニャ語" + }, + "lang_ceb": { + "message": "セブアノ語" + }, + "lang_ny": { + "message": "チェワ語" + }, + "lang_zh-CN": { + "message": "中国語 (簡体)" + }, + "lang_zh-TW": { + "message": "中国語 (繁体)" + }, + "lang_co": { + "message": "コルシカ語" + }, + "lang_hr": { + "message": "クロアチア語" + }, + "lang_cs": { + "message": "チェコ語" + }, + "lang_da": { + "message": "デンマーク語" + }, + "lang_nl": { + "message": "オランダ語" + }, + "lang_en": { + "message": "英語" + }, + "lang_eo": { + "message": "エスペラント語" + }, + "lang_et": { + "message": "エストニア語" + }, + "lang_fi": { + "message": "フィンランド語" + }, + "lang_fr": { + "message": "フランス語" + }, + "lang_fy": { + "message": "フリジア語" + }, + "lang_gl": { + "message": "ガリシア語" + }, + "lang_ka": { + "message": "ジョージア(グルジア)語" + }, + "lang_de": { + "message": "ドイツ語" + }, + "lang_el": { + "message": "ギリ シャ語" + }, + "lang_gu": { + "message": "グジャラト語" + }, + "lang_ht": { + "message": "ハイチ語" + }, + "lang_ha": { + "message": "ハウサ語" + }, + "lang_haw": { + "message": "ハワイ語" + }, + "lang_he": { + "message": "ヘブライ語" + }, + "lang_hi": { + "message": "ヒンディー語" + }, + "lang_hu": { + "message": "ハンガリー語" + }, + "lang_is": { + "message": "アイ スランド語" + }, + "lang_ig": { + "message": "イボ語" + }, + "lang_id": { + "message": "インドネシア語" + }, + "lang_ga": { + "message": "アイルランド語" + }, + "lang_it": { + "message": "イタリア語" + }, + "lang_ja": { + "message": "日本語" + }, + "lang_jv": { + "message": "ジャワ語" + }, + "lang_kn": { + "message": "カンナダ語" + }, + "lang_kk": { + "message": "カザフ語" + }, + "lang_km": { + "message": "クメール語" + }, + "lang_ky": { + "message": "キルギス語" + }, + "lang_ko": { + "message": "韓国語" + }, + "lang_ku": { + "message": "クルド語" + }, + "lang_lo": { + "message": "ラオ語" + }, + "lang_la": { + "message": "ラテン語" + }, + "lang_lv": { + "message": "ラトビア語" + }, + "lang_lt": { + "message": "リトアニア語" + }, + "lang_lb": { + "message": "ルクセンブルク語" + }, + "lang_mk": { + "message": "マケドニア語" + }, + "lang_mg": { + "message": "マラガシ語" + }, + "lang_ms": { + "message": "マレー語" + }, + "lang_ml": { + "message": "マラヤーラム語" + }, + "lang_mt": { + "message": "マルタ語" + }, + "lang_mi": { + "message": "マオリ語" + }, + "lang_mr": { + "message": "マラーティー語" + }, + "lang_mn": { + "message": "モンゴル語" + }, + "lang_hmn": { + "message": "モン語" + }, + "lang_my": { + "message": "ミャンマー語" + }, + "lang_ne": { + "message": "ネパール語" + }, + "lang_no": { + "message": "ノルウェー語" + }, + "lang_fa": { + "message": "ペルシャ語" + }, + "lang_pl": { + "message": "ポーランド語" + }, + "lang_pt": { + "message": "ポルトガ ル語" + }, + "lang_pa": { + "message": "パンジャブ語" + }, + "lang_ps": { + "message": "パシュト語" + }, + "lang_ro": { + "message": "ルーマニア語" + }, + "lang_ru": { + "message": "ロ シア語" + }, + "lang_sm": { + "message": "サモア語" + }, + "lang_gd": { + "message": "スコットランド ゲール語" + }, + "lang_sr": { + "message": "セルビア語" + }, + "lang_sn": { + "message": "ショナ語" + }, + "lang_sd": { + "message": "シンド語" + }, + "lang_si": { + "message": "シンハラ語" + }, + "lang_sk": { + "message": "スロバキア語" + }, + "lang_sl": { + "message": "スロベニア語" + }, + "lang_so": { + "message": "ソマリ語" + }, + "lang_sx": { + "message": "ソト語" + }, + "lang_es": { + "message": "スペイン語" + }, + "lang_su": { + "message": "スンダ語" + }, + "lang_sw": { + "message": "スワヒリ語" + }, + "lang_sv": { + "message": "スウェーデン語" + }, + "lang_tl": { + "message": "タガログ語" + }, + "lang_tg": { + "message": " タジク語" + }, + "lang_ta": { + "message": "タミル語" + }, + "lang_te": { + "message": "テルグ語" + }, + "lang_th": { + "message": "タイ語" + }, + "lang_tr": { + "message": "トルコ語" + }, + "lang_uk": { + "message": "ウクライナ語" + }, + "lang_ur": { + "message": "ウルドゥ語" + }, + "lang_uz": { + "message": "ウズベク語" + }, + "lang_vi": { + "message": "ベトナム語" + }, + "lang_cy": { + "message": "ウェールズ語" + }, + "lang_xh": { + "message": "コーサ語" + }, + "lang_yi": { + "message": "イディッシュ語" + }, + "lang_yo": { + "message": "ヨルバ語" + }, + "lang_zu": { + "message": "ズールー語" } } \ No newline at end of file diff --git a/src/common/generateLangOptions.js b/src/common/generateLangOptions.js index b398b06..eb0ef50 100644 --- a/src/common/generateLangOptions.js +++ b/src/common/generateLangOptions.js @@ -1,12 +1,12 @@ import browser from "webextension-polyfill"; const alphabeticallySort = (a, b) => a.name.localeCompare(b.name); +const langListGoogle = ["af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh-TW", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "hi", "hmn", "hu", "is", "ig", "id", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "yo", "zu"]; + export default () => { - const langListText = browser.i18n.getMessage("langList"); - const langList = langListText.split(", "); - const langOptions = langList.map(lang => ({ - value: lang.split(":")[0], - name: lang.split(":")[1] + const langOptions = langListGoogle.map(lang => ({ + value: lang, + name: browser.i18n.getMessage("lang_" + lang) })); langOptions.sort(alphabeticallySort); return langOptions;