瀏覽代碼

feat(lang) add upper sorbian to transcription languages

* fix showing transcripts for country codes longer than 2 characters
factor2
zobadaniel 1 年之前
父節點
當前提交
d49a419284
沒有連結到貢獻者的電子郵件帳戶。

+ 1
- 0
lang/translation-languages.json 查看文件

34
     "hi": "Hindi",
34
     "hi": "Hindi",
35
     "hmn": "Hmong",
35
     "hmn": "Hmong",
36
     "hr": "Croatian",
36
     "hr": "Croatian",
37
+    "hsb": "Upper Sorbian",
37
     "ht": "Haitian Creole",
38
     "ht": "Haitian Creole",
38
     "hu": "Hungarian",
39
     "hu": "Hungarian",
39
     "hy": "Armenian",
40
     "hy": "Armenian",

+ 5
- 2
react/features/subtitles/middleware.ts 查看文件

172
             }
172
             }
173
         }
173
         }
174
 
174
 
175
-        // If the suer is not requesting transcriptions just bail.
176
-        if (json.language.slice(0, 2) !== language) {
175
+        // If the user is not requesting transcriptions just bail.
176
+        // Regex to filter out all possible country codes after language code:
177
+        // this should catch all notations like 'en-GB' 'en_GB' and 'enGB'
178
+        // and be independent of the country code length
179
+        if (json.language.replace(/[-_A-Z].*/, '') !== language) {
177
             return next(action);
180
             return next(action);
178
         }
181
         }
179
 
182
 

+ 1
- 0
react/features/transcribing/jitsi-bcp47-map.json 查看文件

20
     "hi": "hi-IN",
20
     "hi": "hi-IN",
21
     "mr": "mr-IN",
21
     "mr": "mr-IN",
22
     "hr": "hr-HR",
22
     "hr": "hr-HR",
23
+    "hsb": "hsb-DE",
23
     "hu": "hu-HU",
24
     "hu": "hu-HU",
24
     "hy": "hy-AM",
25
     "hy": "hy-AM",
25
     "id": "id-ID",
26
     "id": "id-ID",

+ 1
- 0
react/features/transcribing/transcriber-langs.json 查看文件

45
     "is-IS": "Icelandic (Iceland)",
45
     "is-IS": "Icelandic (Iceland)",
46
     "it-IT": "Italian (Italy)",
46
     "it-IT": "Italian (Italy)",
47
     "lt-LT": "Lithuanian (Lithuania)",
47
     "lt-LT": "Lithuanian (Lithuania)",
48
+    "hsb-DE": "Upper Sorbian (Germany)",
48
     "hu-HU": "Hungarian (Hungary)",
49
     "hu-HU": "Hungarian (Hungary)",
49
     "nl-NL": "Dutch (Netherlands)",
50
     "nl-NL": "Dutch (Netherlands)",
50
     "no-NO": "Norwegian Bokmål (Norway)",
51
     "no-NO": "Norwegian Bokmål (Norway)",

Loading…
取消
儲存