From 957ebf73682b33793dcceed7028480e153ebedd8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 30 May 2025 13:02:15 +0200 Subject: [PATCH] settingtypes: Add `no-c-format` flag for xgettext --- builtin/common/settings/generate_from_settingtypes.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/common/settings/generate_from_settingtypes.lua b/builtin/common/settings/generate_from_settingtypes.lua index 4c33a8fc1..13b3035ce 100644 --- a/builtin/common/settings/generate_from_settingtypes.lua +++ b/builtin/common/settings/generate_from_settingtypes.lua @@ -102,7 +102,7 @@ end local translation_file_header = [[ // This file is automatically generated // It contains a bunch of fake gettext calls, to tell xgettext about the strings in config files -// To update it, refer to the bottom of builtin/mainmenu/dlg_settings_advanced.lua +// To update it, refer to the bottom of builtin/common/settings/init.lua fake_function() {]] @@ -110,15 +110,15 @@ local function create_translation_file(settings) local result = { translation_file_header } for _, entry in ipairs(settings) do if entry.type == "category" then - insert(result, sprintf("\tgettext(%q);", entry.name)) + insert(result, sprintf("\t/* xgettext:no-c-format */ gettext(%q);", entry.name)) else if entry.readable_name then - insert(result, sprintf("\tgettext(%q);", entry.readable_name)) + insert(result, sprintf("\t/* xgettext:no-c-format */ gettext(%q);", entry.readable_name)) end if entry.comment ~= "" then local comment_escaped = entry.comment:gsub("\n", "\\n") comment_escaped = comment_escaped:gsub("\"", "\\\"") - insert(result, "\tgettext(\"" .. comment_escaped .. "\");") + insert(result, "\t/* xgettext:no-c-format */ gettext(\"" .. comment_escaped .. "\");") end end end