stremiok 2.3.4 → 2.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +1 -0
  3. package/config.xml +1 -1
  4. package/css/style.css +5 -0
  5. package/index.html +42 -40
  6. package/js/app.js +3 -3
  7. package/js/downloads.js +16 -16
  8. package/js/epg.js +2 -3
  9. package/js/hubpreview.js +1 -1
  10. package/js/i18n.js +108 -0
  11. package/js/iptv.js +13 -13
  12. package/js/jellyfin.js +19 -19
  13. package/js/lang/ar.js +1941 -0
  14. package/js/lang/de.js +1941 -0
  15. package/js/lang/es.js +1941 -0
  16. package/js/lang/fi.js +1941 -0
  17. package/js/lang/fr.js +1941 -0
  18. package/js/lang/he.js +1941 -0
  19. package/js/lang/hi.js +1941 -0
  20. package/js/lang/it.js +1941 -0
  21. package/js/lang/ja.js +1941 -0
  22. package/js/lang/ko.js +1941 -0
  23. package/js/lang/languages.js +21 -0
  24. package/js/lang/pl.js +1941 -0
  25. package/js/lang/pt-BR.js +1941 -0
  26. package/js/lang/ru.js +1941 -0
  27. package/js/lang/tr.js +1941 -0
  28. package/js/lang/zh-CN.js +1941 -0
  29. package/js/local.js +9 -9
  30. package/js/netfolders.js +13 -13
  31. package/js/player-audio.js +17 -17
  32. package/js/player-controls.js +100 -100
  33. package/js/player-core.js +59 -57
  34. package/js/player-lang.js +22 -22
  35. package/js/player-quality.js +15 -15
  36. package/js/player-store.js +13 -13
  37. package/js/player-subs.js +69 -69
  38. package/js/plex.js +11 -11
  39. package/js/stremio-account.js +8 -8
  40. package/js/stremio-sync.js +5 -5
  41. package/js/stremio.js +78 -76
  42. package/js/stvod.js +4 -4
  43. package/js/trakt.js +23 -23
  44. package/js/tvapps.js +4 -4
  45. package/js/util.js +38 -26
  46. package/js/view-core.js +93 -93
  47. package/js/view-detail.js +124 -126
  48. package/js/view-discover.js +27 -27
  49. package/js/view-guide.js +13 -13
  50. package/js/view-home.js +124 -118
  51. package/js/view-search.js +25 -25
  52. package/js/view-settings.js +658 -642
  53. package/js/xtvod.js +2 -2
  54. package/js/youtube.js +17 -17
  55. package/js/ytplay.js +11 -6
  56. package/package.json +1 -1
  57. package/tizenbrew.html +1 -1
package/js/player-core.js CHANGED
@@ -148,7 +148,7 @@ var PlayerParts = {};
148
148
  applyAspect(true);
149
149
  } catch (e) {
150
150
  U.log('player', 'The TV\'s player couldn\'t be restored after the background: opening the stream again');
151
- reopen('Opening the stream again…');
151
+ reopen(U.t('Opening the stream again…'));
152
152
  return;
153
153
  }
154
154
  }
@@ -230,7 +230,7 @@ var PlayerParts = {};
230
230
  }
231
231
  function chapterLabel(i) {
232
232
  var list = chapters(), c = list[i];
233
- return c ? (i + 1) + '/' + list.length + ' · ' + (c.title || 'Chapter ' + (i + 1)) : '';
233
+ return c ? (i + 1) + '/' + list.length + ' · ' + (c.title || U.t('Chapter {n}', { n: i + 1 })) : '';
234
234
  }
235
235
  // A gap in the bar where each chapter starts (but the first), as on YouTube; redrawn
236
236
  // only when the chapters or the length change.
@@ -332,12 +332,12 @@ var PlayerParts = {};
332
332
  var t = Date.now() / 1000;
333
333
  U.byId('osd-bar').style.display = '';
334
334
  U.byId('osd-progress').style.width = Math.max(0, Math.min(100, Math.round((t - g.now.start) / (g.now.stop - g.now.start) * 100))) + '%';
335
- cur.textContent = '● LIVE ' + clock(g.now.start) + '–' + clock(g.now.stop) + ' ' + g.now.title;
336
- U.byId('osd-dur').textContent = g.next ? 'Next ' + clock(g.next.start) + ' ' + g.next.title : '';
335
+ cur.textContent = '● ' + U.t('LIVE') + ' ' + clock(g.now.start) + '–' + clock(g.now.stop) + ' ' + g.now.title;
336
+ U.byId('osd-dur').textContent = g.next ? U.t('Next') + ' ' + clock(g.next.start) + ' ' + g.next.title : '';
337
337
  return;
338
338
  }
339
339
  U.byId('osd-bar').style.display = 'none';
340
- cur.textContent = '● LIVE';
340
+ cur.textContent = U.t('● LIVE');
341
341
  U.byId('osd-dur').textContent = '';
342
342
  return;
343
343
  }
@@ -391,7 +391,7 @@ var PlayerParts = {};
391
391
  Object.keys(old).forEach(function (k) { if (!/^_(relay|relayFor|relayCc|ccOffer|liveChecked)$/.test(k)) { ctx[k] = old[k]; } });
392
392
  ctx.switching = true;
393
393
  play(ctx, _onExit);
394
- U.spinner(true, 'Opening it as ' + (fmt === 'hls' ? 'HLS' : 'MPEG-TS') + '…');
394
+ U.spinner(true, U.t('Opening it as {format}…', { format: fmt === 'hls' ? 'HLS' : 'MPEG-TS' }));
395
395
  }
396
396
  P.liveFormat = function () { return S.active && S.ctx && S.isLive && S.ctx._ownUrl ? liveFormat(S.ctx.url) : ''; };
397
397
  P.setLiveFormat = setLiveFormat;
@@ -436,7 +436,7 @@ var PlayerParts = {};
436
436
  // (private viewing, a link played as it is, or one started from a private playback —
437
437
  // a video followed from it, another source: nothing recorded, see player-store)
438
438
  ctx.private = !ctx.trailer && (ctx.private === true || !!ctx.link || isPrivate());
439
- if (ctx.private && !ctx.switching) { U.toast('Private viewing: not tracked', 2500); }
439
+ if (ctx.private && !ctx.switching) { U.toast(U.t('Private viewing: not tracked'), 2500); }
440
440
  if (_exitTimer) { clearTimeout(_exitTimer); _exitTimer = null; }
441
441
  if (U.crumb) { U.crumb('play ' + (ctx.type || '') + ' ' + (ctx.private ? '(private)' : /^file:/i.test(ctx.url || '') ? 'file .' + ('' + ctx.url).split('.').pop() : ('' + (ctx.url || '')).replace(/^https?:\/\/([^\/?#]+).*$/i, '$1'))); } // (Diagnostics, after an unexpected close)
442
442
  S.active = true; S.cur = 0; S.dur = 0; _bg = null; S.actual = null;
@@ -450,7 +450,7 @@ var PlayerParts = {};
450
450
  var jfAt = Jellyfin.resumeFor(ctx.stream._jf, P.progressFor ? P.progressFor(ctx.type, ctx.id) : null, S.ctx.resumeSec);
451
451
  if (jfAt !== S.ctx.resumeSec) {
452
452
  S.ctx.resumeSec = jfAt;
453
- if (jfAt > 5) { U.toast('Carrying on from where ' + (Jellyfin.sourceKind ? Jellyfin.sourceKind(ctx.stream._jf) : 'Jellyfin') + ' had it: ' + U.fmtTime(jfAt), 3500); }
453
+ if (jfAt > 5) { U.toast(U.t('Carrying on from where {server} had it: {at}', { server: Jellyfin.sourceKind ? Jellyfin.sourceKind(ctx.stream._jf) : 'Jellyfin', at: U.fmtTime(jfAt) }), 3500); }
454
454
  }
455
455
  }
456
456
 
@@ -470,7 +470,7 @@ var PlayerParts = {};
470
470
  document.body.style.background = 'transparent';
471
471
  showOSD(true);
472
472
  renderOSD(); // show the NEW title immediately (not the previous item's)
473
- U.spinner(true, ctx.switching ? 'Switching source…' : ctx.initialQualityHeight ? 'Opening stream at ' + ctx.initialQualityHeight + 'p…' : 'Opening stream…');
473
+ U.spinner(true, ctx.switching ? U.t('Switching source…') : ctx.initialQualityHeight ? U.t('Opening stream at {height}p…', { height: ctx.initialQualityHeight }) : U.t('Opening stream…'));
474
474
 
475
475
  engineFor(ctx); // (the TV's player, or a ClearKey channel's own: see startShaka)
476
476
  // (a TorrServer torrent that doesn't say which of its files: its file list asked for first)
@@ -480,13 +480,13 @@ var PlayerParts = {};
480
480
  ++_playToken; _openedAt = 0;
481
481
  if (useAV) { try { avplay.stop(); } catch (e0) {} try { avplay.close(); } catch (e1) {} }
482
482
  else if (S.videoEl) { try { S.videoEl.pause(); S.videoEl.removeAttribute('src'); } catch (e2) {} }
483
- U.spinner(true, 'Asking your streaming server for the torrent’s files…');
483
+ U.spinner(true, U.t('Asking your streaming server for the torrent’s files…'));
484
484
  var ep = /:(\d+):(\d+)$/.exec(ctx.id || ''), look = _fileLook = U.cancelToken();
485
485
  Stremio.torrentFile(ctx.stream, ep ? +ep[1] : 0, ep ? +ep[2] : 0, look).then(function (url) {
486
486
  if (look.cancelled || S.ctx !== ctx || !S.active) { return; }
487
487
  _fileLook = null;
488
488
  if (url) { ctx.url = url; go(); return; }
489
- var why = 'The torrent has no file for S' + ep[1] + 'E' + ep[2]; // (another episode isn't played in its place)
489
+ var why = U.t('The torrent has no file for {ep}', { ep: 'S' + ep[1] + 'E' + ep[2] }); // (another episode isn't played in its place)
490
490
  U.log('player', why);
491
491
  U.spinner(false);
492
492
  if (nextSourceOnFail({ text: why })) { return; }
@@ -523,7 +523,7 @@ var PlayerParts = {};
523
523
  .filter(function (g) { return g.mode !== 'off'; });
524
524
  S.sponsor = segs;
525
525
  var whole = segs.filter(function (g) { return g.action === 'full'; })[0];
526
- if (whole) { U.toast('SponsorBlock: this whole video is marked “' + YouTube.SB_NAMES[whole.cat] + '”', 5000); }
526
+ if (whole) { U.toast(U.t('SponsorBlock: this whole video is marked “{what}”', { what: YouTube.SB_NAMES[whole.cat] }), 5000); }
527
527
  if (!osdHidden()) { renderOSD(); }
528
528
  }, function () {});
529
529
  }
@@ -592,8 +592,8 @@ var PlayerParts = {};
592
592
  }
593
593
 
594
594
  function updateHint() {
595
- var base = S.isLive ? 'OK: Play/Pause' : 'OK: Play/Pause ←/→: Seek';
596
- base += ' UP: Controls DOWN: Menu RETURN: Back';
595
+ var base = S.isLive ? U.t('OK: Play/Pause') : U.t('OK: Play/Pause ←/→: Seek');
596
+ base += ' ' + U.t('UP: Controls DOWN: Menu RETURN: Back');
597
597
  var h = U.byId('osd-hint');
598
598
  if (h) { h.textContent = base; }
599
599
  }
@@ -698,7 +698,7 @@ var PlayerParts = {};
698
698
  function drmEvent(drm, data, token) {
699
699
  if (!drm || drm.sys !== 'widevine' || !data || data.name !== 'Challenge' || !data.challenge) { return; }
700
700
  var ctx = S.ctx;
701
- if (typeof YTPlay === 'undefined' || !YTPlay.drmLicense) { ctx._drmWhy = 'StremioK’s service isn’t there'; return; }
701
+ if (typeof YTPlay === 'undefined' || !YTPlay.drmLicense) { ctx._drmWhy = U.t('StremioK’s service isn’t there'); return; }
702
702
  YTPlay.drmLicense(drm.url, drm.h, data.challenge, drm.b64).then(function (r) {
703
703
  if (!S.active || token !== _playToken) { return; }
704
704
  if (!r || !r.license) { throw new Error((r && r.why) || 'no answer'); }
@@ -709,14 +709,14 @@ var PlayerParts = {};
709
709
  U.log('player', 'DRM: no license for this channel (' + ctx._drmWhy + ')');
710
710
  });
711
711
  }
712
- function drmName(d) { return { clearkey: 'ClearKey', widevine: 'Widevine', playready: 'PlayReady' }[d.sys] || 'its DRM'; }
712
+ function drmName(d) { return { clearkey: 'ClearKey', widevine: 'Widevine', playready: 'PlayReady' }[d.sys] || U.t('its DRM'); }
713
713
  var BUFFERS = { more: [8, 10], most: [15, 20] };
714
714
  function openAV(url, token) {
715
715
  var drm = S.ctx && S.ctx.stream && S.ctx.stream._drm;
716
716
  if (drm && !drm.ok) { // (ClearKey, or a license StremioK can't ask for)
717
717
  U.log('player', 'Not played: ' + drmName(drm) + (drm.sys === 'clearkey' ? '' : ' without a license server StremioK can use') + ' (' + where(url) + ')');
718
718
  U.spinner(false);
719
- failedStart(drm.sys === 'clearkey' ? 'This ClearKey channel’s keys can’t be read (its playlist’s #KODIPROP lines)' : 'This channel’s DRM can’t be played on the TV (' + drmName(drm) + ')');
719
+ failedStart(drm.sys === 'clearkey' ? U.t('This ClearKey channel’s keys can’t be read (its playlist’s #KODIPROP lines)') : U.t('This channel’s DRM can’t be played on the TV ({drm})', { drm: drmName(drm) }));
720
720
  return;
721
721
  }
722
722
  try {
@@ -741,7 +741,7 @@ var PlayerParts = {};
741
741
  avplay.setListener({
742
742
  onbufferingstart: function () {
743
743
  if (!S.active || token !== _playToken) { return; }
744
- S.buffering = true; U.spinner(true, S.playStarted ? 'Buffering…' : undefined);
744
+ S.buffering = true; U.spinner(true, S.playStarted ? U.t('Buffering…') : undefined);
745
745
  },
746
746
  onbufferingcomplete: function () {
747
747
  if (!S.active || token !== _playToken) { return; }
@@ -789,13 +789,13 @@ var PlayerParts = {};
789
789
  // A live channel that played: its connection dropped → opened again (liveDropped).
790
790
  if (S.playing && liveReconnects()) { U.log('player', 'Playback error: ' + err + ' (' + where(S.ctx.url) + ')'); liveDropped('Connection lost'); return; }
791
791
  // A reconnect's try that didn't play → the next try.
792
- if (!S.playing && _reco.tries) { if (!relayFailed()) { liveDropped('Couldn’t reconnect'); } return; }
792
+ if (!S.playing && _reco.tries) { if (!relayFailed()) { liveDropped(U.t('Couldn’t reconnect')); } return; }
793
793
  // Failed before it ever played (opened, maybe, but nothing shown) → retry / step down / Auto.
794
794
  if (!S.playing && (relayFailed() || tryFallback())) { return; }
795
795
  reportStart(false, err); // (unless it had already played)
796
796
  U.log('player', 'Playback error: ' + err + ' (' + where(S.ctx && S.ctx.url) + ')');
797
- if (!S.playing) { failedStart('Playback error: ' + err); return; }
798
- U.toast('Playback error: ' + err);
797
+ if (!S.playing) { failedStart(U.t('Playback error: {why}', { why: err })); return; }
798
+ U.toast(U.t('Playback error: {why}', { why: err }));
799
799
  exitLater();
800
800
  }
801
801
  });
@@ -830,17 +830,17 @@ var PlayerParts = {};
830
830
  if (!S.active || token !== _playToken) { return; }
831
831
  U.spinner(false);
832
832
  if (relayFailed()) { return; }
833
- if (_reco.tries) { liveDropped('Couldn’t reconnect'); return; } // (a reconnect's try: the next one)
833
+ if (_reco.tries) { liveDropped(U.t('Couldn’t reconnect')); return; } // (a reconnect's try: the next one)
834
834
  // Prepare failed → retry / step down / Auto.
835
835
  if (tryFallback()) { return; }
836
836
  U.log('player', 'Could not open: ' + (err && (err.name || err.message || err)) + ' (' + where(url) + ')');
837
837
  reportStart(false, err && (err.name || err.message || err));
838
- failedStart(S.ctx && S.ctx._drmWhy ? 'No license for this channel: ' + S.ctx._drmWhy : 'Could not open stream');
838
+ failedStart(S.ctx && S.ctx._drmWhy ? U.t('No license for this channel: {why}', { why: S.ctx._drmWhy }) : U.t('Could not open stream'));
839
839
  });
840
840
  } catch (e) {
841
841
  U.log('player', 'AVPlay failed: ' + (e && e.message));
842
842
  reportStart(false, e && e.message);
843
- U.spinner(false); U.toast('AVPlay failed: ' + e.message); exitLater();
843
+ U.spinner(false); U.toast(U.t('AVPlay failed: {why}', { why: e.message })); exitLater();
844
844
  }
845
845
  }
846
846
  // What a log entry names: the link, or, playing privately, nothing that says what.
@@ -922,7 +922,7 @@ var PlayerParts = {};
922
922
  function shakaLoadInto(url, drm, token, fail) {
923
923
  loadShaka().then(function () {
924
924
  if (!S.active || token !== _playToken) { return; }
925
- if (typeof shaka === 'undefined' || !shaka.Player.isBrowserSupported()) { throw new Error('this TV’s browser can’t play it'); }
925
+ if (typeof shaka === 'undefined' || !shaka.Player.isBrowserSupported()) { throw new Error(U.t('this TV’s browser can’t play it')); }
926
926
  return shakaStop().then(function () {
927
927
  if (!S.active || token !== _playToken) { return; }
928
928
  var pl = _shakaPl = new shaka.Player(), cfg = { streaming: { bufferingGoal: 10 } };
@@ -944,7 +944,7 @@ var PlayerParts = {};
944
944
  });
945
945
  }).then(null, function (e) { if (S.active && token === _playToken) { fail(shakaWhy(e)); } });
946
946
  }
947
- function shakaWhy(e) { return e && e.code ? 'Shaka error ' + e.code : (e && e.message) || 'it didn’t start'; }
947
+ function shakaWhy(e) { return e && e.code ? U.t('Shaka error {code}', { code: e.code }) : (e && e.message) || U.t('it didn’t start'); }
948
948
  var HTML5_START_MS = 20000;
949
949
  function startHTML5(url) {
950
950
  url = opened(url);
@@ -956,7 +956,7 @@ var PlayerParts = {};
956
956
  reportStart(false, 'TIMEOUT');
957
957
  U.spinner(false);
958
958
  if (!drm) { U.log('player', 'Not played (the page’s video player): no start in ' + Math.round(HTML5_START_MS / 1000) + ' s (' + where(url) + ')'); }
959
- U.toast('This stream didn\'t start'); exitLater();
959
+ U.toast(U.t('This stream didn\'t start')); exitLater();
960
960
  }, drm ? SHAKA_START_MS : HTML5_START_MS);
961
961
  S.videoEl.onloadedmetadata = function () {
962
962
  if (!S.active || token !== _playToken) { return; }
@@ -984,14 +984,14 @@ var PlayerParts = {};
984
984
  // (the page's player says little: its code, and a message where the engine has one)
985
985
  U.log('player', (loaded ? 'Stopped' : 'Not played') + ' (the page’s video player): ' + (['', 'aborted', 'a network error', 'the file couldn’t be decoded', 'a format or link it can’t play'][mcode] || 'an error') +
986
986
  (me && me.message ? ' (' + me.message + ')' : '') + ' (' + where(url) + ')');
987
- U.toast('Playback error'); exitLater();
987
+ U.toast(U.t('Playback error')); exitLater();
988
988
  };
989
989
  if (drm) {
990
990
  shakaLoadInto(url, drm, token, function (why) {
991
991
  if (loaded) { U.log('player', 'ClearKey channel: ' + why); U.toast('Playback error: ' + why); exitLater(); return; }
992
992
  U.log('player', 'ClearKey channel didn’t play (' + why + ')');
993
993
  U.spinner(false);
994
- failedStart('This ClearKey channel didn’t play (' + why + ')');
994
+ failedStart(U.t('This ClearKey channel didn’t play ({why})', { why: why }));
995
995
  });
996
996
  } else {
997
997
  var p = S.videoEl.play();
@@ -1020,9 +1020,9 @@ var PlayerParts = {};
1020
1020
  }
1021
1021
  function onEnded() {
1022
1022
  // a live channel whose stream ended (its server stopped it): opened again (liveDropped)
1023
- if (liveReconnects()) { liveDropped('The stream ended'); return; }
1023
+ if (liveReconnects()) { liveDropped(U.t('The stream ended')); return; }
1024
1024
  if (isNotice()) { // (back to its sources: another one, or this one later)
1025
- U.toast('That source isn\'t ready yet (the debrid service is still getting it): try another, or this one later', 6000);
1025
+ U.toast(U.t('That source isn\'t ready yet (the debrid service is still getting it): try another, or this one later'), 6000);
1026
1026
  exit();
1027
1027
  return;
1028
1028
  }
@@ -1110,9 +1110,9 @@ var PlayerParts = {};
1110
1110
  var name = YouTube.SB_NAMES[g.cat] || 'section';
1111
1111
  if (g.mode === 'skip') {
1112
1112
  seekTo(g.end);
1113
- U.toast('Skipped: ' + name + ' (' + U.fmtTime(g.end - g.start) + ')', 3000);
1113
+ U.toast(U.t('Skipped: {what} ({length})', { what: name, length: U.fmtTime(g.end - g.start) }), 3000);
1114
1114
  } else {
1115
- showSkip('sb', { end: g.end, label: 'Skip ' + name });
1115
+ showSkip('sb', { end: g.end, label: U.t('Skip {what}', { what: name }) });
1116
1116
  }
1117
1117
  return;
1118
1118
  }
@@ -1183,7 +1183,7 @@ var PlayerParts = {};
1183
1183
  }
1184
1184
 
1185
1185
  function seekTo(sec) {
1186
- if (S.isLive) { showOSD(false); U.toast('Live — seeking unavailable', 1500); return; }
1186
+ if (S.isLive) { showOSD(false); U.toast(U.t('Live — seeking unavailable'), 1500); return; }
1187
1187
  // keep a small margin from the very end (seeking to EOF can error)
1188
1188
  var maxT = S.dur ? Math.max(0, S.dur - 2) : 1e9;
1189
1189
  var target = Math.max(0, Math.min(maxT, sec));
@@ -1256,7 +1256,8 @@ var PlayerParts = {};
1256
1256
  try { n = c.nextSource(tried, c._avoid || []); } catch (e) { n = null; }
1257
1257
  if (!n || !n.source || !n.source.url) { return false; }
1258
1258
  c._tried = tried; // (kept by the next one: not a source's own field)
1259
- var msg = (notice ? notice.text + ' · trying' : 'Didn’t start: trying') + ' the next source (' + (tried.length + 1) + ' of ' + Math.min(n.total, NEXT_TRIES + 1) + ')…';
1259
+ var next = { n: tried.length + 1, of: Math.min(n.total, NEXT_TRIES + 1) };
1260
+ var msg = notice ? notice.text + ' · ' + U.t('trying the next source ({n} of {of})…', next) : U.t('Didn’t start: trying the next source ({n} of {of})…', next);
1260
1261
  U.log('player', 'Source didn’t start: trying the next one (' + (tried.length + 1) + ')');
1261
1262
  replaceSource(n.source, true);
1262
1263
  U.spinner(true, msg); U.toast(msg, notice ? 7000 : 4000);
@@ -1271,7 +1272,7 @@ var PlayerParts = {};
1271
1272
  var u = (typeof Stremio !== 'undefined' && Stremio.convertUrl) ? Stremio.convertUrl(c.url) : null;
1272
1273
  if (!u) { return false; }
1273
1274
  c._converted = true; c._convertedFrom = c.url; // (kept by what replaces it: Continue Watching saves its own link)
1274
- var msg = 'Didn’t start: converting it on your streaming server…';
1275
+ var msg = U.t('Didn’t start: converting it on your streaming server…');
1275
1276
  U.log('player', 'Source didn’t start: converting it on the streaming server');
1276
1277
  replaceSource({ url: u, stream: c.stream, subExtra: c.subExtra, sourceSubs: c.sourceSubs, localSubs: c.localSubs, converted: true }, true);
1277
1278
  U.spinner(true, msg); U.toast(msg, 5000);
@@ -1318,13 +1319,14 @@ var PlayerParts = {};
1318
1319
  }
1319
1320
  function describeNotice(kind, st) {
1320
1321
  var d = (typeof Stremio !== 'undefined' && Stremio.debridOf) ? Stremio.debridOf(st) : null;
1321
- var svc = d ? d.name : 'The debrid service', addon = st._addon || 'the addon', key = d ? d.name + ' key' : 'debrid key';
1322
+ var svc = d ? d.name : U.t('The debrid service'), addon = st._addon || U.t('the addon'), key = d ? U.t('{service} key', { service: d.name }) : U.t('debrid key');
1322
1323
  var n = { kind: kind, service: d ? d.name : '', tag: d ? d.tag : '', account: false, text: '' };
1323
- if (/access|auth|unauthorized|forbidden|premium/.test(kind)) { n.account = true; n.text = svc + ' refused access (' + addon + '): check its ' + key + ' in the addon’s settings'; }
1324
- else if (/limit|too_many|exceeded/.test(kind)) { n.account = true; n.text = svc + ': your limit is reached for now (' + addon + ')'; }
1325
- else if (/infring|blocked|dmca|removed/.test(kind)) { n.text = svc + ' won’t give this file (' + addon + '): try another source'; }
1326
- else if (/download|caching|queued/.test(kind)) { n.text = 'Still downloading on ' + svc + ' (' + addon + '): try again later'; }
1327
- else { n.text = svc + ' couldn’t give this file (' + addon + ': “' + kind.replace(/_/g, ' ') + '”)'; }
1324
+ var w = { service: svc, addon: addon, key: key, what: kind.replace(/_/g, ' ') };
1325
+ if (/access|auth|unauthorized|forbidden|premium/.test(kind)) { n.account = true; n.text = U.t('{service} refused access ({addon}): check its {key} in the addon’s settings', w); }
1326
+ else if (/limit|too_many|exceeded/.test(kind)) { n.account = true; n.text = U.t('{service}: your limit is reached for now ({addon})', w); }
1327
+ else if (/infring|blocked|dmca|removed/.test(kind)) { n.text = U.t('{service} won’t give this file ({addon}): try another source', w); }
1328
+ else if (/download|caching|queued/.test(kind)) { n.text = U.t('Still downloading on {service} ({addon}): try again later', w); }
1329
+ else { n.text = U.t('{service} couldn’t give this file ({addon}: “{what}”)', w); }
1328
1330
  return n;
1329
1331
  }
1330
1332
  // Not playing after AV_START_MS (no answer from the server, or opened and nothing shown): the
@@ -1337,12 +1339,12 @@ var PlayerParts = {};
1337
1339
  }
1338
1340
  function startCheck() {
1339
1341
  if (!S.active || S.playing || !useAV || !_openedAt || Date.now() - _openedAt < startMs()) { return; }
1340
- if (_reco.tries) { liveDropped('Couldn’t reconnect'); return; } // (a reconnect's try: the next one)
1342
+ if (_reco.tries) { liveDropped(U.t('Couldn’t reconnect')); return; } // (a reconnect's try: the next one)
1341
1343
  if (nextSourceOnFail()) { return; }
1342
1344
  if (S.playStarted && isPaused()) { return; }
1343
1345
  U.log('player', 'Didn’t start: nothing played in ' + (startMs() / 1000) + ' s (' + where(S.ctx && S.ctx.url) + ')');
1344
1346
  U.spinner(false);
1345
- U.toast('Didn’t start: nothing played in ' + (startMs() / 1000) + ' seconds. Try another source.', 6000);
1347
+ U.toast(U.t('Didn’t start: nothing played in {n} seconds. Try another source.', { n: startMs() / 1000 }), 6000);
1346
1348
  exitLater();
1347
1349
  }
1348
1350
  P.startCheck = startCheck;
@@ -1427,9 +1429,9 @@ var PlayerParts = {};
1427
1429
  var known = liveKnown(ctx.url), cc = ctx._relayCc || null, raw = !!(known && known.raw);
1428
1430
  liveKeep(ctx.url, repack, known ? ccOf(known) : null, true); // (its hls answer kept)
1429
1431
  U.log('player', 'Live sound ' + (repack ? 'repacked by StremioK\'s service' : 'straight from the server') + ': your choice for this channel');
1430
- var msg = repack ? 'Repacking this channel’s sound…' : 'Playing the sound straight from the server…';
1432
+ var msg = repack ? U.t('Repacking this channel’s sound…') : U.t('Playing the sound straight from the server…');
1431
1433
  if (!repack && !cc) { ctx._relay = null; ctx._relayFor = null; ctx._relayFix = false; reopen(msg); return; }
1432
- function failed() { if (S.ctx === ctx && S.active) { U.toast('StremioK’s service didn’t answer: the sound stays as it was', 5000); } }
1434
+ function failed() { if (S.ctx === ctx && S.active) { U.toast(U.t('StremioK’s service didn’t answer: the sound stays as it was'), 5000); } }
1433
1435
  YTPlay.liveOpen(ctx.url, ctx._headers, true, { fix: !!repack, cc: raw ? null : cc, raw: raw }).then(function (r) {
1434
1436
  if (S.ctx !== ctx || !S.active) { return; }
1435
1437
  if (!relayed(ctx, r, cc, repack)) { failed(); return; }
@@ -1497,10 +1499,10 @@ var PlayerParts = {};
1497
1499
  liveKeep(url, fix, cc, false, hls, !!r.raw);
1498
1500
  if (S.ctx !== ctx || !S.active || ctx.url !== url) { return; }
1499
1501
  if (cc && cc.length && !ctx._relayCc) { ctx._ccOffer = cc; }
1500
- if (cc && cc.length && ccWanted(ctx, cc)) { ccOn(ctx, 'Adding this channel’s captions…'); return; }
1502
+ if (cc && cc.length && ccWanted(ctx, cc)) { ccOn(ctx, U.t('Adding this channel’s captions…')); return; }
1501
1503
  if (known || !fix || ctx._relay || !relayed(ctx, r, null, true)) { return; } // (the sound: restarted for on its first look only)
1502
1504
  U.log('player', 'Live sound repacked by StremioK\'s service (' + (r.why || '') + ')');
1503
- reopen('Fixing this channel’s sound…');
1505
+ reopen(U.t('Fixing this channel’s sound…'));
1504
1506
  }, function () {});
1505
1507
  }
1506
1508
  // The channel again through the relay with its closed captions as subtitle tracks (the sound
@@ -1518,7 +1520,7 @@ var PlayerParts = {};
1518
1520
  return true;
1519
1521
  }, function () { return false; });
1520
1522
  }
1521
- P.ccOn = function (want) { return S.ctx ? ccOn(S.ctx, 'Adding this channel’s captions…', want) : Promise.resolve(false); };
1523
+ P.ccOn = function (want) { return S.ctx ? ccOn(S.ctx, U.t('Adding this channel’s captions…'), want) : Promise.resolve(false); };
1522
1524
  // The relay didn't start (StremioK's service gone): the channel as it is.
1523
1525
  function relayFailed() {
1524
1526
  if (S.playStarted || !S.ctx || !S.ctx._relay) { return false; }
@@ -1539,12 +1541,12 @@ var PlayerParts = {};
1539
1541
  var now = Date.now();
1540
1542
  if (S.buffering) {
1541
1543
  if (!_stall.bufSince) { _stall.bufSince = now; }
1542
- else if (now - _stall.bufSince > BUFFER_STALL_SECS * 1000) { recoverStall('Stream stopped loading'); }
1544
+ else if (now - _stall.bufSince > BUFFER_STALL_SECS * 1000) { recoverStall(U.t('Stream stopped loading')); }
1543
1545
  return;
1544
1546
  }
1545
1547
  _stall.bufSince = 0;
1546
1548
  if (isPaused() || S.cur !== _stall.t) { _stall.t = S.cur; _stall.since = now; return; }
1547
- if (_stall.since && now - _stall.since > STALL_SECS * 1000) { recoverStall('Playback stalled'); }
1549
+ if (_stall.since && now - _stall.since > STALL_SECS * 1000) { recoverStall(U.t('Playback stalled')); }
1548
1550
  }
1549
1551
  function recoverStall(why) {
1550
1552
  if (liveReconnects()) { liveDropped(why); return; }
@@ -1552,12 +1554,12 @@ var PlayerParts = {};
1552
1554
  _stall.recoveries = _stall.recoveries.filter(function (t) { return now - t < STALL_WINDOW_MS; });
1553
1555
  if (_stall.recoveries.length >= STALL_MAX) {
1554
1556
  U.spinner(false);
1555
- U.toast('This source keeps stalling — try another one', 4000);
1557
+ U.toast(U.t('This source keeps stalling — try another one'), 4000);
1556
1558
  exit();
1557
1559
  return;
1558
1560
  }
1559
1561
  _stall.recoveries.push(now);
1560
- reopen(why + ' — reloading…');
1562
+ reopen(U.t('{why} — reloading…', { why: why }));
1561
1563
  }
1562
1564
 
1563
1565
  // ---------- a live channel that drops ----------
@@ -1578,20 +1580,20 @@ var PlayerParts = {};
1578
1580
  var mode = P.playerCfg().reconnect, now = Date.now();
1579
1581
  if (mode === 'off') {
1580
1582
  U.log('player', 'Live channel: ' + why + '; reconnecting is off');
1581
- U.spinner(false); U.toast(why + ': the channel stopped (reconnecting is off)', 5000);
1583
+ U.spinner(false); U.toast(U.t('{why}: the channel stopped (reconnecting is off)', { why: why }), 5000);
1582
1584
  exitLater();
1583
1585
  return;
1584
1586
  }
1585
1587
  _stall.recoveries = _stall.recoveries.filter(function (t) { return now - t < STALL_WINDOW_MS; });
1586
1588
  if (mode !== 'always' && _stall.recoveries.length >= STALL_MAX) {
1587
1589
  U.log('player', 'Live channel: ' + why + '; dropped ' + STALL_MAX + ' times in ' + (STALL_WINDOW_MS / 60000) + ' minutes, given up');
1588
- U.spinner(false); U.toast('This channel keeps dropping — try it again later', 5000);
1590
+ U.spinner(false); U.toast(U.t('This channel keeps dropping — try it again later'), 5000);
1589
1591
  exit();
1590
1592
  return;
1591
1593
  }
1592
1594
  _stall.recoveries.push(now);
1593
1595
  var n = ++_reco.tries, wait = RECO_WAIT_S[Math.min(n - 1, RECO_WAIT_S.length - 1)] * 1000, ctx = S.ctx;
1594
- var msg = why + ' — reconnecting' + (n > 1 ? ' (try ' + n + ')' : '') + '…';
1596
+ var msg = n > 1 ? U.t('{why} — reconnecting (try {n})…', { why: why, n: n }) : U.t('{why} — reconnecting…', { why: why });
1595
1597
  U.log('player', 'Live channel: ' + why + ', reconnecting (try ' + n + (wait ? ', in ' + (wait / 1000) + ' s' : '') + ')');
1596
1598
  if (!wait) { reopen(msg); return; }
1597
1599
  U.spinner(true, msg);
@@ -1668,5 +1670,5 @@ var PlayerParts = {};
1668
1670
  P.sponsorHighlight = sponsorHighlight;
1669
1671
  P.chapters = chapters; P.chapterAt = chapterAt; P.chapterLabel = chapterLabel;
1670
1672
  P.seekTo = seekTo; P.doAVSeek = doAVSeek; P.seekBy = seekBy; P.exit = exit;
1671
- P.reload = function () { if (S.active && S.ctx) { reopen(S.isLive ? 'Reloading the channel…' : 'Reloading…'); } }; // (the menu's Reload)
1673
+ P.reload = function () { if (S.active && S.ctx) { reopen(S.isLive ? U.t('Reloading the channel…') : U.t('Reloading…')); } }; // (the menu's Reload)
1672
1674
  })(PlayerParts);
package/js/player-lang.js CHANGED
@@ -135,32 +135,32 @@
135
135
  }
136
136
 
137
137
  // Display names for language codes (the aliases above, plus other common ones).
138
- var LANG_NAMES = { eng: 'English', spa: 'Spanish', fre: 'French', ger: 'German', ita: 'Italian', por: 'Portuguese',
139
- dut: 'Dutch', rus: 'Russian', ara: 'Arabic', tur: 'Turkish', pol: 'Polish',
140
- jpn: 'Japanese', ja: 'Japanese', kor: 'Korean', ko: 'Korean', chi: 'Chinese', zho: 'Chinese', zh: 'Chinese',
141
- hin: 'Hindi', hi: 'Hindi', swe: 'Swedish', sv: 'Swedish', nor: 'Norwegian', no: 'Norwegian', nob: 'Norwegian',
142
- dan: 'Danish', da: 'Danish', fin: 'Finnish', fi: 'Finnish', gre: 'Greek', ell: 'Greek', el: 'Greek',
143
- heb: 'Hebrew', he: 'Hebrew', hun: 'Hungarian', hu: 'Hungarian', cze: 'Czech', ces: 'Czech', cs: 'Czech',
144
- rum: 'Romanian', ron: 'Romanian', ro: 'Romanian', ukr: 'Ukrainian', uk: 'Ukrainian', tha: 'Thai', th: 'Thai',
145
- vie: 'Vietnamese', vi: 'Vietnamese', ind: 'Indonesian', id: 'Indonesian', cat: 'Catalan', ca: 'Catalan',
146
- bul: 'Bulgarian', bg: 'Bulgarian', hrv: 'Croatian', hr: 'Croatian', srp: 'Serbian', sr: 'Serbian',
147
- per: 'Persian', fas: 'Persian', fa: 'Persian', slo: 'Slovak', slv: 'Slovenian', may: 'Malay', fil: 'Filipino',
148
- baq: 'Basque', glg: 'Galician', est: 'Estonian', lav: 'Latvian', lit: 'Lithuanian', ice: 'Icelandic',
149
- tam: 'Tamil', tel: 'Telugu', ben: 'Bengali', mul: 'Multiple languages', zxx: 'No language',
150
- afr: 'Afrikaans', alb: 'Albanian', arg: 'Aragonese', arm: 'Armenian', ast: 'Asturian', aze: 'Azerbaijani',
151
- bel: 'Belarusian', bos: 'Bosnian', bre: 'Breton', bur: 'Burmese', prs: 'Dari', epo: 'Esperanto', ext:
152
- 'Extremaduran', gla: 'Scottish Gaelic', geo: 'Georgian', ibo: 'Igbo', ina: 'Interlingua', gle: 'Irish', kan:
153
- 'Kannada', kaz: 'Kazakh', khm: 'Khmer', kur: 'Kurdish', ltz: 'Luxembourgish', mac: 'Macedonian', mal:
154
- 'Malayalam', mni: 'Manipuri', mar: 'Marathi', mon: 'Mongolian', mne: 'Montenegrin', nav: 'Navajo', nep:
155
- 'Nepali', sme: 'Northern Sami', oci: 'Occitan', ori: 'Odia', pan: 'Punjabi', pus: 'Pashto', sat: 'Santali',
156
- snd: 'Sindhi', sin: 'Sinhala', som: 'Somali', swa: 'Swahili', syr: 'Syriac', tat: 'Tatar', tok: 'Toki Pona',
157
- tuk: 'Turkmen', urd: 'Urdu', uzb: 'Uzbek', wel: 'Welsh',
158
- und: 'Unknown language', '': 'Unknown language' };
138
+ var LANG_NAMES = { eng: U.t('English'), spa: U.t('Spanish'), fre: U.t('French'), ger: U.t('German'), ita: U.t('Italian'), por: U.t('Portuguese'),
139
+ dut: U.t('Dutch'), rus: U.t('Russian'), ara: U.t('Arabic'), tur: U.t('Turkish'), pol: U.t('Polish'),
140
+ jpn: U.t('Japanese'), ja: U.t('Japanese'), kor: U.t('Korean'), ko: U.t('Korean'), chi: U.t('Chinese'), zho: U.t('Chinese'), zh: U.t('Chinese'),
141
+ hin: U.t('Hindi'), hi: U.t('Hindi'), swe: U.t('Swedish'), sv: U.t('Swedish'), nor: U.t('Norwegian'), no: U.t('Norwegian'), nob: U.t('Norwegian'),
142
+ dan: U.t('Danish'), da: U.t('Danish'), fin: U.t('Finnish'), fi: U.t('Finnish'), gre: U.t('Greek'), ell: U.t('Greek'), el: U.t('Greek'),
143
+ heb: U.t('Hebrew'), he: U.t('Hebrew'), hun: U.t('Hungarian'), hu: U.t('Hungarian'), cze: U.t('Czech'), ces: U.t('Czech'), cs: U.t('Czech'),
144
+ rum: U.t('Romanian'), ron: U.t('Romanian'), ro: U.t('Romanian'), ukr: U.t('Ukrainian'), uk: U.t('Ukrainian'), tha: U.t('Thai'), th: U.t('Thai'),
145
+ vie: U.t('Vietnamese'), vi: U.t('Vietnamese'), ind: U.t('Indonesian'), id: U.t('Indonesian'), cat: U.t('Catalan'), ca: U.t('Catalan'),
146
+ bul: U.t('Bulgarian'), bg: U.t('Bulgarian'), hrv: U.t('Croatian'), hr: U.t('Croatian'), srp: U.t('Serbian'), sr: U.t('Serbian'),
147
+ per: U.t('Persian'), fas: U.t('Persian'), fa: U.t('Persian'), slo: U.t('Slovak'), slv: U.t('Slovenian'), may: U.t('Malay'), fil: U.t('Filipino'),
148
+ baq: U.t('Basque'), glg: U.t('Galician'), est: U.t('Estonian'), lav: U.t('Latvian'), lit: U.t('Lithuanian'), ice: U.t('Icelandic'),
149
+ tam: U.t('Tamil'), tel: U.t('Telugu'), ben: U.t('Bengali'), mul: U.t('Multiple languages'), zxx: U.t('No language'),
150
+ afr: U.t('Afrikaans'), alb: U.t('Albanian'), arg: U.t('Aragonese'), arm: U.t('Armenian'), ast: U.t('Asturian'), aze: U.t('Azerbaijani'),
151
+ bel: U.t('Belarusian'), bos: U.t('Bosnian'), bre: U.t('Breton'), bur: U.t('Burmese'), prs: U.t('Dari'), epo: U.t('Esperanto'), ext:
152
+ U.t('Extremaduran'), gla: U.t('Scottish Gaelic'), geo: U.t('Georgian'), ibo: U.t('Igbo'), ina: U.t('Interlingua'), gle: U.t('Irish'), kan:
153
+ U.t('Kannada'), kaz: U.t('Kazakh'), khm: U.t('Khmer'), kur: U.t('Kurdish'), ltz: U.t('Luxembourgish'), mac: U.t('Macedonian'), mal:
154
+ U.t('Malayalam'), mni: U.t('Manipuri'), mar: U.t('Marathi'), mon: U.t('Mongolian'), mne: U.t('Montenegrin'), nav: U.t('Navajo'), nep:
155
+ U.t('Nepali'), sme: U.t('Northern Sami'), oci: U.t('Occitan'), ori: U.t('Odia'), pan: U.t('Punjabi'), pus: U.t('Pashto'), sat: U.t('Santali'),
156
+ snd: U.t('Sindhi'), sin: U.t('Sinhala'), som: U.t('Somali'), swa: U.t('Swahili'), syr: U.t('Syriac'), tat: U.t('Tatar'), tok: U.t('Toki Pona'),
157
+ tuk: U.t('Turkmen'), urd: U.t('Urdu'), uzb: U.t('Uzbek'), wel: U.t('Welsh'),
158
+ und: U.t('Unknown language'), '': U.t('Unknown language') };
159
159
  function langName(lang) {
160
160
  var k = langKey(lang);
161
161
  if (LANG_NAMES[k]) { return LANG_NAMES[k]; }
162
162
  var raw = ('' + (lang || '')).trim();
163
- return raw ? raw.charAt(0).toUpperCase() + raw.slice(1) : 'Unknown language';
163
+ return raw ? raw.charAt(0).toUpperCase() + raw.slice(1) : U.t('Unknown language');
164
164
  }
165
165
  // Order for language groups: current choice, then the preferred languages, then by name.
166
166
  function langRank(k, prefs) {
@@ -105,10 +105,10 @@
105
105
  _ytRetried = false; // new pick → its one-shot retry is available again
106
106
  _autoRetried = false; // ...and so is the final Auto fallback
107
107
  _userPicked = true;
108
- var label = bw == null ? 'Auto quality' : (labelForBw(bw) || 'new quality');
109
- _startNote = bw == null ? 'Playing with Auto quality' : 'Playing at ' + label;
108
+ var label = bw == null ? U.t('Auto quality') : (labelForBw(bw) || U.t('new quality'));
109
+ _startNote = bw == null ? U.t('Playing with Auto quality') : U.t('Playing at {quality}', { quality: label });
110
110
  S.ctx.resumeSec = S.isLive ? 0 : S.cur;
111
- _switchNote = message || 'Switching to ' + label + '…';
111
+ _switchNote = message || U.t('Switching to {quality}…', { quality: label });
112
112
  U.spinner(true, _switchNote);
113
113
  // YouTube: don't re-open the same (cached, now-stale) master and lean on an AVPlay cap.
114
114
  // Rebuild the proxy URL so the service serves a single-rung master (&h=) from a FRESH
@@ -134,7 +134,7 @@
134
134
  S.ctx.resumeSec = S.isLive ? 0 : S.cur;
135
135
  S.ctx.url = YTPlay.resolverUrl(S.ctx.yt, retryHeight, true, S.ctx.ytLang);
136
136
  // Right after a switch this retry is routine: keep saying "Switching to …"
137
- U.spinner(true, _switchNote || ((retryHeight ? retryHeight + 'p' : 'The stream') + ' didn\'t start — retrying…'));
137
+ U.spinner(true, _switchNote || (retryHeight ? U.t('{quality} didn\'t start — retrying…', { quality: retryHeight + 'p' }) : U.t('The stream didn\'t start — retrying…')));
138
138
  _switchNote = null;
139
139
  if (P.useAV) { startAV(S.ctx.url, true); } else { startHTML5(S.ctx.url); }
140
140
  return true;
@@ -146,7 +146,7 @@
146
146
  if (_qualityBw == null) { return false; }
147
147
  var lower = nextLowerBw(_qualityBw);
148
148
  if (lower == null) { return false; }
149
- setQuality(lower, (labelForBw(_qualityBw) || 'That quality') + ' didn\'t start — trying ' + labelForBw(lower) + '…');
149
+ setQuality(lower, U.t('{quality} didn\'t start — trying {lower}…', { quality: labelForBw(_qualityBw) || U.t('That quality'), lower: labelForBw(lower) }));
150
150
  return true;
151
151
  }
152
152
 
@@ -162,8 +162,8 @@
162
162
  S.ctx.initialQualityHeight = 0;
163
163
  S.ctx.resumeSec = S.isLive ? 0 : S.cur;
164
164
  if (S.ctx.yt && typeof YTPlay !== 'undefined') { S.ctx.url = YTPlay.resolverUrl(S.ctx.yt, 0, true, S.ctx.ytLang); }
165
- _startNote = wasAuto ? '' : 'Playing with Auto quality';
166
- U.spinner(true, wasAuto ? 'Stream didn\'t start — retrying…' : 'Retrying with Auto quality…');
165
+ _startNote = wasAuto ? '' : U.t('Playing with Auto quality');
166
+ U.spinner(true, wasAuto ? U.t('Stream didn\'t start — retrying…') : U.t('Retrying with Auto quality…'));
167
167
  if (P.useAV) { startAV(S.ctx.url); } else { startHTML5(S.ctx.url); }
168
168
  return true;
169
169
  }
@@ -289,8 +289,8 @@
289
289
  S.ctx.resumeSec = S.cur;
290
290
  var v = variantByBw(_qualityBw);
291
291
  S.ctx.url = YTPlay.resolverUrl(S.ctx.yt, v ? v.h : (S.ctx.initialQualityHeight || 0), true, lang);
292
- _switchNote = 'Switching to ' + ytLangLabel(a) + '…';
293
- _startNote = 'Audio: ' + ytLangLabel(a);
292
+ _switchNote = U.t('Switching to {quality}…', { quality: ytLangLabel(a) });
293
+ _startNote = U.t('Audio: {track}', { track: ytLangLabel(a) });
294
294
  U.spinner(true, _switchNote);
295
295
  if (P.useAV) { startAV(S.ctx.url, true); } else { startHTML5(S.ctx.url); }
296
296
  }
@@ -300,20 +300,20 @@
300
300
  var idx = 0;
301
301
  var items = list.map(function (a, i) {
302
302
  if (a === cur) { idx = i; }
303
- return { label: ytLangLabel(a), detail: a.original ? 'Original' : 'AI-dubbed by YouTube', sel: a === cur,
303
+ return { label: ytLangLabel(a), detail: a.original ? U.t('Original') : U.t('AI-dubbed by YouTube'), sel: a === cur,
304
304
  run: function () { closeMenu(); setYtLanguage(a); } };
305
305
  });
306
- return { title: 'Audio language', items: items, idx: idx };
306
+ return { title: U.t('Audio language'), items: items, idx: idx };
307
307
  }
308
308
 
309
309
  function qualityLabel() {
310
- if (_qualityBw == null) { return 'Auto'; }
310
+ if (_qualityBw == null) { return U.t('Auto'); }
311
311
  for (var i = 0; i < _variants.length; i++) { if (_variants[i].bw === _qualityBw) { return _variants[i].label; } }
312
- return 'Auto';
312
+ return U.t('Auto');
313
313
  }
314
314
 
315
315
  function qualityMenu() {
316
- var items = [{ label: 'Auto', detail: 'Adapt to bandwidth', sel: _qualityBw == null,
316
+ var items = [{ label: U.t('Auto'), detail: U.t('Adapt to bandwidth'), sel: _qualityBw == null,
317
317
  run: function () { setQuality(null); closeMenu(); } }];
318
318
  _variants.forEach(function (v) {
319
319
  items.push({ label: v.label, detail: Math.round(v.bw / 1000) + ' kbps', sel: _qualityBw === v.bw,
@@ -321,7 +321,7 @@
321
321
  });
322
322
  var idx = 0;
323
323
  for (var i = 0; i < items.length; i++) { if (items[i].sel) { idx = i; break; } }
324
- return { title: 'Video quality', items: items, idx: idx };
324
+ return { title: U.t('Video quality'), items: items, idx: idx };
325
325
  }
326
326
 
327
327
  // ----- for the other parts (and js/player.js) -----
@@ -81,13 +81,13 @@
81
81
 
82
82
  // ---------- subtitle look, audio language ----------
83
83
  // Look: color, background, edge and height on screen.
84
- var SUB_COLORS = [['white', 'White', '#ffffff'], ['yellow', 'Yellow', '#ffe14d'], ['cyan', 'Cyan', '#7fe7ff'], ['green', 'Green', '#9cff8a']];
85
- var SUB_BGS = [['none', 'None', 'transparent'], ['light', 'See-through box', 'rgba(0,0,0,0.55)'], ['solid', 'Solid box', 'rgba(0,0,0,0.9)']];
86
- var SUB_EDGES = [['shadow', 'Drop shadow', '0 2px 3px #000'],
87
- ['outline', 'Outline', '-2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 -2px 0 #000, 0 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000'],
88
- ['none', 'None', 'none']];
84
+ var SUB_COLORS = [['white', U.t('White'), '#ffffff'], ['yellow', U.t('Yellow'), '#ffe14d'], ['cyan', U.t('Cyan'), '#7fe7ff'], ['green', U.t('Green'), '#9cff8a']];
85
+ var SUB_BGS = [['none', U.t('None'), 'transparent'], ['light', U.t('See-through box'), 'rgba(0,0,0,0.55)'], ['solid', U.t('Solid box'), 'rgba(0,0,0,0.9)']];
86
+ var SUB_EDGES = [['shadow', U.t('Drop shadow'), '0 2px 3px #000'],
87
+ ['outline', U.t('Outline'), '-2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 -2px 0 #000, 0 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000'],
88
+ ['none', U.t('None'), 'none']];
89
89
  // bottom offset: above the black bars of a widescreen film when raised
90
- var SUB_POSITIONS = [['lower', 'Lower', 60], ['bottom', 'Bottom', 130], ['raised', 'Raised', 210], ['higher', 'Higher', 290]]; // (Lower: near the screen's edge)
90
+ var SUB_POSITIONS = [['lower', U.t('Lower'), 60], ['bottom', U.t('Bottom'), 130], ['raised', U.t('Raised'), 210], ['higher', U.t('Higher'), 290]]; // (Lower: near the screen's edge)
91
91
  function pick3(list, id) { for (var i = 0; i < list.length; i++) { if (list[i][0] === id) { return list[i]; } } return list[0]; }
92
92
  function getSubCfg() {
93
93
  var d = U.store.get(SUBCFG_KEY, {}) || {};
@@ -109,11 +109,11 @@
109
109
  // css/fonts (see style.css); each falls back to a TV font for scripts it lacks.
110
110
  // 'default' leaves the subtitle in the app font (Arial / Tizen Sans).
111
111
  var SUB_FONTS = [
112
- ['default', 'TV default', ''],
112
+ ['default', U.t('TV default'), ''],
113
113
  ['roboto', 'Roboto', "'SK Roboto', Arial, sans-serif"],
114
- ['atkinson', 'Atkinson Hyperlegible (easy reading)', "'SK Atkinson Hyperlegible', Arial, sans-serif"],
115
- ['nunito', 'Nunito (rounded)', "'SK Nunito', Arial, sans-serif"],
116
- ['cousine', 'Cousine (closed-caption style)', "'SK Cousine', 'Courier New', monospace"]
114
+ ['atkinson', U.t('Atkinson Hyperlegible (easy reading)'), "'SK Atkinson Hyperlegible', Arial, sans-serif"],
115
+ ['nunito', U.t('Nunito (rounded)'), "'SK Nunito', Arial, sans-serif"],
116
+ ['cousine', U.t('Cousine (closed-caption style)'), "'SK Cousine', 'Courier New', monospace"]
117
117
  ];
118
118
  function subFontFamily(id) {
119
119
  for (var i = 0; i < SUB_FONTS.length; i++) { if (SUB_FONTS[i][0] === id) { return SUB_FONTS[i][2]; } }
@@ -247,9 +247,9 @@
247
247
  // [id, label, AVPlay display method, CSS object-fit for the desktop <video>]; remembered.
248
248
  var PLAYERCFG_KEY = 'stremiok.playercfg';
249
249
  var ASPECTS = [
250
- ['fit', 'Fit (whole picture)', 'PLAYER_DISPLAY_MODE_LETTER_BOX', 'contain'],
251
- ['zoom', 'Zoom (fill the screen, trims edges)', 'PLAYER_DISPLAY_MODE_CROPPED_FULL', 'cover'],
252
- ['stretch', 'Stretch', 'PLAYER_DISPLAY_MODE_FULL_SCREEN', 'fill']
250
+ ['fit', U.t('Fit (whole picture)'), 'PLAYER_DISPLAY_MODE_LETTER_BOX', 'contain'],
251
+ ['zoom', U.t('Zoom (fill the screen, trims edges)'), 'PLAYER_DISPLAY_MODE_CROPPED_FULL', 'cover'],
252
+ ['stretch', U.t('Stretch'), 'PLAYER_DISPLAY_MODE_FULL_SCREEN', 'fill']
253
253
  ];
254
254
  // + seek: how far LEFT / RIGHT jump (s); buffer: 'normal' (the TV's own) | 'more' | 'most';
255
255
  // reconnect: a live channel that drops, 'off' | 'few' | 'always' (see player-core's liveDropped)