[PATCH] gitk i18n: More markup -- various options menus
Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Christian Stimming committed
Nov 7, 2007 at 18:44 UTC
b007ee20dcf742d951009bf947f4883cb7f8070a
1 file changed
+46
-46
gitk
+46
-46
@@ -769,11 +769,11 @@ proc makewindow {} {
769
label .tf.lbar.flab2 -text " [mc "commit"] " -font uifont
770
pack .tf.lbar.flabel .tf.lbar.fnext .tf.lbar.fprev .tf.lbar.flab2 \
771
-side left -fill y
772
- set gdttype "containing:"
772
+ set gdttype [mc "containing:"]
773
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:"]]
777
trace add variable gdttype write gdttype_change
778
$gm conf -font uifont
779
.tf.lbar.gdttype conf -font uifont
@@ -784,15 +784,15 @@ proc makewindow {} {
784
lappend entries $fstring
785
entry $fstring -width 30 -font textfont -textvariable findstring
786
trace add variable findstring write find_change
787
- set findtype Exact
787
+ set findtype [mc "Exact"]
788
set findtypemenu [tk_optionMenu .tf.lbar.findtype \
789
- findtype Exact IgnCase Regexp]
789
+ findtype [mc "Exact"] [mc "IgnCase"] [mc "Regexp"]]
790
trace add variable findtype write findcom_change
791
.tf.lbar.findtype configure -font uifont
792
.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"]
796
trace add variable findloc write find_change
797
.tf.lbar.findloc configure -font uifont
798
.tf.lbar.findloc.menu configure -font uifont
@@ -1743,12 +1743,12 @@ proc flist_hl {only} {
1743
global flist_menu_file findstring gdttype
1744
1745
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:"]} {
1747
set findstring $x
1748
} else {
1749
append findstring " " $x
1750
}
1751
- set gdttype "touching paths:"
1751
+ set gdttype [mc "touching paths:"]
1752
}
1753
1754
# Functions for adding and removing shell-type quoting
@@ -1998,7 +1998,7 @@ proc delview {} {
1998
1999
if {$curview == 0} return
2000
if {[info exists hlview] && $hlview == $curview} {
2001
- set selectedhlview None
2001
+ set selectedhlview [mc "None"]
2002
unset hlview
2003
}
2004
allviewmenus $curview delete
@@ -2084,7 +2084,7 @@ proc showview {n} {
2084
clear_display
2085
if {[info exists hlview] && $hlview == $n} {
2086
unset hlview
2087
- set selectedhlview None
2087
+ set selectedhlview [mc "None"]
2088
}
2089
catch {unset commitinterest}
2090
@@ -2313,7 +2313,7 @@ proc gdttype_change {name ix op} {
2313
2314
stopfinding
2315
if {$findstring ne {}} {
2316
- if {$gdttype eq "containing:"} {
2316
+ if {$gdttype eq [mc "containing:"]} {
2317
if {$highlight_files ne {}} {
2318
set highlight_files {}
2319
hfiles_change
@@ -2336,7 +2336,7 @@ proc find_change {name ix op} {
2336
global gdttype findstring highlight_files
2337
2338
stopfinding
2339
- if {$gdttype eq "containing:"} {
2339
+ if {$gdttype eq [mc "containing:"]} {
2340
findcom_change
2341
} else {
2342
if {$highlight_files ne $findstring} {
@@ -2360,9 +2360,9 @@ proc findcom_change args {
2360
catch {unset nhighlights}
2361
unbolden
2362
unmarkmatches
2363
- if {$gdttype ne "containing:" || $findstring eq {}} {
2363
+ if {$gdttype ne [mc "containing:"] || $findstring eq {}} {
2364
set findpattern {}
2365
- } elseif {$findtype eq "Regexp"} {
2365
+ } elseif {$findtype eq [mc "Regexp"]} {
2366
set findpattern $findstring
2367
} else {
2368
set e [string map {"*" "\\*" "?" "\\?" "\[" "\\\[" "\\" "\\\\"} \
@@ -2388,12 +2388,12 @@ proc makepatterns {l} {
2388
proc do_file_hl {serial} {
2389
global highlight_files filehighlight highlight_paths gdttype fhl_list
2390
2391
- if {$gdttype eq "touching paths:"} {
2391
+ if {$gdttype eq [mc "touching paths:"]} {
2392
if {[catch {set paths [shellsplit $highlight_files]}]} return
2393
set highlight_paths [makepatterns $paths]
2394
highlight_filelist
2395
set gdtargs [concat -- $paths]
2396
- } elseif {$gdttype eq "adding/removing string:"} {
2396
+ } elseif {$gdttype eq [mc "adding/removing string:"]} {
2397
set gdtargs [list "-S$highlight_files"]
2398
} else {
2399
# must be "containing:", i.e. we're searching commit info
@@ -2469,9 +2469,9 @@ proc readfhighlight {} {
2469
proc doesmatch {f} {
2470
global findtype findpattern
2471
2472
- if {$findtype eq "Regexp"} {
2472
+ if {$findtype eq [mc "Regexp"]} {
2473
return [regexp $findpattern $f]
2474
- } elseif {$findtype eq "IgnCase"} {
2474
+ } elseif {$findtype eq [mc "IgnCase"]} {
2475
return [string match -nocase $findpattern $f]
2476
} else {
2477
return [string match $findpattern $f]
@@ -2488,11 +2488,11 @@ proc askfindhighlight {row id} {
2488
}
2489
set info $commitinfo($id)
2490
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]]
2492
foreach f $info ty $fldtypes {
2493
- if {($findloc eq "All fields" || $findloc eq $ty) &&
2493
+ if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
2494
[doesmatch $f]} {
2495
- if {$ty eq "Author"} {
2495
+ if {$ty eq [mc "Author"]} {
2496
set isbold 2
2497
break
2498
}
@@ -2520,14 +2520,14 @@ proc markrowmatches {row id} {
2520
set author [lindex $commitinfo($id) 1]
2521
$canv delete match$row
2522
$canv2 delete match$row
2523
- if {$findloc eq "All fields" || $findloc eq "Headline"} {
2523
+ if {$findloc eq [mc "All fields"] || $findloc eq [mc "Headline"]} {
2524
set m [findmatches $headline]
2525
if {$m ne {}} {
2526
markmatches $canv $row $headline $linehtag($row) $m \
2527
[$canv itemcget $linehtag($row) -font] $row
2528
}
2529
}
2530
- if {$findloc eq "All fields" || $findloc eq "Author"} {
2530
+ if {$findloc eq [mc "All fields"] || $findloc eq [mc "Author"]} {
2531
set m [findmatches $author]
2532
if {$m ne {}} {
2533
markmatches $canv2 $row $author $linentag($row) $m \
@@ -2540,7 +2540,7 @@ proc vrel_change {name ix op} {
2540
global highlight_related
2541
2542
rhighlight_none
2543
- if {$highlight_related ne "None"} {
2543
+ if {$highlight_related ne [mc "None"]} {
2544
run drawvisible
2545
}
2546
}
@@ -2554,7 +2554,7 @@ proc rhighlight_sel {a} {
2554
set desc_todo [list $a]
2555
catch {unset ancestor}
2556
set anc_todo [list $a]
2557
- if {$highlight_related ne "None"} {
2557
+ if {$highlight_related ne [mc "None"]} {
2558
rhighlight_none
2559
run drawvisible
2560
}
@@ -2637,20 +2637,20 @@ proc askrelhighlight {row id} {
2637
2638
if {![info exists selectedline]} return
2639
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"]} {
2642
if {![info exists descendent($id)]} {
2643
is_descendent $id
2644
}
2645
- if {$descendent($id) == ($highlight_related eq "Descendent")} {
2645
+ if {$descendent($id) == ($highlight_related eq [mc "Descendent"])} {
2646
set isbold 1
2647
}
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"]} {
2650
if {![info exists ancestor($id)]} {
2651
is_ancestor $id
2652
}
2653
- if {$ancestor($id) == ($highlight_related eq "Ancestor")} {
2653
+ if {$ancestor($id) == ($highlight_related eq [mc "Ancestor"])} {
2654
set isbold 1
2655
}
2656
}
@@ -3737,7 +3737,7 @@ proc drawcmitrow {row} {
3737
if {$findpattern ne {} && ![info exists nhighlights($row)]} {
3738
askfindhighlight $row $id
3739
}
3740
- if {$highlight_related ne "None" && ![info exists rhighlights($row)]} {
3740
+ if {$highlight_related ne [mc "None"] && ![info exists rhighlights($row)]} {
3741
askrelhighlight $row $id
3742
}
3743
if {![info exists iddrawn($id)]} {
@@ -4226,11 +4226,11 @@ proc notbusy {what} {
4226
4227
proc findmatches {f} {
4228
global findtype findstring
4229
- if {$findtype == "Regexp"} {
4229
+ if {$findtype == [mc "Regexp"]} {
4230
set matches [regexp -indices -all -inline $findstring $f]
4231
} else {
4232
set fs $findstring
4233
- if {$findtype == "IgnCase"} {
4233
+ if {$findtype == [mc "IgnCase"]} {
4234
set f [string tolower $f]
4235
set fs [string tolower $fs]
4236
}
@@ -4261,8 +4261,8 @@ proc dofind {{dirn 1} {wrap 1}} {
4261
set findstartline $selectedline
4262
}
4263
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]} {
4266
after cancel do_file_hl $fh_serial
4267
do_file_hl $fh_serial
4268
}
@@ -4292,7 +4292,7 @@ proc findmore {} {
4292
if {![info exists find_dirn]} {
4293
return 0
4294
}
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"]]
4296
set l $findcurline
4297
set moretodo 0
4298
if {$find_dirn > 0} {
@@ -4325,7 +4325,7 @@ proc findmore {} {
4325
}
4326
set found 0
4327
set domore 1
4328
- if {$gdttype eq "containing:"} {
4328
+ if {$gdttype eq [mc "containing:"]} {
4329
for {} {$n > 0} {incr n -1; incr l $find_dirn} {
4330
set id [lindex $displayorder $l]
4331
# shouldn't happen unless git log doesn't give all the commits...
@@ -4336,7 +4336,7 @@ proc findmore {} {
4336
}
4337
set info $commitinfo($id)
4338
foreach f $info ty $fldtypes {
4339
- if {($findloc eq "All fields" || $findloc eq $ty) &&
4339
+ if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
4340
[doesmatch $f]} {
4341
set found 1
4342
break
@@ -4392,7 +4392,7 @@ proc findselectline {l} {
4392
set markingmatches 1
4393
set findcurline $l
4394
selectline $l 1
4395
- if {$findloc == "All fields" || $findloc == "Comments"} {
4395
+ if {$findloc == [mc "All fields"] || $findloc == [mc "Comments"]} {
4396
# highlight the matches in the comments
4397
set f [$ctext get 1.0 $commentend]
4398
set matches [findmatches $f]
@@ -4780,7 +4780,7 @@ proc selectline {l isnew} {
4780
$ctext conf -state disabled
4781
set commentend [$ctext index "end - 1c"]
4782
4783
- init_flist "Comments"
4783
+ init_flist [mc "Comments"]
4784
if {$cmitmode eq "tree"} {
4785
gettree $id
4786
} elseif {[llength $olds] <= 1} {
@@ -8632,8 +8632,8 @@ set firsttabstop 0
8632
set nextviewnum 1
8633
set curview 0
8634
set selectedview 0
8635
-set selectedhlview None
8636
-set highlight_related None
8635
+set selectedhlview [mc "None"]
8636
+set highlight_related [mc "None"]
8637
set highlight_files {}
8638
set viewfiles(0) {}
8639
set viewperm(0) 0