Skip to content

Commit

Permalink
Update: Adding more languages for subtitles (#130)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
bhh1988 authored May 23, 2017
1 parent fb1fdd0 commit b55988c
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 1 deletion.
51 changes: 51 additions & 0 deletions src/i18n/en-US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
113 changes: 112 additions & 1 deletion src/lib/lang.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,155 @@
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'),
nl: __('dutch'),
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')
};

/**
Expand Down

0 comments on commit b55988c

Please sign in to comment.