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/view-home.js CHANGED
@@ -21,16 +21,16 @@
21
21
  // other three are the catalog rows of that Stremio type, in the user's
22
22
  // Home-Feeds order/visibility. A tab only appears when it has content.
23
23
  var HOME_TABS = [
24
- { key: 'continue', icon: '▶', label: 'Watching' }, // (Continue Watching: short, the menu is full)
25
- { key: 'calendar', icon: '📅', label: 'Calendar' }, // (coming up, and what you watched: see calendarRows)
26
- { key: 'movie', icon: '🎬', label: 'Movies' },
27
- { key: 'series', icon: '📺', label: 'Series' },
24
+ { key: 'continue', icon: '▶', label: U.t('Watching') }, // (Continue Watching: short, the menu is full)
25
+ { key: 'calendar', icon: '📅', label: U.t('Calendar') }, // (coming up, and what you watched: see calendarRows)
26
+ { key: 'movie', icon: '🎬', label: U.t('Movies') },
27
+ { key: 'series', icon: '📺', label: U.t('Series') },
28
28
  { key: 'tv', icon: '📡', label: 'IPTV' },
29
- { key: 'guide', icon: '☰', label: 'Guide' }, // (the IPTV channels' TV guide as a grid, once one is read: see js/view-guide.js)
30
- { key: 'radio', icon: '📻', label: 'Radio' },
31
- { key: 'sport', icon: '⚽', label: 'Sports' },
29
+ { key: 'guide', icon: '☰', label: U.t('Guide') }, // (the IPTV channels' TV guide as a grid, once one is read: see js/view-guide.js)
30
+ { key: 'radio', icon: '📻', label: U.t('Radio') },
31
+ { key: 'sport', icon: '⚽', label: U.t('Sports') },
32
32
  { key: 'youtube', icon: '📹', label: 'YouTube' }, // (StremioK's YouTube catalogs, an addon's YouTube / channel ones: see isYouTubeCat)
33
- { key: 'local', icon: '💾', label: 'Local' } // (a USB drive plugged in: see LocalMedia)
33
+ { key: 'local', icon: '💾', label: U.t('Local') } // (a USB drive plugged in: see LocalMedia)
34
34
  ];
35
35
  function hasLocal() { return typeof LocalMedia !== 'undefined' && LocalMedia.present(); }
36
36
  function hasGuide() { return typeof EPG !== 'undefined' && !!EPG.hasAny && EPG.hasAny(); }
@@ -306,27 +306,27 @@
306
306
  return null;
307
307
  }
308
308
  function localTitle(d) {
309
- var name = d.dav ? '🌐 ' + d.label : LocalMedia.knownDrives().length > 1 ? 'USB · ' + d.label.replace(/^removable_/, '') : 'USB drive';
309
+ var name = d.dav ? '🌐 ' + d.label : LocalMedia.knownDrives().length > 1 ? 'USB · ' + d.label.replace(/^removable_/, '') : U.t('USB drive');
310
310
  return [name].concat(_local.rel ? _local.rel.split('/') : []).join(' › ');
311
311
  }
312
312
  function localRows(rows) {
313
313
  if (!LocalMedia.isRead()) { // (read when the tab opens, not at launch)
314
- rows.appendChild(U.el('div', 'row-empty', 'Reading your drives and folders…'));
314
+ rows.appendChild(U.el('div', 'row-empty', U.t('Reading your drives and folders…')));
315
315
  LocalMedia.ensure().then(redrawLocal);
316
316
  return;
317
317
  }
318
318
  var ds = LocalMedia.knownDrives();
319
- if (!ds.length) { rows.appendChild(U.el('div', 'row-empty', 'No USB drive. Plug one into the TV.')); return; }
319
+ if (!ds.length) { rows.appendChild(U.el('div', 'row-empty', U.t('No USB drive. Plug one into the TV.'))); return; }
320
320
  downloadsList(rows);
321
321
  if (!localDrive()) { _local.root = ds.length === 1 ? ds[0].root : null; _local.rel = ''; _local.listing = null; _local.key = ''; }
322
322
  var d = localDrive();
323
323
  if (!d) { // several drives: one card each
324
- rows.appendChild(buildGrid(ds.some(function (x) { return x.dav; }) ? 'Drives and network folders' : 'USB drives', ds.map(function (x) {
324
+ rows.appendChild(buildGrid(ds.some(function (x) { return x.dav; }) ? U.t('Drives and network folders') : U.t('USB drives'), ds.map(function (x) {
325
325
  var c = posterCard({ id: 'drive:' + x.root, name: (x.dav ? '🌐 ' + x.label : '💾 ' + x.label.replace(/^removable_/, '')) }, 'local');
326
326
  c.className += ' local-folder';
327
327
  c.__onselect = function () { _local.root = x.root; _local.rel = ''; _local.listing = null; _local.key = ''; _local.focusRel = '__first'; renderHome(); };
328
328
  c.__onlongpress = null;
329
- c.__meta = { name: x.label, description: x.dav ? 'Network folder · ' + x.dav.url : x.root };
329
+ c.__meta = { name: x.label, description: x.dav ? U.t('Network folder') + ' · ' + x.dav.url : x.root };
330
330
  return c;
331
331
  })));
332
332
  return;
@@ -349,7 +349,7 @@
349
349
  redrawLocal();
350
350
  });
351
351
  }
352
- rows.appendChild(U.el('div', 'row-empty', 'Reading ' + localTitle(d) + '…'));
352
+ rows.appendChild(U.el('div', 'row-empty', U.t('Reading {name}…', { name: localTitle(d) })));
353
353
  return;
354
354
  }
355
355
  var all = _local.listing.entries;
@@ -362,7 +362,7 @@
362
362
  if (up) { cards.unshift(up); } // (a card for BACK: easier with the arrows alone)
363
363
  if (cards.length) { rows.appendChild(buildGrid(localTitle(d), cards)); }
364
364
  if (!entries.length) {
365
- rows.appendChild(U.el('div', 'row-empty', (cards.length ? '' : localTitle(d) + ': ') + (_local.error ? 'Couldn’t read this folder (' + _local.error + ').' : 'No videos or folders here.')));
365
+ rows.appendChild(U.el('div', 'row-empty', (cards.length ? '' : localTitle(d) + ': ') + (_local.error ? U.t('Couldn’t read this folder ({why}).', { why: _local.error }) : U.t('No videos or folders here.'))));
366
366
  }
367
367
  if (_local.focusRel) { setTimeout(localFocus, 0); } // (after Home's own focusing)
368
368
  }
@@ -383,28 +383,34 @@
383
383
  // Stop indexing: said as it is — while it's listing the drive nothing new is kept yet (the
384
384
  // drive stays as it was indexed before, if it was); while matching, the listing and the
385
385
  // matches so far stay.
386
+ // (d: a USB drive, or a network folder (d.dav): each said in its own words, a drive or a folder)
386
387
  function confirmStopIndexing(d, st, after) {
387
- var what = d.dav ? 'folder' : 'drive';
388
- confirm(st.phase === 'matching' ? 'Stop matching this ' + what + '’s videos? The listing and what’s been matched so far are kept; the rest can be matched later (Continue matching).'
389
- : 'Stop indexing this ' + what + '? It hasn’t been listed yet, so nothing new is kept: it stays as it was indexed before (if it was).',
390
- 'Stop', function () { LocalMedia.stopScan(d); after(); }, { noLabel: 'Keep going', plain: true });
388
+ var f = !!d.dav;
389
+ confirm(st.phase === 'matching' ? (f ? U.t('Stop matching this folder’s videos? The listing and what’s been matched so far are kept; the rest can be matched later (Continue matching).')
390
+ : U.t('Stop matching this drive’s videos? The listing and what’s been matched so far are kept; the rest can be matched later (Continue matching).'))
391
+ : (f ? U.t('Stop indexing this folder? It hasn’t been listed yet, so nothing new is kept: it stays as it was indexed before (if it was).')
392
+ : U.t('Stop indexing this drive? It hasn’t been listed yet, so nothing new is kept: it stays as it was indexed before (if it was).')),
393
+ U.t('Stop'), function () { LocalMedia.stopScan(d); after(); }, { noLabel: U.t('Keep going'), plain: true });
391
394
  }
392
395
  V.confirmStopIndexing = confirmStopIndexing;
393
396
  // The drive's index (so title pages know what's on it): read only when asked.
394
397
  function indexCard(d) {
395
- var st = LocalMedia.status(d), busy = st.state === 'scanning', what = d.dav ? 'folder' : 'drive';
396
- var busyName = st.phase === 'matching' ? '⏳ Matching ' + st.done + ' / ' + st.total : '⏳ Listing the ' + what + '…';
397
- var c = posterCard({ id: 'index:' + d.root, name: busy ? busyName : st.state === 'none' ? '🔍 Index this ' + what : st.left ? '🔍 Continue matching (' + st.left + ' left)' : '🔍 Index again' }, 'local');
398
+ var st = LocalMedia.status(d), busy = st.state === 'scanning', f = !!d.dav;
399
+ var indexThis = f ? U.t('Index this folder') : U.t('Index this drive');
400
+ var busyName = st.phase === 'matching' ? '⏳ ' + U.t('Matching {done} / {total}', { done: st.done, total: st.total }) : '⏳ ' + (f ? U.t('Listing the folder…') : U.t('Listing the drive…'));
401
+ var c = posterCard({ id: 'index:' + d.root, name: busy ? busyName : st.state === 'none' ? '🔍 ' + indexThis : st.left ? '🔍 ' + U.t('Continue matching ({n} left)', { n: st.left }) : '🔍 ' + U.t('Index again') }, 'local');
398
402
  c.className += ' local-folder';
399
403
  c.__onlongpress = null;
400
- c.__meta = { name: 'Index this ' + what, description: (st.state === 'none' ? 'Not indexed yet. ' : st.state === 'failed' ? 'Indexing failed: ' + st.error + '. ' :
401
- busy ? 'Indexing… (OK: stop) ' : st.videos + ' videos, ' + st.matched + ' matched to titles, indexed ' + U.dayLabel(st.at) + '. ') +
402
- (LocalMedia.matchingAllowed() ? 'Indexing lists the ' + what + '’s videos and matches them to titles, so their title pages offer them (“On your ' + (d.dav ? 'network folder' : 'USB drive') + '”).'
403
- : 'Indexing lists the ' + what + '’s videos (matching them to titles is off: Settings › Content › USB drive).') };
404
+ c.__meta = { name: indexThis, description: (st.state === 'none' ? U.t('Not indexed yet.') + ' ' : st.state === 'failed' ? U.t('Indexing failed: {why}.', { why: st.error }) + ' ' :
405
+ busy ? U.t('Indexing… (OK: stop)') + ' ' : U.t('{videos} videos, {matched} matched to titles, indexed {when}.', { videos: st.videos, matched: st.matched, when: U.dayLabel(st.at) }) + ' ') +
406
+ (LocalMedia.matchingAllowed() ? (f ? U.t('Indexing lists the folder’s videos and matches them to titles, so their title pages offer them (“On your network folder”).')
407
+ : U.t('Indexing lists the drive’s videos and matches them to titles, so their title pages offer them (“On your USB drive”).'))
408
+ : (f ? U.t('Indexing lists the folder’s videos (matching them to titles is off: Settings › Content › USB drive).')
409
+ : U.t('Indexing lists the drive’s videos (matching them to titles is off: Settings › Content › USB drive).'))) };
404
410
  c.__onselect = function () {
405
411
  if (busy) { confirmStopIndexing(d, st, function () { renderHome(); }); return; }
406
412
  if (st.left) {
407
- pickList('Index this ' + what, [['more', 'Continue matching (' + st.left + ' titles left)'], ['again', 'Index again (list the ' + what + ' afresh)']], 'more', function (k) {
413
+ pickList(indexThis, [['more', U.t('Continue matching ({n} titles left)', { n: st.left })], ['again', f ? U.t('Index again (list the folder afresh)') : U.t('Index again (list the drive afresh)')]], 'more', function (k) {
408
414
  _local.focusRel = 'index:' + d.root;
409
415
  if (k === 'more') { LocalMedia.continueMatching(d); } else { LocalMedia.scan(d); }
410
416
  renderHome();
@@ -412,7 +418,7 @@
412
418
  return;
413
419
  }
414
420
  _local.focusRel = 'index:' + d.root;
415
- LocalMedia.scan(d).then(function () { var s2 = LocalMedia.status(d); U.toast(s2.state === 'failed' ? 'Indexing failed' + (s2.error ? ': ' + s2.error : '') : 'Indexed: ' + s2.videos + ' videos, ' + s2.matched + ' matched', 5000); });
421
+ LocalMedia.scan(d).then(function () { var s2 = LocalMedia.status(d); U.toast(s2.state === 'failed' ? (s2.error ? U.t('Indexing failed: {why}', { why: s2.error }) : U.t('Indexing failed')) : U.t('Indexed: {videos} videos, {matched} matched', { videos: s2.videos, matched: s2.matched }), 5000); });
416
422
  renderHome();
417
423
  };
418
424
  return c;
@@ -423,11 +429,11 @@
423
429
  function askMatching(d, entries) {
424
430
  if (_askedMatching || _homeTab !== 'local' || _current() !== scr('home') || isModalOpen() || Player.isActive()) { return; }
425
431
  _askedMatching = true;
426
- confirm('Match your videos to movies and series? Each one’s title is worked out from its name and looked up with your search addons, so they see those titles. Matched videos get posters and play as that title; without it, Local just browses. Settings › Content › USB drive changes this.',
427
- 'Match', function () {
432
+ confirm(U.t('Match your videos to movies and series? Each one’s title is worked out from its name and looked up with your search addons, so they see those titles. Matched videos get posters and play as that title; without it, Local just browses. Settings › Content › USB drive changes this.'),
433
+ U.t('Match'), function () {
428
434
  LocalMedia.setMatching(true);
429
435
  LocalMedia.matchFolder(d, entries).then(function (n) { if (n) { redrawLocal(); } });
430
- }, { noLabel: 'Don’t match', plain: true, onNo: function () { LocalMedia.setMatching(false); } });
436
+ }, { noLabel: U.t('Don’t match'), plain: true, onNo: function () { LocalMedia.setMatching(false); } });
431
437
  }
432
438
  // ----- Downloads (js/downloads.js): at the top of the Local tab while it has any -----
433
439
  // Each: what it is, how far it's got, its speed and time left (or done, or what went wrong);
@@ -436,13 +442,13 @@
436
442
  var _dlWatching = null, _dlShown = '', _dlRows = {}; // (key -> its status line, updated in place)
437
443
  function dlLine(x) {
438
444
  var pct = x.size ? Math.min(100, Math.floor(x.got / x.size * 100)) : 0;
439
- if (x.state === 'done') { return 'Done · ' + (LocalMedia.humanSize(x.size || x.got) || '') + ' · in ' + x.dir.replace(/^\/opt\/media\//, ''); }
440
- if (x.state === 'failed') { return 'Didn’t finish: ' + (x.err || 'unknown') + ' · OK to retry'; }
441
- if (x.state === 'queued') { return 'Waiting for the one before it'; }
442
- if (x.state === 'waiting') { return 'Paused (' + (x.err || 'connection') + '), picked up again shortly · ' + (pct ? pct + '%' : LocalMedia.humanSize(x.got)); }
445
+ if (x.state === 'done') { return U.t('Done') + ' · ' + (LocalMedia.humanSize(x.size || x.got) || '') + ' · ' + U.t('in {folder}', { folder: x.dir.replace(/^\/opt\/media\//, '') }); }
446
+ if (x.state === 'failed') { return U.t('Didn’t finish: {why}', { why: x.err || U.t('unknown') }) + ' · ' + U.t('OK to retry'); }
447
+ if (x.state === 'queued') { return U.t('Waiting for the one before it'); }
448
+ if (x.state === 'waiting') { return U.t('Paused ({why}), picked up again shortly', { why: x.err || U.t('connection') }) + ' · ' + (pct ? pct + '%' : LocalMedia.humanSize(x.got)); }
443
449
  var left = x.speed > 0 && x.size ? Math.round((x.size - x.got) / x.speed / 60) : null;
444
- return (x.size ? pct + '% of ' + LocalMedia.humanSize(x.size) : LocalMedia.humanSize(x.got) + ' so far') +
445
- (x.speed > 0 ? ' · ' + (x.speed / 1048576).toFixed(1) + ' MB/s' : '') + (left != null ? ' · about ' + (left < 1 ? 'a minute' : left + ' min') + ' left' : '');
450
+ return (x.size ? U.t('{pct}% of {size}', { pct: pct, size: LocalMedia.humanSize(x.size) }) : U.t('{size} so far', { size: LocalMedia.humanSize(x.got) })) +
451
+ (x.speed > 0 ? ' · ' + (x.speed / 1048576).toFixed(1) + ' MB/s' : '') + (left != null ? ' · ' + (left < 1 ? U.t('about a minute left') : U.t('about {n} min left', { n: left })) : '');
446
452
  }
447
453
  function dlSig(list) { return list.map(function (x) { return x.key + ':' + (x.state === 'done' || x.state === 'failed' ? x.state : 'on'); }).join('|'); }
448
454
  function downloadsList(rows) {
@@ -467,7 +473,7 @@
467
473
  _dlShown = dlSig(list); _dlRows = {};
468
474
  if (!list.length) { return; }
469
475
  var box = U.el('div', 'dl-list');
470
- box.appendChild(U.el('div', 'row-title', 'Downloads · OK on one: cancel, retry or remove it'));
476
+ box.appendChild(U.el('div', 'row-title', U.t('Downloads · OK on one: cancel, retry or remove it')));
471
477
  list.slice().reverse().forEach(function (x) {
472
478
  var r = U.el('div', 'addon-item focusable dl-item ' + x.state);
473
479
  r.setAttribute('data-dl', x.key.replace(/"/g, ''));
@@ -480,12 +486,12 @@
480
486
  description: x.name + ' · ' + x.dir.replace(/^\/opt\/media\//, '') + ' · ' + dlLine(x) };
481
487
  r.__onselect = function () {
482
488
  var now = Downloads.items().filter(function (y) { return y.key === x.key; })[0] || x, opts = [];
483
- if (now.state === 'failed') { opts.push(['retry', 'Retry']); }
484
- if (now.state === 'queued' || now.state === 'downloading' || now.state === 'waiting') { opts.push(['cancel', 'Cancel (its partial file deleted)']); }
485
- opts.push(['clear', now.state === 'done' ? 'Remove from the list (the file stays)' : 'Remove from the list']);
489
+ if (now.state === 'failed') { opts.push(['retry', U.t('Retry')]); }
490
+ if (now.state === 'queued' || now.state === 'downloading' || now.state === 'waiting') { opts.push(['cancel', U.t('Cancel (its partial file deleted)')]); }
491
+ opts.push(['clear', now.state === 'done' ? U.t('Remove from the list (the file stays)') : U.t('Remove from the list')]);
486
492
  pickList(now.title || now.name, opts, null, function (k) {
487
493
  if (k === 'retry') { Downloads.retry(now); }
488
- else if (k === 'cancel') { confirm('Cancel “' + (now.title || now.name) + '”? What’s been downloaded is deleted.', 'Cancel it', function () { Downloads.cancel(now); }, { noLabel: 'Keep going' }); }
494
+ else if (k === 'cancel') { confirm(U.t('Cancel “{name}”? What’s been downloaded is deleted.', { name: now.title || now.name }), U.t('Cancel it'), function () { Downloads.cancel(now); }, { noLabel: U.t('Keep going') }); }
489
495
  else { Downloads.clear(now); }
490
496
  });
491
497
  };
@@ -500,17 +506,17 @@
500
506
  var c = posterCard({ id: x.rel, name: '📁 ' + x.name }, 'local');
501
507
  c.className += ' local-folder';
502
508
  c.__onlongpress = null;
503
- c.__meta = { name: x.name, description: 'Folder' + (x.bad ? ' · the TV can’t read its details' : '') };
509
+ c.__meta = { name: x.name, description: U.t('Folder') + (x.bad ? ' · ' + U.t('the TV can’t read its details') : '') };
504
510
  c.__onselect = function () { _local.rel = x.rel; _local.listing = null; _local.key = ''; _local.focusRel = '__first'; renderHome(); };
505
511
  return c;
506
512
  }
507
513
  // ⬆ Back: up a folder (from a drive's top, to the drives), as BACK does.
508
514
  function localBackCard(d) {
509
- var parent = _local.rel ? (_local.rel.indexOf('/') === -1 ? 'the drive’s top' : '“' + _local.rel.split('/').slice(-2, -1)[0] + '”') : 'your USB drives';
510
- var c = posterCard({ id: '..', name: '⬆ Back' }, 'local');
515
+ var parent = _local.rel ? (_local.rel.indexOf('/') === -1 ? U.t('the drive’s top') : '“' + _local.rel.split('/').slice(-2, -1)[0] + '”') : U.t('your USB drives');
516
+ var c = posterCard({ id: '..', name: U.t('⬆ Back') }, 'local');
511
517
  c.className += ' local-folder';
512
518
  c.__onlongpress = null;
513
- c.__meta = { name: 'Back', description: 'Up to ' + parent + ' (or press BACK)' };
519
+ c.__meta = { name: U.t('Back'), description: U.t('Up to {place} (or press BACK)', { place: parent }) };
514
520
  c.__onselect = function () { backInLocal(); };
515
521
  return c;
516
522
  }
@@ -524,7 +530,7 @@
524
530
  if (prog && prog.duration) { var bar = U.el('div', 'prog'); bar.style.width = Math.min(100, prog.position / prog.duration * 100) + '%'; c.appendChild(bar); }
525
531
  if (Player.isWatched(pType, pId)) { c.appendChild(U.el('div', 'card-watched', '✓')); }
526
532
  c.__meta = { name: label, description: x.name + (x.size ? ' · ' + LocalMedia.humanSize(x.size) : '') + ' · ' +
527
- (m ? 'Matched' + (m.fixed ? ' by you' : '') + ': ' + m.name : 'Not matched to a title · long-press to match it') };
533
+ (m ? (m.fixed ? U.t('Matched by you: {name}', { name: m.name }) : U.t('Matched: {name}', { name: m.name })) : U.t('Not matched to a title · long-press to match it')) };
528
534
  c.__onselect = function () {
529
535
  _local.focusRel = x.rel;
530
536
  LocalMedia.play(d, x, _local.listing.entries, function () { renderHome(); });
@@ -539,19 +545,19 @@
539
545
  var label = m ? (m.type === 'series' ? m.name + ' · S' + m.parsed.season + 'E' + m.parsed.episode : m.name) : x.name.replace(/\.[^.]+$/, '');
540
546
  var c = posterCard({ id: x.rel, name: label, poster: m ? m.poster : '' }, 'local');
541
547
  c.className += ' local-sub';
542
- c.appendChild(U.el('div', 'card-new card-code', 'Subtitles'));
543
- c.__meta = { name: label, description: x.name + ' · subtitles · ' +
544
- (m ? 'Matched' + (m.fixed ? ' by you' : '') + ': ' + m.name + ' (offered for its sources)' : 'Not matched to a title · OK to match it') };
548
+ c.appendChild(U.el('div', 'card-new card-code', U.t('Subtitles')));
549
+ c.__meta = { name: label, description: x.name + ' · ' + U.t('subtitles') + ' · ' +
550
+ (m ? (m.fixed ? U.t('Matched by you: {name} (offered for its sources)', { name: m.name }) : U.t('Matched: {name} (offered for its sources)', { name: m.name })) : U.t('Not matched to a title · OK to match it')) };
545
551
  function actions() {
546
552
  var opts = [];
547
- if (m) { opts.push(['page', 'Title page: ' + m.name]); }
548
- opts.push(['match', m ? 'Match to another title…' : 'Match to a title…']);
549
- if (m) { opts.push(['none', 'Not a movie or episode']); }
550
- if (m && m.fixed) { opts.push(['auto', 'Back to the automatic match']); }
553
+ if (m) { opts.push(['page', U.t('Title page: {name}', { name: m.name })]); }
554
+ opts.push(['match', m ? U.t('Match to another title…') : U.t('Match to a title…')]);
555
+ if (m) { opts.push(['none', U.t('Not a movie or episode')]); }
556
+ if (m && m.fixed) { opts.push(['auto', U.t('Back to the automatic match')]); }
551
557
  pickList(x.name, opts, null, function (k) {
552
558
  _local.focusRel = x.rel;
553
559
  if (k === 'page') { App.openDetail(m.type, m.id, { id: m.id, type: m.type, name: m.name, poster: m.poster }, m.type === 'series' ? m.vid : null); }
554
- else if (k === 'none') { LocalMedia.setMatch(x.rel, 0, { none: true }); U.toast('“' + x.name + '”: no title’s'); renderHome(); }
560
+ else if (k === 'none') { LocalMedia.setMatch(x.rel, 0, { none: true }); U.toast(U.t('“{name}”: no title’s', { name: x.name })); renderHome(); }
555
561
  else if (k === 'auto') { LocalMedia.setMatch(x.rel, 0, null); LocalMedia.matchFolder(d, [sx]).then(function () { renderHome(); }); }
556
562
  else if (k === 'match') { matchByHand(d, sx); }
557
563
  });
@@ -561,18 +567,18 @@
561
567
  return c;
562
568
  }
563
569
  function localActions(d, x, m, pType, pId) {
564
- var watched = Player.isWatched(pType, pId), opts = [['play', '▶ Play']];
565
- if (m) { opts.push(['page', 'Title page: ' + m.name]); }
566
- opts.push(['watched', watched ? 'Mark not watched' : 'Mark watched']);
567
- opts.push(['match', m ? 'Match to another title…' : 'Match to a title…']);
568
- if (m) { opts.push(['none', 'Not a movie or episode (a plain file)']); }
569
- if (m && m.fixed) { opts.push(['auto', 'Back to the automatic match']); }
570
+ var watched = Player.isWatched(pType, pId), opts = [['play', U.t('▶ Play')]];
571
+ if (m) { opts.push(['page', U.t('Title page: {name}', { name: m.name })]); }
572
+ opts.push(['watched', watched ? U.t('Mark not watched') : U.t('Mark watched')]);
573
+ opts.push(['match', m ? U.t('Match to another title…') : U.t('Match to a title…')]);
574
+ if (m) { opts.push(['none', U.t('Not a movie or episode (a plain file)')]); }
575
+ if (m && m.fixed) { opts.push(['auto', U.t('Back to the automatic match')]); }
570
576
  pickList(x.name, opts, null, function (k) {
571
577
  _local.focusRel = x.rel;
572
578
  if (k === 'play') { LocalMedia.play(d, x, _local.listing.entries, function () { renderHome(); }); }
573
579
  else if (k === 'page') { App.openDetail(m.type, m.id, { id: m.id, type: m.type, name: m.name, poster: m.poster }, m.type === 'series' ? m.vid : null); }
574
580
  else if (k === 'watched') { Player.setWatched(pType, pId, !watched); renderHome(); }
575
- else if (k === 'none') { LocalMedia.setMatch(x.rel, x.size, { none: true }); U.toast('“' + x.name + '”: a plain file'); renderHome(); }
581
+ else if (k === 'none') { LocalMedia.setMatch(x.rel, x.size, { none: true }); U.toast(U.t('“{name}”: a plain file', { name: x.name })); renderHome(); }
576
582
  else if (k === 'auto') { LocalMedia.setMatch(x.rel, x.size, null); LocalMedia.matchFolder(d, [x]).then(function () { renderHome(); }); }
577
583
  else if (k === 'match') { matchByHand(d, x); }
578
584
  });
@@ -582,29 +588,29 @@
582
588
  var p = LocalMedia.parsedOf(x.rel);
583
589
  function ask(type) {
584
590
  App.openEntry({
585
- title: 'Search for ' + (type === 'series' ? 'a series' : 'a movie'), value: p ? p.title : x.name.replace(/\.[^.]+$/, ''),
586
- hint: '“' + x.name + '”' + (type === 'series' && p && p.kind === 'series' ? ': every episode of the show follows.' : ''),
587
- validate: function (v) { return v ? null : 'Type a name'; },
591
+ title: type === 'series' ? U.t('Search for a series') : U.t('Search for a movie'), value: p ? p.title : x.name.replace(/\.[^.]+$/, ''),
592
+ hint: type === 'series' && p && p.kind === 'series' ? U.t('“{name}”: every episode of the show follows.', { name: x.name }) : '“' + x.name + '”',
593
+ validate: function (v) { return v ? null : U.t('Type a name'); },
588
594
  onConfirm: function (q) {
589
595
  App.back();
590
- U.spinner(true, 'Searching…');
596
+ U.spinner(true, U.t('Searching…'));
591
597
  LocalMedia.searchTitles(type, q).then(function (metas) {
592
598
  U.spinner(false);
593
- if (!metas.length) { U.toast('Nothing found for “' + q + '”'); return; }
594
- pickList('Which one is “' + x.name + '”?', metas.slice(0, 20).map(function (mm) {
599
+ if (!metas.length) { U.toast(U.t('Nothing found for “{q}”', { q: q })); return; }
600
+ pickList(U.t('Which one is “{name}”?', { name: x.name }), metas.slice(0, 20).map(function (mm) {
595
601
  return [mm.id, (mm.name || mm.id) + (mm.releaseInfo ? ' (' + mm.releaseInfo + ')' : '')];
596
602
  }), null, function (id) {
597
603
  var mm = metas.filter(function (y) { return y.id === id; })[0];
598
604
  LocalMedia.setMatch(x.rel, x.size, { id: mm.id, type: type, name: mm.name, poster: mm.poster, releaseInfo: mm.releaseInfo });
599
- U.toast('Matched: ' + mm.name);
605
+ U.toast(U.t('Matched: {name}', { name: mm.name }));
600
606
  renderHome();
601
607
  });
602
- }, function () { U.spinner(false); U.toast('Search failed'); });
608
+ }, function () { U.spinner(false); U.toast(U.t('Search failed')); });
603
609
  }
604
610
  });
605
611
  }
606
612
  if (p && p.kind === 'series') { ask('series'); return; }
607
- pickList('“' + x.name + '” is…', [['movie', 'A movie'], ['series', 'An episode of a series']], p ? p.kind : 'movie', ask);
613
+ pickList(U.t('“{name}” is…', { name: x.name }), [['movie', U.t('A movie')], ['series', U.t('An episode of a series')]], p ? p.kind : 'movie', ask);
608
614
  }
609
615
  // BACK on the Local tab: up a folder (then to the drives, with several), wherever focus is —
610
616
  // an empty folder has nothing to focus but the top menu — and only then the top menu.
@@ -652,18 +658,18 @@
652
658
  c.__onlongpress = function () { continueActions(e, base, preview, target, c); };
653
659
  c.__cwKey = showKey(e);
654
660
  c.__meta = { _id: base, _bg: a.background || e.background || '', _ep: e.type === 'series' && target ? codeOfId(target) : '', name: e.name, description: e.position
655
- ? 'Resume at ' + U.fmtTime(e.position) + (e.duration ? ' of ' + U.fmtTime(e.duration) : '')
656
- : e.upNext !== undefined ? 'Next episode' + (e.upNext ? ': “' + e.upNext + '”' : '') + ' · from Trakt'
657
- : 'Added, not started yet' };
661
+ ? (e.duration ? U.t('Resume at {at} of {length}', { at: U.fmtTime(e.position), length: U.fmtTime(e.duration) }) : U.t('Resume at {at}', { at: U.fmtTime(e.position) }))
662
+ : e.upNext !== undefined ? (e.upNext ? U.t('Next episode: “{title}”', { title: e.upNext }) : U.t('Next episode')) + ' · ' + U.t('from Trakt')
663
+ : U.t('Added, not started yet') };
658
664
  var fresh = e.type === 'series' ? newEpisodeFor(e) : null, soon = notOutYet(e);
659
665
  if (soon) { // (a next episode that hasn't aired: when it does)
660
- c.appendChild(U.el('div', 'card-new card-code', soon === true ? 'Not out yet' : 'Airs ' + U.dayLabel(soon)));
661
- c.__meta.description = 'Next episode' + (e.upNext ? ': “' + e.upNext + '”' : '') + ' · ' + (soon === true ? 'not out yet' : 'airs ' + U.dayLabel(soon)) + (e._trakt ? ' · from Trakt' : '');
666
+ c.appendChild(U.el('div', 'card-new card-code', soon === true ? U.t('Not out yet') : U.t('Airs {when}', { when: U.dayLabel(soon) })));
667
+ c.__meta.description = (e.upNext ? U.t('Next episode: “{title}”', { title: e.upNext }) : U.t('Next episode')) + ' · ' + (soon === true ? U.t('not out yet') : U.t('airs {when}', { when: U.dayLabel(soon) })) + (e._trakt ? ' · ' + U.t('from Trakt') : '');
662
668
  }
663
669
  if (fresh) { // an episode came out since you last watched
664
670
  c.appendChild(U.el('div', 'card-new', 'NEW'));
665
- c.__meta.description = 'New episode: ' + fresh.code + (fresh.title ? ' “' + fresh.title + '”' : '') +
666
- ' · out ' + U.dayLabel(fresh.r) + '. ' + c.__meta.description;
671
+ c.__meta.description = U.t('New episode: {code}', { code: fresh.code + (fresh.title ? ' “' + fresh.title + '”' : '') }) +
672
+ ' · ' + (fresh.r > Date.now() ? U.t('out {when}', { when: U.dayLabel(fresh.r) }) : U.t('came out {when}', { when: U.dayLabel(fresh.r) })) + '. ' + c.__meta.description;
667
673
  }
668
674
  if (e.duration) {
669
675
  var p = U.el('div', 'prog');
@@ -678,7 +684,7 @@
678
684
  var c = posterCard({ id: e.id, name: e.name || ('' + e.id).split('/').pop() }, 'local');
679
685
  c.className += ' local-video';
680
686
  c.__cwKey = showKey(e);
681
- c.__meta = { name: e.name, description: (e.position ? 'Resume at ' + U.fmtTime(e.position) + (e.duration ? ' of ' + U.fmtTime(e.duration) : '') : 'Added, not started yet') + (/^local:\d+:@dav:/.test(e.id) ? ' · in your network folder' : ' · on your USB drive') };
687
+ c.__meta = { name: e.name, description: (e.position ? (e.duration ? U.t('Resume at {at} of {length}', { at: U.fmtTime(e.position), length: U.fmtTime(e.duration) }) : U.t('Resume at {at}', { at: U.fmtTime(e.position) })) : U.t('Added, not started yet')) + ' · ' + (/^local:\d+:@dav:/.test(e.id) ? U.t('in your network folder') : U.t('on your USB drive')) };
682
688
  c.__onselect = function () { LocalMedia.resumePlain(e, function () { renderHome(); }); };
683
689
  c.__onlongpress = function () { continueActions(e, null, null, null, c); };
684
690
  if (e.duration) { var p = U.el('div', 'prog'); p.style.width = Math.min(100, (e.position / e.duration * 100)) + '%'; c.appendChild(p); }
@@ -776,18 +782,18 @@
776
782
  var by = upcomingByDay(now), days = Object.keys(by).map(Number).sort(function (a, b) { return a - b; });
777
783
  if (!days.length) {
778
784
  var any = continueEntries().some(function (e) { return e.type === 'series'; });
779
- rows.appendChild(U.el('div', 'row-empty', any ? 'Coming up: nothing in the next ' + CAL_AHEAD + ' days for the shows you’re watching.'
780
- : 'Coming up: the new episodes of the shows in Watching show here, by day.'));
785
+ rows.appendChild(U.el('div', 'row-empty', any ? U.t('Coming up: nothing in the next {n} days for the shows you’re watching.', { n: CAL_AHEAD })
786
+ : U.t('Coming up: the new episodes of the shows in Watching show here, by day.')));
781
787
  return;
782
788
  }
783
789
  days.forEach(function (d) {
784
790
  // (the same day: by time, then by show, a show's episodes in their order)
785
791
  var list = by[d].sort(function (a, b) { return a.ep.r - b.ep.r || (a.name < b.name ? -1 : a.name > b.name ? 1 : 0) || a.ep.s - b.ep.s || a.ep.e - b.ep.e; });
786
- rows.appendChild(buildRow('Coming up · ' + dayTitle(d), list.map(function (u) {
792
+ rows.appendChild(buildRow(U.t('Coming up') + ' · ' + dayTitle(d), list.map(function (u) {
787
793
  var c = posterCard({ id: u.show, type: 'series', name: u.name, poster: u.poster || calPoster(u.show) }, 'series');
788
794
  var code = epCodeOf(u.ep);
789
795
  c.appendChild(U.el('div', 'card-new card-code', code));
790
- c.__meta = { _id: u.show, name: u.name, description: code + (u.ep.t ? ' “' + u.ep.t + '”' : '') + ' · ' + (u.ep.r > now ? 'out ' : 'came out ') + U.dayLabel(u.ep.r) };
796
+ c.__meta = { _id: u.show, name: u.name, description: code + (u.ep.t ? ' “' + u.ep.t + '”' : '') + ' · ' + (u.ep.r > now ? U.t('out {when}', { when: U.dayLabel(u.ep.r) }) : U.t('came out {when}', { when: U.dayLabel(u.ep.r) })) };
791
797
  c.__onselect = function () { App.openDetail('series', u.show, { name: u.name, poster: u.poster, type: 'series' }, u.ep.id); };
792
798
  c.__onplay = function () { App.openDetail('series', u.show, { name: u.name, poster: u.poster, type: 'series' }, u.ep.id, { playBest: true }); };
793
799
  return c;
@@ -829,8 +835,8 @@
829
835
  function appendWatchedToggle(rows, now) {
830
836
  var t = U.el('div', 'addon-item focusable cal-watched' + (_calWatched ? ' open' : ''));
831
837
  t.setAttribute('data-id', 'cal-watched');
832
- t.appendChild(U.el('div', 'a-name', (_calWatched ? '▾' : '▸') + ' Watched: the last ' + CAL_BACK + ' days'));
833
- t.appendChild(U.el('div', 'a-url', _calWatched ? 'OK to hide them' : 'OK to show what you watched, here' + (typeof Trakt !== 'undefined' && Trakt.isConnected() ? ' and on Trakt' : '')));
838
+ t.appendChild(U.el('div', 'a-name', (_calWatched ? '▾' : '▸') + ' ' + U.t('Watched: the last {n} days', { n: CAL_BACK })));
839
+ t.appendChild(U.el('div', 'a-url', _calWatched ? U.t('OK to hide them') : (typeof Trakt !== 'undefined' && Trakt.isConnected() ? U.t('OK to show what you watched, here and on Trakt') : U.t('OK to show what you watched, here'))));
834
840
  t.__onselect = function () {
835
841
  _calWatched = !_calWatched;
836
842
  renderHome();
@@ -850,22 +856,22 @@
850
856
  });
851
857
  var days = Object.keys(byDay).map(Number).sort(function (a, b) { return b - a; });
852
858
  if (!days.length) {
853
- rows.appendChild(U.el('div', 'row-empty', 'Watched: nothing in the last ' + CAL_BACK + ' days' + (typeof Trakt !== 'undefined' && Trakt.isConnected() ? ', here or on Trakt.' : '.')));
859
+ rows.appendChild(U.el('div', 'row-empty', typeof Trakt !== 'undefined' && Trakt.isConnected() ? U.t('Watched: nothing in the last {n} days, here or on Trakt.', { n: CAL_BACK }) : U.t('Watched: nothing in the last {n} days.', { n: CAL_BACK })));
854
860
  return;
855
861
  }
856
862
  var unnamed = [];
857
863
  days.forEach(function (d) {
858
864
  var titles = Object.keys(byDay[d]).map(function (k) { return byDay[d][k]; }).sort(function (a, b) { return b.at - a.at; });
859
- rows.appendChild(buildRow('Watched · ' + dayTitle(d), titles.map(function (t) {
865
+ rows.appendChild(buildRow(U.t('Watched') + ' · ' + dayTitle(d), titles.map(function (t) {
860
866
  t.eps.sort(function (a, b) { return b.at - a.at; });
861
867
  var c = posterCard({ id: t.base, type: t.type, name: t.name, poster: t.poster }, t.type);
862
868
  var latest = t.eps[0], codes = t.eps.map(function (x) { return codeOfId(x.id); }).filter(Boolean);
863
869
  var partial = t.eps.length === 1 && latest.how === 'partial';
864
870
  var tag = partial ? (latest.pct ? latest.pct + '%' : '…') : codes.length ? codes[0] + (codes.length > 1 ? ' +' + (codes.length - 1) : '') : ''; // (the latest, and how many more)
865
871
  if (tag) { c.appendChild(U.el('div', 'card-new card-code', tag)); }
866
- var what = partial ? 'Stopped part-way' + (latest.pct ? ' (' + latest.pct + '%)' : '') + (codes.length ? ': ' + codes[0] : '')
867
- : 'Watched' + (codes.length ? ' ' + codes.slice().reverse().join(', ') : '');
868
- var where = t.eps.every(function (x) { return x.how === 'trakt'; }) ? ' · on Trakt' : '';
872
+ var what = partial ? U.t('Stopped part-way') + (latest.pct ? ' (' + latest.pct + '%)' : '') + (codes.length ? ': ' + codes[0] : '')
873
+ : U.t('Watched') + (codes.length ? ' ' + codes.slice().reverse().join(', ') : '');
874
+ var where = t.eps.every(function (x) { return x.how === 'trakt'; }) ? ' · ' + U.t('on Trakt') : '';
869
875
  c.__meta = { name: t.name, description: what + where };
870
876
  c.__onselect = function () { App.openDetail(t.type, t.base, { name: c.__meta.name, poster: t.poster, type: t.type }, t.type === 'series' && latest.id !== t.base ? latest.id : null); };
871
877
  if (!t.name) { unnamed.push({ t: t, c: c }); }
@@ -935,7 +941,7 @@
935
941
  var base = e.parent || e.id.split(':')[0], code = e.type === 'series' ? codeOfId(e.id) : '';
936
942
  var name = ('' + (e.name || (showInfoAll()[base] || {}).name || '')).replace(/\s+S\d+E\d+$/, '') || 'StremioK';
937
943
  out.push({ title: name.slice(0, 60),
938
- subtitle: (code ? code + ' · ' : '') + (e.position > 0 ? 'Resume at ' + (e._trakt ? Math.round(e.position) + '%' : U.fmtTime(e.position)) : e.type === 'series' ? 'Next episode' : 'Start watching'),
944
+ subtitle: (code ? code + ' · ' : '') + (e.position > 0 ? U.t('Resume at {at}', { at: e._trakt ? Math.round(e.position) + '%' : U.fmtTime(e.position) }) : e.type === 'series' ? U.t('Next episode') : U.t('Start watching')),
939
945
  image_ratio: '16by9', image_url: 'https://images.metahub.space/background/small/' + base + '/img',
940
946
  action_data: JSON.stringify({ type: e.type, id: e.id, parent: base }), is_playable: false });
941
947
  });
@@ -968,8 +974,8 @@
968
974
  });
969
975
  if (!news.length) { return; }
970
976
  U.store.set(ALERTS_KEY, a);
971
- var shown = news.slice(0, 3).join(' · ') + (news.length > 3 ? ' · and ' + (news.length - 3) + ' more' : '');
972
- U.toast((news.length === 1 ? 'New episode: ' : 'New episodes: ') + shown, 8000);
977
+ var shown = news.slice(0, 3).join(' · ') + (news.length > 3 ? ' · ' + U.t('and {n} more', { n: news.length - 3 }) : '');
978
+ U.toast(U.tn(news.length, 'New episode: {list}', 'New episodes: {list}', { list: shown }), 8000);
973
979
  });
974
980
  }
975
981
  function epCodeOf(x) { return 'S' + x.s + 'E' + x.e; }
@@ -998,26 +1004,26 @@
998
1004
  if (existing) { existing.parentNode.removeChild(existing); }
999
1005
  var overlay = U.el('div', 'modal-overlay');
1000
1006
  var box = U.el('div', 'modal-box actions-box'); // (as wide as its buttons)
1001
- box.appendChild(U.el('div', 'modal-msg', e.name || 'Continue Watching'));
1007
+ box.appendChild(U.el('div', 'modal-msg', e.name || U.t('Continue Watching')));
1002
1008
  var row = U.el('div', 'modal-row');
1003
- var cancel = U.el('div', 'pill focusable modal-btn', 'Cancel');
1004
- var details = U.el('div', 'pill focusable modal-btn', 'Details');
1005
- var remove = U.el('div', 'pill focusable modal-btn danger', 'Remove');
1006
- var move = U.el('div', 'pill focusable modal-btn', 'Move');
1009
+ var cancel = U.el('div', 'pill focusable modal-btn', U.t('Cancel'));
1010
+ var details = U.el('div', 'pill focusable modal-btn', U.t('Details'));
1011
+ var remove = U.el('div', 'pill focusable modal-btn danger', U.t('Remove'));
1012
+ var move = U.el('div', 'pill focusable modal-btn', U.t('Move'));
1007
1013
  // a show: its new-episode alerts off (or on again)
1008
1014
  var showId = e.type === 'series' && base ? showIdOf(e) : '', alerts = null;
1009
1015
  if (showId) {
1010
1016
  var on = alertsOn(showId), showName = ((showInfoAll()[showId] || {}).name) || ('' + (e.name || '')).replace(/\s+S\d+E\d+$/, '');
1011
- alerts = U.el('div', 'pill focusable modal-btn', on ? 'Alerts off' : 'Alerts on');
1017
+ alerts = U.el('div', 'pill focusable modal-btn', on ? U.t('Alerts off') : U.t('Alerts on'));
1012
1018
  alerts.__onselect = function () {
1013
1019
  closeModal();
1014
1020
  setAlerts(showId, !on);
1015
- U.toast(on ? 'No new-episode alerts for ' + showName : 'New-episode alerts for ' + showName + ' again');
1021
+ U.toast(on ? U.t('No new-episode alerts for {show}', { show: showName }) : U.t('New-episode alerts for {show} again', { show: showName }));
1016
1022
  };
1017
1023
  }
1018
- var watched = U.el('div', 'pill focusable modal-btn', 'Mark watched');
1024
+ var watched = U.el('div', 'pill focusable modal-btn', U.t('Mark watched'));
1019
1025
  // Play from start: the same source, from 0:00 (a card with a source saved and a place to resume)
1020
- var restart = (e.url && e.position > 0) ? U.el('div', 'pill focusable modal-btn', 'Play from start') : null;
1026
+ var restart = (e.url && e.position > 0) ? U.el('div', 'pill focusable modal-btn', U.t('Play from start')) : null;
1021
1027
  if (restart) {
1022
1028
  restart.__onselect = function () {
1023
1029
  closeModal();
@@ -1025,9 +1031,9 @@
1025
1031
  App.openDetail(e.type, base, preview, target, { resume: Object.assign({}, e, { fromStart: true }) });
1026
1032
  };
1027
1033
  }
1028
- var recent = cwOrder() ? U.el('div', 'pill focusable modal-btn', 'Recent first') : null;
1034
+ var recent = cwOrder() ? U.el('div', 'pill focusable modal-btn', U.t('Recent first')) : null;
1029
1035
  move.__onselect = function () { closeModal(); startMove(card); };
1030
- if (recent) { recent.__onselect = function () { closeModal(); U.store.remove(CW_ORDER_KEY); U.toast('Continue Watching: most recent first'); renderHome(); }; }
1036
+ if (recent) { recent.__onselect = function () { closeModal(); U.store.remove(CW_ORDER_KEY); U.toast(U.t('Continue Watching: most recent first')); renderHome(); }; }
1031
1037
  cancel.__onselect = function () { closeModal(); };
1032
1038
  details.__onselect = function () { closeModal(); App.openDetail(e.type, base, preview, target); };
1033
1039
  if (!base) { details = null; } // (a plain file from a USB drive: no title page)
@@ -1042,7 +1048,7 @@
1042
1048
  remove.__onselect = function () {
1043
1049
  closeModal();
1044
1050
  dropCard();
1045
- U.toast('Removed from Continue Watching');
1051
+ U.toast(U.t('Removed from Continue Watching'));
1046
1052
  renderHome();
1047
1053
  };
1048
1054
  // Watched (not just off the row): marked watched (Trakt too, when connected), then off
@@ -1133,7 +1139,7 @@
1133
1139
  function cardsOf(grid) { return Array.prototype.slice.call(grid.children); }
1134
1140
  function moveTitle(on) {
1135
1141
  var t = _moving && _moving.grid.parentNode && _moving.grid.parentNode.querySelector('.row-title');
1136
- if (t) { t.textContent = on ? 'Continue Watching · arrows: move it · OK: leave it there · BACK: cancel' : CW_TITLE; }
1142
+ if (t) { t.textContent = on ? U.t('Continue Watching · arrows: move it · OK: leave it there · BACK: cancel') : CW_TITLE; }
1137
1143
  }
1138
1144
  function startMove(card) {
1139
1145
  if (!card || !card.parentNode) { return; }
@@ -1233,8 +1239,8 @@
1233
1239
  // prevFocus: a Home card to put focus back on after the rebuild (the card a title
1234
1240
  // was opened from). Otherwise the card currently focused on Home is kept, so rows
1235
1241
  // refreshed in the background don't move focus.
1236
- var CW_TITLE = 'Continue Watching'; // (holding OK: the corner's "Hold OK for more" says so)
1237
- var UPCOMING_TITLE = 'Upcoming';
1242
+ var CW_TITLE = U.t('Continue Watching'); // (holding OK: the corner's "Hold OK for more" says so)
1243
+ var UPCOMING_TITLE = U.t('Upcoming');
1238
1244
  function renderHome(prevFocus) {
1239
1245
  _moving = null; // (a move not left yet: as it was)
1240
1246
  var s = scr('home');
@@ -1306,11 +1312,11 @@
1306
1312
  }
1307
1313
  refreshShowInfo(entries);
1308
1314
  } else {
1309
- rows.appendChild(U.el('div', 'row-empty', 'Nothing in Continue Watching yet.'));
1315
+ rows.appendChild(U.el('div', 'row-empty', U.t('Nothing in Continue Watching yet.')));
1310
1316
  }
1311
1317
  } else {
1312
1318
  var cats = catsForTab(_homeTab);
1313
- if (!cats.length) { rows.appendChild(U.el('div', 'row-empty', _homeLoading ? 'Loading…' : 'Nothing here yet.')); }
1319
+ if (!cats.length) { rows.appendChild(U.el('div', 'row-empty', _homeLoading ? U.t('Loading…') : U.t('Nothing here yet.'))); }
1314
1320
  else {
1315
1321
  // render at least down to the row focus is going back to
1316
1322
  var need = 0;
@@ -1428,8 +1434,8 @@
1428
1434
  var desc = m.description || '';
1429
1435
  var g = /^iptv:/.test(m.id || '') && typeof EPG !== 'undefined' ? EPG.now(m.id) : null; // a channel: what's on, from its TV guide
1430
1436
  if (g && g.now) {
1431
- bits = ['Now ' + EPG.hhmm(g.now.start) + '–' + EPG.hhmm(g.now.stop) + ' ' + g.now.title];
1432
- desc = (g.now.desc ? g.now.desc + ' ' : '') + (g.next ? 'Next ' + EPG.hhmm(g.next.start) + ' ' + g.next.title : '');
1437
+ bits = [U.t('Now') + ' ' + EPG.hhmm(g.now.start) + '–' + EPG.hhmm(g.now.stop) + ' ' + g.now.title];
1438
+ desc = (g.now.desc ? g.now.desc + ' ' : '') + (g.next ? U.t('Next') + ' ' + EPG.hhmm(g.next.start) + ' ' + g.next.title : '');
1433
1439
  }
1434
1440
  if (ep) { bits.unshift(ep); }
1435
1441
  box.children[1].textContent = bits.join(' · ');
@@ -1521,7 +1527,7 @@
1521
1527
  // fails this time, and swaps the new rows in when they all arrive.
1522
1528
  var _homeFirstLoad = false;
1523
1529
  // A big IPTV playlist takes a while to read: say how far along it is under the spinner.
1524
- function channelsText(n) { return 'Reading IPTV playlists… ' + ('' + n).replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' channels'; }
1530
+ function channelsText(n) { return U.t('Reading IPTV playlists… {n} channels', { n: ('' + n).replace(/\B(?=(\d{3})+(?!\d))/g, ',') }); }
1525
1531
  if (typeof IPTV !== 'undefined' && IPTV.onProgress) {
1526
1532
  IPTV.onProgress(function (n) { if (_homeFirstLoad) { U.spinner(true, channelsText(n)); } });
1527
1533
  }
@@ -1543,7 +1549,7 @@
1543
1549
  (_homeCatalogs || []).forEach(function (c) { old[c.type + '|' + c.name] = c.metas; if (c.loading) { oldLoading[c.type + '|' + c.name] = true; } });
1544
1550
  function oldFor(cat) {
1545
1551
  return cat.type === 'other'
1546
- ? (old['movie|' + otherRowName('Movies', cat.name)] || []).concat(old['series|' + otherRowName('Series', cat.name)] || [])
1552
+ ? (old['movie|' + otherRowName(U.t('Movies'), cat.name)] || []).concat(old['series|' + otherRowName(U.t('Series'), cat.name)] || [])
1547
1553
  : (old[cat.type + '|' + cat.name] || []);
1548
1554
  }
1549
1555
  var before = first ? null : shownSig();
@@ -1618,7 +1624,7 @@
1618
1624
  }, function () {
1619
1625
  done();
1620
1626
  _wantTab = null;
1621
- if (first) { U.toast('Failed to load addons. Check network / Settings.'); }
1627
+ if (first) { U.toast(U.t('Failed to load addons. Check network / Settings.')); }
1622
1628
  });
1623
1629
  }
1624
1630
 
@@ -1662,8 +1668,8 @@
1662
1668
  if (c.type !== 'other' || c.yt) { out.push(copyCat(c, c.all ? c.metas.slice() : c.metas.slice(0, rowCards()))); return; } // (a YouTube one as it is, whatever its type)
1663
1669
  var movies = [], series = [];
1664
1670
  c.metas.forEach(function (m) { (SERIES_NAME.test(m.name || '') ? series : movies).push(m); });
1665
- out.push({ name: otherRowName('Movies', c.name), type: 'movie', metas: movies.slice(0, rowCards()) });
1666
- out.push({ name: otherRowName('Series', c.name), type: 'series', metas: series.slice(0, rowCards()) });
1671
+ out.push({ name: otherRowName(U.t('Movies'), c.name), type: 'movie', metas: movies.slice(0, rowCards()) });
1672
+ out.push({ name: otherRowName(U.t('Series'), c.name), type: 'series', metas: series.slice(0, rowCards()) });
1667
1673
  });
1668
1674
  return out;
1669
1675
  }
@@ -1709,7 +1715,7 @@
1709
1715
  }
1710
1716
  var row = buildRow(c.name, c.metas.slice(0, ROW_FIRST).map(function (m) { return posterCard(m, c.type); }));
1711
1717
  if (c.metas.length > ROW_FIRST) { lateCards(row, c); }
1712
- if (c.loading) { row.className += ' row-loading'; row.appendChild(U.el('div', 'row-empty', 'Loading…')); } // (its place kept: nothing to focus)
1718
+ if (c.loading) { row.className += ' row-loading'; row.appendChild(U.el('div', 'row-empty', U.t('Loading…'))); } // (its place kept: nothing to focus)
1713
1719
  rows.appendChild(row);
1714
1720
  built.push(row);
1715
1721
  }