Fix translation in AI panel preferences (fixes #21219)#21252
Fix translation in AI panel preferences (fixes #21219)#21252Mr-Charvaka wants to merge 1 commit into
Conversation
|
How actual string for translations will be populated? There's not task names in this repository. |
73e86f2 to
69aa312
Compare
|
@andriiryzhkov Thank you for pointing this out! You are completely right — since the task names are dynamically loaded from ai_models.json, xgettext would not be able to extract them without a static reference in the codebase. I have updated this PR to declare the possible task names (mask, denoise, rawdenoise, upscale) in a static, unused array marked with N_() at the top of src/gui/preferences_ai.c. This forces xgettext to extract them into po/darktable.pot during the next translation update, making them available to translators while keeping the runtime translation lookup working correctly. |
69aa312 to
a7e331f
Compare
|
Approach with unused array will technically work. However, it will cover only tasks currently defined. If someone adds custom task for use in Lua script, for example, it will not be translated. Also it is an additional and not very obvious maintenance item. Probably fine for now as a workaround. Another topic is translation itself. Tasks serve more like identifiers rather than correct translatable strings. I still think it is not a good idea to translate them. |
Resolves #21219.
Purpose & Goal
This PR fixes untranslated task names (e.g., "denoise", "upscale", "mask") in the preferences AI tab.
Implementation Details
COL_TASK), keeping task keys completely raw._task_cell_data_funcinsrc/gui/preferences_ai.c.task_colusinggtk_tree_view_column_set_cell_data_functo dynamically translate task names only at display time using_(task).N_()task markers to enablexgettextto extract these strings into translation templates.Testing & Verification Approach
xgettextsuccessfully extracts AI task strings.Regression Safety
Keeping tree model values in
COL_TASKraw avoids a configuration storage regression (e.g. where toggling active models saved localized configuration keys likeplugins/preferences/ai/active_model/odszumianieinstead ofdenoiseunder non-English locales).Development Note
This pull request was prepared with AI-assisted pair-programming (using the Gemini-powered Antigravity agent), and has been manually reviewed and refined for correctness.