Many fixes to i18n

This commit is contained in:
2026-04-05 17:43:01 -05:00
parent f0649be5de
commit 8403e30b3a
10 changed files with 1268 additions and 76 deletions

View File

@@ -1,4 +1,18 @@
from youtube import util
from youtube.i18n_strings import (
AUTO,
AUTO_HLS_PREFERRED,
ENGLISH,
ESPANOL,
FORCE_DASH,
FORCE_HLS,
NEWEST,
PLAYBACK_MODE,
RANKING_1,
RANKING_2,
RANKING_3,
TOP,
)
import ast
import re
import os
@@ -139,8 +153,8 @@ For security reasons, enabling this is not recommended.''',
'comment': '''0 to sort by top
1 to sort by newest''',
'options': [
(0, 'Top'),
(1, 'Newest'),
(0, TOP),
(1, NEWEST),
],
}),
@@ -163,7 +177,7 @@ For security reasons, enabling this is not recommended.''',
'default': 'auto',
'comment': '',
'options': [
('auto', 'Auto'),
('auto', AUTO),
('144', '144p'),
('240', '240p'),
('360', '360p'),
@@ -179,12 +193,12 @@ For security reasons, enabling this is not recommended.''',
('playback_mode', {
'type': str,
'default': 'auto',
'label': 'Playback mode',
'label': PLAYBACK_MODE,
'comment': 'HLS uses hls.js (multi-audio). DASH uses av-merge (single audio).',
'options': [
('auto', 'Auto (HLS preferred)'),
('hls', 'Force HLS'),
('dash', 'Force DASH'),
('auto', AUTO_HLS_PREFERRED),
('hls', FORCE_HLS),
('dash', FORCE_DASH),
],
'category': 'playback',
}),
@@ -194,7 +208,7 @@ For security reasons, enabling this is not recommended.''',
'default': 1,
'label': 'AV1 Codec Ranking',
'comment': '',
'options': [(1, '#1'), (2, '#2'), (3, '#3')],
'options': [(1, RANKING_1), (2, RANKING_2), (3, RANKING_3)],
'category': 'playback',
}),
@@ -203,7 +217,7 @@ For security reasons, enabling this is not recommended.''',
'default': 2,
'label': 'VP8/VP9 Codec Ranking',
'comment': '',
'options': [(1, '#1'), (2, '#2'), (3, '#3')],
'options': [(1, RANKING_1), (2, RANKING_2), (3, RANKING_3)],
'category': 'playback',
}),
@@ -212,7 +226,7 @@ For security reasons, enabling this is not recommended.''',
'default': 3,
'label': 'H.264 Codec Ranking',
'comment': '',
'options': [(1, '#1'), (2, '#2'), (3, '#3')],
'options': [(1, RANKING_1), (2, RANKING_2), (3, RANKING_3)],
'category': 'playback',
'description': (
'Which video codecs to prefer. Codecs given the same '
@@ -316,8 +330,8 @@ Archive: https://archive.ph/OZQbN''',
'default': 'en',
'comment': 'Interface language',
'options': [
('en', 'English'),
('es', 'Español'),
('en', ENGLISH),
('es', ESPANOL),
],
'category': 'interface',
}),