diff options
author | elijah <elijah@riseup.net> | 2016-09-27 12:16:43 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-09-29 11:57:53 -0700 |
commit | dfe5598c5d1d877d2c23bdb002e89eac869f9613 (patch) | |
tree | b57da9708d4eb9479ed1aa2f17fd9f803a36939c /ui/app/lib | |
parent | 372b6cfc13494b95028d4ec531b842685ecf370a (diff) |
[bug] Display language and services correctly in provider wizard
Diffstat (limited to 'ui/app/lib')
-rw-r--r-- | ui/app/lib/language.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/ui/app/lib/language.js b/ui/app/lib/language.js new file mode 100644 index 0000000..17e00fd --- /dev/null +++ b/ui/app/lib/language.js @@ -0,0 +1,60 @@ +// +// Language data, sorted by number of native speakers +// https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers +// fields: code, name, english name, right to left? +// + +const DATA = { + zh: ['zh', '中文', 'Chinese'], + es: ['es', 'Español', 'Spanish'], + en: ['en', 'English'], + hi: ['hi', 'हिन्दी', 'Hindi'], + ar: ['ar', 'العربية', 'Arabic', true], + pt: ['pt', 'Português', 'Portugues'], + bn: ['bn', 'বাংলা', 'Bengali'], + ru: ['ru', 'Pyccĸий', 'Russian'], + ja: ['ja', '日本語', 'Japanese'], + pa: ['pa', 'ਪੰਜਾਬੀ', 'Punjabi'], + de: ['de', 'Deutsch', 'German'], + ms: ['ms', 'بهاس ملايو', 'Malay'], + te: ['te', 'తెలుగు', 'Telugu'], + vi: ['vi', 'Tiếng Việt', 'Vietnamese'], + ko: ['ko', '한국어', 'Korean'], + fr: ['fr', 'Français', 'French'], + mr: ['mr', 'मराठी', 'Marathi'], + ta: ['ta', 'தமிழ்', 'Tamil'], + ur: ['ur', 'اُردُو', 'Urdu'], + fa: ['fa', 'فارسی', 'Farsi'], + tr: ['tr', 'Türkçe', 'Turkish'], + it: ['it', 'Italiano', 'Italian'], + th: ['th', 'ภาษาไทย', 'Thai'], + gu: ['gu', 'Gujarati'], + pl: ['pl', 'Polski', 'Polish'], + ml: ['ml', 'Malayalam'], + uk: ['uk', 'Ukrainian'], + sw: ['sw', 'Swahili'], + uz: ['uz', 'Uzbek'], + ro: ['ro', 'Romanian'], + nl: ['nl', 'Nederlands', 'Dutch'], + sr: ['sr', 'Serbian'], + el: ['el', 'Ελληνικά', 'Greek'], + ca: ['ca', 'Català', 'Catalan'], + he: ['he', 'עברית', 'Hebrew', true], + sl: ['sl', 'Slovenščina', 'Slovenian'], + lt: ['lt', 'Lietuvių kalba', 'Lithuanian'] +} + +export default class Language { + + constructor(data_entry) { + this.code = data_entry[0] || 'xx' + this.name = data_entry[1] || '????' + this.en_name = data_entry[2] || '????' + this.rtl = data_entry[3] + } + + static find(code) { + return new Language(DATA[code]) + } + +} |