Skip to content

Commit b007ee2

Browse files
cstimpaulusmack
authored andcommitted
[PATCH] gitk i18n: More markup -- various options menus
Signed-off-by: Christian Stimming <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 15bc7ba commit b007ee2

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

gitk

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -769,11 +769,11 @@ proc makewindow {} {
769769
label .tf.lbar.flab2 -text " [mc "commit"] " -font uifont
770770
pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
771771
-side left -fill y
772-
set gdttype "containing:"
772+
set gdttype [mc "containing:"]
773773
set gm [tk_optionMenu .tf.lbar.gdttype gdttype \
774-
"containing:" \
775-
"touching paths:" \
776-
"adding/removing string:"]
774+
[mc "containing:"] \
775+
[mc "touching paths:"] \
776+
[mc "adding/removing string:"]]
777777
trace add variable gdttype write gdttype_change
778778
$gm conf -font uifont
779779
.tf.lbar.gdttype conf -font uifont
@@ -784,15 +784,15 @@ proc makewindow {} {
784784
lappend entries $fstring
785785
entry $fstring -width 30 -font textfont -textvariable findstring
786786
trace add variable findstring write find_change
787-
set findtype Exact
787+
set findtype [mc "Exact"]
788788
set findtypemenu [tk_optionMenu .tf.lbar.findtype \
789-
findtype Exact IgnCase Regexp]
789+
findtype [mc "Exact"] [mc "IgnCase"] [mc "Regexp"]]
790790
trace add variable findtype write findcom_change
791791
.tf.lbar.findtype configure -font uifont
792792
.tf.lbar.findtype.menu configure -font uifont
793-
set findloc "All fields"
794-
tk_optionMenu .tf.lbar.findloc findloc "All fields" Headline \
795-
Comments Author Committer
793+
set findloc [mc "All fields"]
794+
tk_optionMenu .tf.lbar.findloc findloc [mc "All fields"] [mc "Headline"] \
795+
[mc "Comments"] [mc "Author"] [mc "Committer"]
796796
trace add variable findloc write find_change
797797
.tf.lbar.findloc configure -font uifont
798798
.tf.lbar.findloc.menu configure -font uifont
@@ -1743,12 +1743,12 @@ proc flist_hl {only} {
17431743
global flist_menu_file findstring gdttype
17441744

17451745
set x [shellquote $flist_menu_file]
1746-
if {$only || $findstring eq {} || $gdttype ne "touching paths:"} {
1746+
if {$only || $findstring eq {} || $gdttype ne [mc "touching paths:"]} {
17471747
set findstring $x
17481748
} else {
17491749
append findstring " " $x
17501750
}
1751-
set gdttype "touching paths:"
1751+
set gdttype [mc "touching paths:"]
17521752
}
17531753

17541754
# Functions for adding and removing shell-type quoting
@@ -1998,7 +1998,7 @@ proc delview {} {
19981998

19991999
if {$curview == 0} return
20002000
if {[info exists hlview] && $hlview == $curview} {
2001-
set selectedhlview None
2001+
set selectedhlview [mc "None"]
20022002
unset hlview
20032003
}
20042004
allviewmenus $curview delete
@@ -2084,7 +2084,7 @@ proc showview {n} {
20842084
clear_display
20852085
if {[info exists hlview] && $hlview == $n} {
20862086
unset hlview
2087-
set selectedhlview None
2087+
set selectedhlview [mc "None"]
20882088
}
20892089
catch {unset commitinterest}
20902090

@@ -2313,7 +2313,7 @@ proc gdttype_change {name ix op} {
23132313

23142314
stopfinding
23152315
if {$findstring ne {}} {
2316-
if {$gdttype eq "containing:"} {
2316+
if {$gdttype eq [mc "containing:"]} {
23172317
if {$highlight_files ne {}} {
23182318
set highlight_files {}
23192319
hfiles_change
@@ -2336,7 +2336,7 @@ proc find_change {name ix op} {
23362336
global gdttype findstring highlight_files
23372337

23382338
stopfinding
2339-
if {$gdttype eq "containing:"} {
2339+
if {$gdttype eq [mc "containing:"]} {
23402340
findcom_change
23412341
} else {
23422342
if {$highlight_files ne $findstring} {
@@ -2360,9 +2360,9 @@ proc findcom_change args {
23602360
catch {unset nhighlights}
23612361
unbolden
23622362
unmarkmatches
2363-
if {$gdttype ne "containing:" || $findstring eq {}} {
2363+
if {$gdttype ne [mc "containing:"] || $findstring eq {}} {
23642364
set findpattern {}
2365-
} elseif {$findtype eq "Regexp"} {
2365+
} elseif {$findtype eq [mc "Regexp"]} {
23662366
set findpattern $findstring
23672367
} else {
23682368
set e [string map {"*" "\\*" "?" "\\?" "\[" "\\\[" "\\" "\\\\"} \
@@ -2388,12 +2388,12 @@ proc makepatterns {l} {
23882388
proc do_file_hl {serial} {
23892389
global highlight_files filehighlight highlight_paths gdttype fhl_list
23902390

2391-
if {$gdttype eq "touching paths:"} {
2391+
if {$gdttype eq [mc "touching paths:"]} {
23922392
if {[catch {set paths [shellsplit $highlight_files]}]} return
23932393
set highlight_paths [makepatterns $paths]
23942394
highlight_filelist
23952395
set gdtargs [concat -- $paths]
2396-
} elseif {$gdttype eq "adding/removing string:"} {
2396+
} elseif {$gdttype eq [mc "adding/removing string:"]} {
23972397
set gdtargs [list "-S$highlight_files"]
23982398
} else {
23992399
# must be "containing:", i.e. we're searching commit info
@@ -2469,9 +2469,9 @@ proc readfhighlight {} {
24692469
proc doesmatch {f} {
24702470
global findtype findpattern
24712471

2472-
if {$findtype eq "Regexp"} {
2472+
if {$findtype eq [mc "Regexp"]} {
24732473
return [regexp $findpattern $f]
2474-
} elseif {$findtype eq "IgnCase"} {
2474+
} elseif {$findtype eq [mc "IgnCase"]} {
24752475
return [string match -nocase $findpattern $f]
24762476
} else {
24772477
return [string match $findpattern $f]
@@ -2488,11 +2488,11 @@ proc askfindhighlight {row id} {
24882488
}
24892489
set info $commitinfo($id)
24902490
set isbold 0
2491-
set fldtypes {Headline Author Date Committer CDate Comments}
2491+
set fldtypes [list [mc Headline] [mc Author] [mc Date] [mc Committer] [mc CDate] [mc Comments]]
24922492
foreach f $info ty $fldtypes {
2493-
if {($findloc eq "All fields" || $findloc eq $ty) &&
2493+
if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
24942494
[doesmatch $f]} {
2495-
if {$ty eq "Author"} {
2495+
if {$ty eq [mc "Author"]} {
24962496
set isbold 2
24972497
break
24982498
}
@@ -2520,14 +2520,14 @@ proc markrowmatches {row id} {
25202520
set author [lindex $commitinfo($id) 1]
25212521
$canv delete match$row
25222522
$canv2 delete match$row
2523-
if {$findloc eq "All fields" || $findloc eq "Headline"} {
2523+
if {$findloc eq [mc "All fields"] || $findloc eq [mc "Headline"]} {
25242524
set m [findmatches $headline]
25252525
if {$m ne {}} {
25262526
markmatches $canv $row $headline $linehtag($row) $m \
25272527
[$canv itemcget $linehtag($row) -font] $row
25282528
}
25292529
}
2530-
if {$findloc eq "All fields" || $findloc eq "Author"} {
2530+
if {$findloc eq [mc "All fields"] || $findloc eq [mc "Author"]} {
25312531
set m [findmatches $author]
25322532
if {$m ne {}} {
25332533
markmatches $canv2 $row $author $linentag($row) $m \
@@ -2540,7 +2540,7 @@ proc vrel_change {name ix op} {
25402540
global highlight_related
25412541

25422542
rhighlight_none
2543-
if {$highlight_related ne "None"} {
2543+
if {$highlight_related ne [mc "None"]} {
25442544
run drawvisible
25452545
}
25462546
}
@@ -2554,7 +2554,7 @@ proc rhighlight_sel {a} {
25542554
set desc_todo [list $a]
25552555
catch {unset ancestor}
25562556
set anc_todo [list $a]
2557-
if {$highlight_related ne "None"} {
2557+
if {$highlight_related ne [mc "None"]} {
25582558
rhighlight_none
25592559
run drawvisible
25602560
}
@@ -2637,20 +2637,20 @@ proc askrelhighlight {row id} {
26372637

26382638
if {![info exists selectedline]} return
26392639
set isbold 0
2640-
if {$highlight_related eq "Descendent" ||
2641-
$highlight_related eq "Not descendent"} {
2640+
if {$highlight_related eq [mc "Descendent"] ||
2641+
$highlight_related eq [mc "Not descendent"]} {
26422642
if {![info exists descendent($id)]} {
26432643
is_descendent $id
26442644
}
2645-
if {$descendent($id) == ($highlight_related eq "Descendent")} {
2645+
if {$descendent($id) == ($highlight_related eq [mc "Descendent"])} {
26462646
set isbold 1
26472647
}
2648-
} elseif {$highlight_related eq "Ancestor" ||
2649-
$highlight_related eq "Not ancestor"} {
2648+
} elseif {$highlight_related eq [mc "Ancestor"] ||
2649+
$highlight_related eq [mc "Not ancestor"]} {
26502650
if {![info exists ancestor($id)]} {
26512651
is_ancestor $id
26522652
}
2653-
if {$ancestor($id) == ($highlight_related eq "Ancestor")} {
2653+
if {$ancestor($id) == ($highlight_related eq [mc "Ancestor"])} {
26542654
set isbold 1
26552655
}
26562656
}
@@ -3737,7 +3737,7 @@ proc drawcmitrow {row} {
37373737
if {$findpattern ne {} && ![info exists nhighlights($row)]} {
37383738
askfindhighlight $row $id
37393739
}
3740-
if {$highlight_related ne "None" && ![info exists rhighlights($row)]} {
3740+
if {$highlight_related ne [mc "None"] && ![info exists rhighlights($row)]} {
37413741
askrelhighlight $row $id
37423742
}
37433743
if {![info exists iddrawn($id)]} {
@@ -4226,11 +4226,11 @@ proc notbusy {what} {
42264226

42274227
proc findmatches {f} {
42284228
global findtype findstring
4229-
if {$findtype == "Regexp"} {
4229+
if {$findtype == [mc "Regexp"]} {
42304230
set matches [regexp -indices -all -inline $findstring $f]
42314231
} else {
42324232
set fs $findstring
4233-
if {$findtype == "IgnCase"} {
4233+
if {$findtype == [mc "IgnCase"]} {
42344234
set f [string tolower $f]
42354235
set fs [string tolower $fs]
42364236
}
@@ -4261,8 +4261,8 @@ proc dofind {{dirn 1} {wrap 1}} {
42614261
set findstartline $selectedline
42624262
}
42634263
set findcurline $findstartline
4264-
nowbusy finding "Searching"
4265-
if {$gdttype ne "containing:" && ![info exists filehighlight]} {
4264+
nowbusy finding [mc "Searching"]
4265+
if {$gdttype ne [mc "containing:"] && ![info exists filehighlight]} {
42664266
after cancel do_file_hl $fh_serial
42674267
do_file_hl $fh_serial
42684268
}
@@ -4292,7 +4292,7 @@ proc findmore {} {
42924292
if {![info exists find_dirn]} {
42934293
return 0
42944294
}
4295-
set fldtypes {Headline Author Date Committer CDate Comments}
4295+
set fldtypes [list [mc "Headline"] [mc "Author"] [mc "Date"] [mc "Committer"] [mc "CDate"] [mc "Comments"]]
42964296
set l $findcurline
42974297
set moretodo 0
42984298
if {$find_dirn > 0} {
@@ -4325,7 +4325,7 @@ proc findmore {} {
43254325
}
43264326
set found 0
43274327
set domore 1
4328-
if {$gdttype eq "containing:"} {
4328+
if {$gdttype eq [mc "containing:"]} {
43294329
for {} {$n > 0} {incr n -1; incr l $find_dirn} {
43304330
set id [lindex $displayorder $l]
43314331
# shouldn't happen unless git log doesn't give all the commits...
@@ -4336,7 +4336,7 @@ proc findmore {} {
43364336
}
43374337
set info $commitinfo($id)
43384338
foreach f $info ty $fldtypes {
4339-
if {($findloc eq "All fields" || $findloc eq $ty) &&
4339+
if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
43404340
[doesmatch $f]} {
43414341
set found 1
43424342
break
@@ -4392,7 +4392,7 @@ proc findselectline {l} {
43924392
set markingmatches 1
43934393
set findcurline $l
43944394
selectline $l 1
4395-
if {$findloc == "All fields" || $findloc == "Comments"} {
4395+
if {$findloc == [mc "All fields"] || $findloc == [mc "Comments"]} {
43964396
# highlight the matches in the comments
43974397
set f [$ctext get 1.0 $commentend]
43984398
set matches [findmatches $f]
@@ -4780,7 +4780,7 @@ proc selectline {l isnew} {
47804780
$ctext conf -state disabled
47814781
set commentend [$ctext index "end - 1c"]
47824782

4783-
init_flist "Comments"
4783+
init_flist [mc "Comments"]
47844784
if {$cmitmode eq "tree"} {
47854785
gettree $id
47864786
} elseif {[llength $olds] <= 1} {
@@ -8632,8 +8632,8 @@ set firsttabstop 0
86328632
set nextviewnum 1
86338633
set curview 0
86348634
set selectedview 0
8635-
set selectedhlview None
8636-
set highlight_related None
8635+
set selectedhlview [mc "None"]
8636+
set highlight_related [mc "None"]
86378637
set highlight_files {}
86388638
set viewfiles(0) {}
86398639
set viewperm(0) 0

0 commit comments

Comments
 (0)