fix: translate built-in menu titles (#539)

This commit is contained in:
Eva
2023-04-27 14:51:50 +02:00
committed by GitHub
parent 618e4728f4
commit f4ef5e8990

View File

@@ -927,21 +927,21 @@ for _, loader in ipairs(track_loaders) do
open_file_navigation_menu(
path,
function(path) mp.commandv(loader.prop .. '-add', path) end,
{type = menu_type, title = 'Load ' .. loader.name, allowed_types = loader.allowed_types}
{type = menu_type, title = t('Load ' .. loader.name), allowed_types = loader.allowed_types}
)
end)
end
bind_command('subtitles', create_select_tracklist_type_menu_opener(
'Subtitles', 'sub', 'sid', 'script-binding uosc/load-subtitles'
t('Subtitles'), 'sub', 'sid', 'script-binding uosc/load-subtitles'
))
bind_command('audio', create_select_tracklist_type_menu_opener(
'Audio', 'audio', 'aid', 'script-binding uosc/load-audio'
t('Audio'), 'audio', 'aid', 'script-binding uosc/load-audio'
))
bind_command('video', create_select_tracklist_type_menu_opener(
'Video', 'video', 'vid', 'script-binding uosc/load-video'
t('Video'), 'video', 'vid', 'script-binding uosc/load-video'
))
bind_command('playlist', create_self_updating_menu_opener({
title = 'Playlist',
title = t('Playlist'),
type = 'playlist',
list_prop = 'playlist',
serializer = function(playlist)
@@ -965,7 +965,7 @@ bind_command('playlist', create_self_updating_menu_opener({
on_delete_item = function(index) mp.commandv('playlist-remove', tostring(index - 1)) end,
}))
bind_command('chapters', create_self_updating_menu_opener({
title = 'Chapters',
title = t('Chapters'),
type = 'chapters',
list_prop = 'chapter-list',
active_prop = 'chapter',
@@ -985,7 +985,7 @@ bind_command('chapters', create_self_updating_menu_opener({
on_select = function(index) mp.commandv('set', 'chapter', tostring(index - 1)) end,
}))
bind_command('editions', create_self_updating_menu_opener({
title = 'Editions',
title = t('Editions'),
type = 'editions',
list_prop = 'edition-list',
active_prop = 'current-edition',
@@ -1032,7 +1032,7 @@ bind_command('stream-quality', function()
items[#items + 1] = {title = height .. 'p', value = format, active = format == ytdl_format}
end
Menu:open({type = 'stream-quality', title = 'Stream quality', items = items}, function(format)
Menu:open({type = 'stream-quality', title = t('Stream quality'), items = items}, function(format)
mp.set_property('ytdl-format', format)
-- Reload the video to apply new format
@@ -1162,7 +1162,7 @@ bind_command('delete-file-quit', function()
mp.command('quit')
end)
bind_command('audio-device', create_self_updating_menu_opener({
title = 'Audio devices',
title = t('Audio devices'),
type = 'audio-device-list',
list_prop = 'audio-device-list',
active_prop = 'audio-device',