From 7d8c657fadc2a7b49a413eec9f4d3e7f7b34f6e4 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 9 Dec 2021 07:42:12 +1100 Subject: Moved localised I/O port name lookup into I/O port manager. Added pseudo format specifiers to controller port names: %p for player and %% for literal percent symbol. This lets you get the localised player identifier in overridden input names (see NES and Neo-Geo for examples), and reduces the number of messages to translate. For translators, the new messages are mostly previously existing messages with wording adjusted for clarity (e.g. referring to "media" rather than "ROMs" in several places, as things like disk and tape images are included). It's also possible to localise the "???" dipslayed for an input without a valid name, but that should never actually appear in practice. --- plugins/autofire/autofire_menu.lua | 4 ++-- plugins/commonui/init.lua | 2 +- plugins/inputmacro/inputmacro_menu.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/autofire/autofire_menu.lua b/plugins/autofire/autofire_menu.lua index dea692dd74b..5c87e27a63d 100644 --- a/plugins/autofire/autofire_menu.lua +++ b/plugins/autofire/autofire_menu.lua @@ -90,7 +90,7 @@ local function populate_main_menu(buttons) rate = math.floor(rate * 100) / 100 local text if button.button then - text = string.format(_p('plugin-autofire', '%s [%g Hz]'), _p('input-name', button.button.name), rate) + text = string.format(_p('plugin-autofire', '%s [%g Hz]'), button.button.name, rate) else text = string.format(_p('plugin-autofire', 'n/a [%g Hz]'), rate) end @@ -145,7 +145,7 @@ end local function populate_configure_menu(menu) local button_name if current_button.button then - button_name = _p('input-name', current_button.button.name) + button_name = current_button.button.name elseif current_button.port then button_name = _p('plugin-autofire', 'n/a') else diff --git a/plugins/commonui/init.lua b/plugins/commonui/init.lua index 26b65a5e1b5..16f4b6cc7b0 100644 --- a/plugins/commonui/init.lua +++ b/plugins/commonui/init.lua @@ -82,7 +82,7 @@ function commonui.input_selection_menu(action, title, filter) local selection = index_first_choice for index, field in ipairs(choices) do if field then - table.insert(items, { _p('input-name', field.name), '', '' }) + table.insert(items, { field.name, '', '' }) if initial_selection and (field.port.tag == initial_selection.port.tag) and (field.mask == initial_selection.mask) and (field.type == initial_selection.type) then selection = #items initial_selection = nil diff --git a/plugins/inputmacro/inputmacro_menu.lua b/plugins/inputmacro/inputmacro_menu.lua index 92c18706509..33223e9f20f 100644 --- a/plugins/inputmacro/inputmacro_menu.lua +++ b/plugins/inputmacro/inputmacro_menu.lua @@ -393,7 +393,7 @@ local function add_edit_items(items) for j, input in ipairs(step.inputs) do local inputname if input.field then - inputname = _p('input-name', input.field.name) + inputname = input.field.name elseif input.port then inputname = _p('plugin-inputmacro', 'n/a') else -- cgit v1.2.3