Commit

0fcec6976e405166c72537f56fc3efa75a69adf8

gitk: avoid constructing dialog titles from text pieces

When the user clicks a color preference, a color selection dialog is
presented whose title is provided in parts by the caller. The dialog
implementation must supply the rest of the title. This is unfriendly
for translations. Provide the full title by the caller. Rewrite the
texts to be more natural language.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Johannes Sixt <j6t@kdbg.org> · 2026-08-03 21:42 UTC

Browse files
1 file changed, +12 −12
modified gitk
@@ -11836,34 +11836,34 @@ proc prefspage_colors {notebook} {
11836 11836 set coloruielems [list \
11837 11837 bg bgcolor {} \
11838 11838 [mc "Background"] \
11839 - [mc "background"] \
11839 + [mc "choose background color"] \
11840 11840 fg fgcolor {} \
11841 11841 [mc "Main text"] \
11842 - [mc "foreground"] \
11842 + [mc "choose main text color"] \
11843 11843 diffold diffcolors 0 \
11844 11844 [mc "Old line text"] \
11845 - [mc "diff old lines"] \
11845 + [mc "choose text color of old lines"] \
11846 11846 diffoldbg diffbgcolors 0 \
11847 11847 [mc "Old line background"] \
11848 - [mc "diff old lines bg"] \
11848 + [mc "choose background color of old lines"] \
11849 11849 diffnew diffcolors 1 \
11850 11850 [mc "New line text"] \
11851 - [mc "diff new lines"] \
11851 + [mc "choose text color of new lines"] \
11852 11852 diffnewbg diffbgcolors 1 \
11853 11853 [mc "New line background"] \
11854 - [mc "diff new lines bg"] \
11854 + [mc "choose background color of new lines"] \
11855 11855 hunksep diffcolors 2 \
11856 11856 [mc "Hunk header text"] \
11857 - [mc "diff hunk header"] \
11857 + [mc "choose text color of hunk headers"] \
11858 11858 markbg markbgcolor {} \
11859 11859 [mc "Marked line background"] \
11860 - [mc "marked line background"] \
11860 + [mc "choose background color of marked lines"] \
11861 11861 selbg selectbgcolor {} \
11862 11862 [mc "Selected text background"] \
11863 - [mc "background"] \
11863 + [mc "choose background color of selected text"] \
11864 11864 linkfg linkfgcolor {} \
11865 11865 [mc "Link text"] \
11866 - [mc "link"] \
11866 + [mc "choose color of link text"] \
11867 11867 ]
11868 11868
11869 11869 foreach {uielem colorvar idx label title} $coloruielems {
@@ -12014,11 +12014,11 @@ proc choose_themeloader {prefspage} {
12014 12014 }
12015 12015 }
12016 12016
12017 - proc choosecolor {v vi prefspage x} {
12017 + proc choosecolor {v vi prefspage title} {
12018 12018 global $v
12019 12019
12020 12020 set c [tk_chooseColor -initialcolor [lindex [set $v] $vi] \
12021 - -title [mc "Gitk: choose color for %s" $x]]
12021 + -title "Gitk: $title"]
12022 12022 if {$c eq {}} return
12023 12023 lset $v $vi $c
12024 12024 set_gui_colors