diff --git a/scripts/uosc_shared/intl/de.json b/scripts/uosc_shared/intl/de.json index c36357c..e6dfcc9 100644 --- a/scripts/uosc_shared/intl/de.json +++ b/scripts/uosc_shared/intl/de.json @@ -5,6 +5,7 @@ "Audio devices": "Audiogeräte", "Audio tracks": "Audiospuren", "Autoselect device": "Automatische Geräteauswahl", + "Chapter %s": "Kapitel %s", "Chapters": "Kapitel", "Default": "Standard", "Default %s": "Standard %s", diff --git a/scripts/uosc_shared/intl/es.json b/scripts/uosc_shared/intl/es.json index 0e6ffa0..24cd659 100644 --- a/scripts/uosc_shared/intl/es.json +++ b/scripts/uosc_shared/intl/es.json @@ -5,6 +5,7 @@ "Audio devices": "Dispositivos de audio", "Audio tracks": "Pistas de audio", "Autoselect device": "Selección automática", + "Chapter %s": "Capítulo %s", "Chapters": "Capítulos", "Default": "Por defecto", "Default %s": "Por defecto %s", diff --git a/scripts/uosc_shared/intl/fr.json b/scripts/uosc_shared/intl/fr.json index 2f81c44..c58df4d 100644 --- a/scripts/uosc_shared/intl/fr.json +++ b/scripts/uosc_shared/intl/fr.json @@ -5,6 +5,7 @@ "Audio devices": "Périphériques audio", "Audio tracks": "Pistes audio", "Autoselect device": "Sélection automatique", + "Chapter %s": "Chapitre %s", "Chapters": "Chapitres", "Default": "Par défaut", "Default %s": "Par défaut %s", diff --git a/scripts/uosc_shared/intl/ro.json b/scripts/uosc_shared/intl/ro.json index 60f1fe4..5ef35a2 100644 --- a/scripts/uosc_shared/intl/ro.json +++ b/scripts/uosc_shared/intl/ro.json @@ -5,6 +5,7 @@ "Audio devices": "Dispozitive audio", "Audio tracks": "Piese audio", "Autoselect device": "Selectare automată", + "Chapter %s": "Capitolul %s", "Chapters": "Capitole", "Default": "Implicit", "Default %s": "Implicit %s", diff --git a/scripts/uosc_shared/intl/zh-hans.json b/scripts/uosc_shared/intl/zh-hans.json index 9977d8c..44705b8 100644 --- a/scripts/uosc_shared/intl/zh-hans.json +++ b/scripts/uosc_shared/intl/zh-hans.json @@ -7,6 +7,7 @@ "Audio devices": "音频设备", "Audio tracks": "音频轨道", "Autoselect device": "自动选择", + "Chapter %s": "第%s章", "Chapters": "章节", "Default": "默认", "Default %s": "默认 %s", diff --git a/scripts/uosc_shared/lib/utils.lua b/scripts/uosc_shared/lib/utils.lua index f64485c..aaa3d8a 100644 --- a/scripts/uosc_shared/lib/utils.lua +++ b/scripts/uosc_shared/lib/utils.lua @@ -539,7 +539,11 @@ function normalize_chapters(chapters) table.sort(chapters, function(a, b) return a.time < b.time end) -- Ensure titles for index, chapter in ipairs(chapters) do - chapter.title = chapter.title or ('Chapter ' .. index) + local chapter_number = chapter.title and string.match(chapter.title, '^Chapter (%d+)$') + if chapter_number then + chapter.title = t('Chapter %s', tonumber(chapter_number)) + end + chapter.title = chapter.title ~= '(unnamed)' and chapter.title ~= '' and chapter.title or t('Chapter %s', index) chapter.lowercase_title = chapter.title:lower() end return chapters