From b55988caf166265f4285736c8bdebb807fe9871e Mon Sep 17 00:00:00 2001 From: bhh1988 Date: Mon, 22 May 2017 17:08:59 -0700 Subject: [PATCH] Update: Adding more languages for subtitles (#130) This commit adds more subtitle languages. Before we were limiting ourselves to the official list of Box supported languages, but really that should only apply to translations of the languages (i.e. the set of properties files we have). If a video has a subtitle in it with a particular language that we don't officially support, there's no reason to give a degraded experience - all we need to do is maintain a language-code mapping for that language, and we don't need to even translate anything into that language (just translate the language name into our officially supported languages). --- src/i18n/en-US.properties | 51 +++++++++++++++++ src/lib/lang.js | 113 +++++++++++++++++++++++++++++++++++++- 2 files changed, 163 insertions(+), 1 deletion(-) diff --git a/src/i18n/en-US.properties b/src/i18n/en-US.properties index a65189b04..dfa2bcca6 100644 --- a/src/i18n/en-US.properties +++ b/src/i18n/en-US.properties @@ -152,21 +152,72 @@ notification_annotation_mode=Click anywhere to add a comment to the document 3d_models=3D models # Languages +afrikaans=Afrikaans +albanian=Albanian +arabic=Arabic +armenian=Armenian +belarusian=Belarusian +bengali=Bengali +bosnian=Bosnian +bulgarian=Bulgarian +burmese=Burmese +catalan=Catalan +central_khmer=Central Khmer chinese=Chinese +croatian=Croatian +czech=Czech danish=Danish dutch=Dutch english=English +estonian=Estonian +filipino=Filipino finnish=Finnish french=French +galician=Galician +ganda=Ganda +georgian=Georgian german=German +haitian_creole=Haitian Creole hebrew=Hebrew +hindi=Hindi +hmong=Hmong +hungarian=Hungarian +icelandic=Icelandic +indonesian=Indonesian +irish=Irish italian=Italian japanese=Japanese +kazakh=Kazakh korean=Korean +kurdish=Kurdish +lao=Lao +latvian=Latvian +lithuanian=Lithuanian +luxembourgish=Luxembourgish +malay_macrolanguage=Malay +modern_greek_1453_=Greek +mongolian=Mongolian norwegian=Norwegian +persian=Persian polish=Polish portuguese=Portuguese +romanian=Romanian russian=Russian +serbian=Serbian +sichuan_yi=Sichuan Yi +sicilian=Sicilian +slovak=Slovak +slovenian=Slovenian +somali=Somali spanish=Spanish +swahili_macrolanguage=Swahili swedish=Swedish +swiss_german=Swiss German +tagalog=Tagalog +telugu=Telugu +thai=Thai +tibetan=Tibetan turkish=Turkish +ukrainian=Ukrainian +uzbek=Uzbek +vietnamese=Vietnamese diff --git a/src/lib/lang.js b/src/lib/lang.js index ed0807a9b..ee4229a29 100644 --- a/src/lib/lang.js +++ b/src/lib/lang.js @@ -1,7 +1,37 @@ const languageMap = { + af: __('afrikaans'), + afr: __('afrikaans'), + alb: __('albanian'), + sq: __('albanian'), + sqi: __('albanian'), + ar: __('arabic'), + ara: __('arabic'), + arm: __('armenian'), + hy: __('armenian'), + hye: __('armenian'), + be: __('belarusian'), + bel: __('belarusian'), + ben: __('bengali'), + bn: __('bengali'), + bos: __('bosnian'), + bs: __('bosnian'), + bg: __('bulgarian'), + bul: __('bulgarian'), + bur: __('burmese'), + my: __('burmese'), + mya: __('burmese'), + ca: __('catalan'), + cat: __('catalan'), + khm: __('central_khmer'), + km: __('central_khmer'), chi: __('chinese'), zh: __('chinese'), zho: __('chinese'), + hr: __('croatian'), + hrv: __('croatian'), + ces: __('czech'), + cs: __('czech'), + cze: __('czech'), da: __('danish'), dan: __('danish'), dut: __('dutch'), @@ -9,36 +39,117 @@ const languageMap = { nld: __('dutch'), en: __('english'), eng: __('english'), + est: __('estonian'), + et: __('estonian'), + fil: __('filipino'), fi: __('finnish'), fin: __('finnish'), fr: __('french'), fra: __('french'), fre: __('french'), + gl: __('galician'), + glg: __('galician'), + lg: __('ganda'), + lug: __('ganda'), + geo: __('georgian'), + ka: __('georgian'), + kat: __('georgian'), de: __('german'), deu: __('german'), ger: __('german'), + hat: __('haitian_creole'), + ht: __('haitian_creole'), he: __('hebrew'), heb: __('hebrew'), + hi: __('hindi'), + hin: __('hindi'), + hmn: __('hmong'), + hu: __('hungarian'), + hun: __('hungarian'), + ice: __('icelandic'), + is: __('icelandic'), + isl: __('icelandic'), + id: __('indonesian'), + ind: __('indonesian'), + ga: __('irish'), + gle: __('irish'), it: __('italian'), ita: __('italian'), ja: __('japanese'), jpn: __('japanese'), + kaz: __('kazakh'), + kk: __('kazakh'), ko: __('korean'), kor: __('korean'), + ku: __('kurdish'), + kur: __('kurdish'), + lao: __('lao'), + lo: __('lao'), + lav: __('latvian'), + lv: __('latvian'), + lit: __('lithuanian'), + lt: __('lithuanian'), + lb: __('luxembourgish'), + ltz: __('luxembourgish'), + may: __('malay_macrolanguage'), + ms: __('malay_macrolanguage'), + msa: __('malay_macrolanguage'), + el: __('modern_greek_1453_'), + ell: __('modern_greek_1453_'), + gre: __('modern_greek_1453_'), + mn: __('mongolian'), + mon: __('mongolian'), no: __('norwegian'), nor: __('norwegian'), + fa: __('persian'), + fas: __('persian'), + per: __('persian'), pl: __('polish'), pol: __('polish'), por: __('portuguese'), pt: __('portuguese'), + ro: __('romanian'), + ron: __('romanian'), + rum: __('romanian'), ru: __('russian'), rus: __('russian'), + scc: __('serbian'), + sr: __('serbian'), + srp: __('serbian'), + ii: __('sichuan_yi'), + iii: __('sichuan_yi'), + scn: __('sicilian'), + sk: __('slovak'), + slk: __('slovak'), + slo: __('slovak'), + sl: __('slovenian'), + slv: __('slovenian'), + so: __('somali'), + som: __('somali'), es: __('spanish'), spa: __('spanish'), + sw: __('swahili_macrolanguage'), + swa: __('swahili_macrolanguage'), sv: __('swedish'), swe: __('swedish'), + gsw: __('swiss_german'), + tgl: __('tagalog'), + tl: __('tagalog'), + te: __('telugu'), + tel: __('telugu'), + th: __('thai'), + tha: __('thai'), + bo: __('tibetan'), + bod: __('tibetan'), + tib: __('tibetan'), tr: __('turkish'), - tur: __('turkish') + tur: __('turkish'), + uk: __('ukrainian'), + ukr: __('ukrainian'), + uz: __('uzbek'), + uzb: __('uzbek'), + vi: __('vietnamese'), + vie: __('vietnamese') }; /**