@matheusbsbs / matheus-bagliano / commits / 1ac17950e9
Fork 0

Mark strings for translation.

The procedure [mc ...] will translate the strings through msgcat. Strings must be enclosed in quotes, not in braces, because otherwise xgettext cannot extract them properly, although on the Tcl side both delimiters would work fine. [jes: I merged the later patches to that end.] Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Christian Stimming committed Jul 21, 2007 at 14:21 UTC 1ac17950e93a956d01b042db3de70010195eddcc
22 files changed +403 -398
git-gui.sh
+133 -132
@@ -502,7 +502,7 @@ proc tk_optionMenu {w varName args} {
502 set _git [_which git]
503 if {$_git eq {}} {
504 catch {wm withdraw .}
505 - error_popup "Cannot find git in PATH."
505 + error_popup [mc "Cannot find git in PATH."]
506 exit 1
507 }
508
@@ -529,7 +529,7 @@ if {![regsub {^git version } $_git_version {} _git_version]} {
529 -icon error \
530 -type ok \
531 -title "git-gui: fatal error" \
532 - -message "Cannot parse Git version string:\n\n$_git_version"
532 + -message [append [mc "Cannot parse Git version string:"] "\n\n$_git_version"]
533 exit 1
534 }
535
@@ -546,14 +546,14 @@ if {![regexp {^[1-9]+(\.[0-9]+)+$} $_git_version]} {
546 -type yesno \
547 -default no \
548 -title "[appname]: warning" \
549 - -message "Git version cannot be determined.
549 + -message [mc "Git version cannot be determined.
550
551 -$_git claims it is version '$_real_git_version'.
551 +%s claims it is version '%s'.
552
553 -[appname] requires at least Git 1.5.0 or later.
553 +%s requires at least Git 1.5.0 or later.
554
555 -Assume '$_real_git_version' is version 1.5.0?
556 -"] eq {yes}} {
555 +Assume '%s' is version 1.5.0?
556 +" $_git $_real_git_version [appname] $_real_git_version]] eq {yes}} {
557 set _git_version 1.5.0
558 } else {
559 exit 1
@@ -711,7 +711,7 @@ if {[catch {
711 set _prefix [git rev-parse --show-prefix]
712 } err]} {
713 catch {wm withdraw .}
714 - error_popup "Cannot find the git directory:\n\n$err"
714 + error_popup [append [mc "Cannot find the git directory:"] "\n\n$err"]
715 exit 1
716 }
717 if {![file isdirectory $_gitdir] && [is_Cygwin]} {
@@ -719,7 +719,7 @@ if {![file isdirectory $_gitdir] && [is_Cygwin]} {
719 }
720 if {![file isdirectory $_gitdir]} {
721 catch {wm withdraw .}
722 - error_popup "Git directory not found:\n\n$_gitdir"
722 + error_popup [append [mc "Git directory not found:"] "\n\n$_gitdir"]
723 exit 1
724 }
725 if {$_prefix ne {}} {
@@ -733,12 +733,12 @@ if {$_prefix ne {}} {
733 } elseif {![is_enabled bare]} {
734 if {[lindex [file split $_gitdir] end] ne {.git}} {
735 catch {wm withdraw .}
736 - error_popup "Cannot use funny .git directory:\n\n$_gitdir"
736 + error_popup [append [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"]
737 exit 1
738 }
739 if {[catch {cd [file dirname $_gitdir]} err]} {
740 catch {wm withdraw .}
741 - error_popup "No working directory [file dirname $_gitdir]:\n\n$err"
741 + error_popup [append [mc "No working directory"] " [file dirname $_gitdir]:\n\n$err"]
742 exit 1
743 }
744 }
@@ -885,7 +885,7 @@ proc rescan {after {honor_trustmtime 1}} {
885 rescan_stage2 {} $after
886 } else {
887 set rescan_active 1
888 - ui_status {Refreshing file status...}
888 + ui_status [mc "Refreshing file status..."]
889 set fd_rf [git_read update-index \
890 -q \
891 --unmerged \
@@ -922,7 +922,7 @@ proc rescan_stage2 {fd after} {
922 set buf_rlo {}
923
924 set rescan_active 3
925 - ui_status {Scanning for modified files ...}
925 + ui_status [mc "Scanning for modified files ..."]
926 set fd_di [git_read diff-index --cached -z [PARENT]]
927 set fd_df [git_read diff-files -z]
928 set fd_lo [eval git_read ls-files --others -z $ls_others]
@@ -1088,7 +1088,7 @@ proc ui_status {msg} {
1088 }
1089
1090 proc ui_ready {{test {}}} {
1091 - $::main_status show {Ready.} $test
1091 + $::main_status show [mc "Ready."] $test
1092 }
1093
1094 proc escape_path {path} {
@@ -1353,31 +1353,32 @@ set all_icons(O$ui_workdir) file_plain
1353
1354 set max_status_desc 0
1355 foreach i {
1356 - {__ "Unmodified"}
1357 -
1358 - {_M "Modified, not staged"}
1359 - {M_ "Staged for commit"}
1360 - {MM "Portions staged for commit"}
1361 - {MD "Staged for commit, missing"}
1362 -
1363 - {_O "Untracked, not staged"}
1364 - {A_ "Staged for commit"}
1365 - {AM "Portions staged for commit"}
1366 - {AD "Staged for commit, missing"}
1367 -
1368 - {_D "Missing"}
1369 - {D_ "Staged for removal"}
1370 - {DO "Staged for removal, still present"}
1371 -
1372 - {U_ "Requires merge resolution"}
1373 - {UU "Requires merge resolution"}
1374 - {UM "Requires merge resolution"}
1375 - {UD "Requires merge resolution"}
1356 + {__ {mc "Unmodified"}}
1357 +
1358 + {_M {mc "Modified, not staged"}}
1359 + {M_ {mc "Staged for commit"}}
1360 + {MM {mc "Portions staged for commit"}}
1361 + {MD {mc "Staged for commit, missing"}}
1362 +
1363 + {_O {mc "Untracked, not staged"}}
1364 + {A_ {mc "Staged for commit"}}
1365 + {AM {mc "Portions staged for commit"}}
1366 + {AD {mc "Staged for commit, missing"}}
1367 +
1368 + {_D {mc "Missing"}}
1369 + {D_ {mc "Staged for removal"}}
1370 + {DO {mc "Staged for removal, still present"}}
1371 +
1372 + {U_ {mc "Requires merge resolution"}}
1373 + {UU {mc "Requires merge resolution"}}
1374 + {UM {mc "Requires merge resolution"}}
1375 + {UD {mc "Requires merge resolution"}}
1376 } {
1377 - if {$max_status_desc < [string length [lindex $i 1]]} {
1378 - set max_status_desc [string length [lindex $i 1]]
1377 + set text [eval [lindex $i 1]]
1378 + if {$max_status_desc < [string length $text]} {
1379 + set max_status_desc [string length $text]
1380 }
1380 - set all_descs([lindex $i 0]) [lindex $i 1]
1381 + set all_descs([lindex $i 0]) $text
1382 }
1383 unset i
1384
@@ -1416,7 +1417,7 @@ proc incr_font_size {font {amt 1}} {
1417 ##
1418 ## ui commands
1419
1419 -set starting_gitk_msg {Starting gitk... please wait...}
1420 +set starting_gitk_msg [mc "Starting gitk... please wait..."]
1421
1422 proc do_gitk {revs} {
1423 # -- Always start gitk through whatever we were loaded with. This
@@ -1425,7 +1426,7 @@ proc do_gitk {revs} {
1426 set exe [file join [file dirname $::_git] gitk]
1427 set cmd [list [info nameofexecutable] $exe]
1428 if {! [file exists $exe]} {
1428 - error_popup "Unable to start gitk:\n\n$exe does not exist"
1429 + error_popup [mc "Unable to start gitk:\n\n%s does not exist" $exe]
1430 } else {
1431 eval exec $cmd $revs &
1432 ui_status $::starting_gitk_msg
@@ -1642,7 +1643,7 @@ proc apply_config {} {
1643 font configure $font $cn $cv
1644 }
1645 } err]} {
1645 - error_popup "Invalid font specified in gui.$name:\n\n$err"
1646 + error_popup [append [mc "Invalid font specified in gui.%s:" $name] "\n\n$err"]
1647 }
1648 foreach {cn cv} [font configure $font] {
1649 font configure ${font}bold $cn $cv
@@ -1667,8 +1668,8 @@ set default_config(gui.newbranchtemplate) {}
1668 set default_config(gui.fontui) [font configure font_ui]
1669 set default_config(gui.fontdiff) [font configure font_diff]
1670 set font_descs {
1670 - {fontui font_ui {Main Font}}
1671 - {fontdiff font_diff {Diff/Console Font}}
1671 + {fontui font_ui {mc "Main Font"}}
1672 + {fontdiff font_diff {mc "Diff/Console Font"}}
1673 }
1674 load_config 0
1675 apply_config
@@ -1682,18 +1683,18 @@ set ui_comm {}
1683 # -- Menu Bar
1684 #
1685 menu .mbar -tearoff 0
1685 -.mbar add cascade -label Repository -menu .mbar.repository
1686 -.mbar add cascade -label Edit -menu .mbar.edit
1686 +.mbar add cascade -label [mc Repository] -menu .mbar.repository
1687 +.mbar add cascade -label [mc Edit] -menu .mbar.edit
1688 if {[is_enabled branch]} {
1688 - .mbar add cascade -label Branch -menu .mbar.branch
1689 + .mbar add cascade -label [mc Branch] -menu .mbar.branch
1690 }
1691 if {[is_enabled multicommit] || [is_enabled singlecommit]} {
1691 - .mbar add cascade -label Commit -menu .mbar.commit
1692 + .mbar add cascade -label [mc Commit] -menu .mbar.commit
1693 }
1694 if {[is_enabled transport]} {
1694 - .mbar add cascade -label Merge -menu .mbar.merge
1695 - .mbar add cascade -label Fetch -menu .mbar.fetch
1696 - .mbar add cascade -label Push -menu .mbar.push
1695 + .mbar add cascade -label [mc Merge] -menu .mbar.merge
1696 + .mbar add cascade -label [mc Fetch] -menu .mbar.fetch
1697 + .mbar add cascade -label [mc Push] -menu .mbar.push
1698 }
1699 . configure -menu .mbar
1700
@@ -1702,87 +1703,87 @@ if {[is_enabled transport]} {
1703 menu .mbar.repository
1704
1705 .mbar.repository add command \
1705 - -label {Browse Current Branch's Files} \
1706 + -label [mc "Browse Current Branch's Files"] \
1707 -command {browser::new $current_branch}
1708 set ui_browse_current [.mbar.repository index last]
1709 .mbar.repository add command \
1709 - -label {Browse Branch Files...} \
1710 + -label [mc "Browse Branch Files..."] \
1711 -command browser_open::dialog
1712 .mbar.repository add separator
1713
1714 .mbar.repository add command \
1714 - -label {Visualize Current Branch's History} \
1715 + -label [mc "Visualize Current Branch's History"] \
1716 -command {do_gitk $current_branch}
1717 set ui_visualize_current [.mbar.repository index last]
1718 .mbar.repository add command \
1718 - -label {Visualize All Branch History} \
1719 + -label [mc "Visualize All Branch History"] \
1720 -command {do_gitk --all}
1721 .mbar.repository add separator
1722
1723 proc current_branch_write {args} {
1724 global current_branch
1725 .mbar.repository entryconf $::ui_browse_current \
1725 - -label "Browse $current_branch's Files"
1726 + -label [mc "Browse %s's Files" $current_branch]
1727 .mbar.repository entryconf $::ui_visualize_current \
1727 - -label "Visualize $current_branch's History"
1728 + -label [mc "Visualize %s's History" $current_branch]
1729 }
1730 trace add variable current_branch write current_branch_write
1731
1732 if {[is_enabled multicommit]} {
1732 - .mbar.repository add command -label {Database Statistics} \
1733 + .mbar.repository add command -label [mc "Database Statistics"] \
1734 -command do_stats
1735
1735 - .mbar.repository add command -label {Compress Database} \
1736 + .mbar.repository add command -label [mc "Compress Database"] \
1737 -command do_gc
1738
1738 - .mbar.repository add command -label {Verify Database} \
1739 + .mbar.repository add command -label [mc "Verify Database"] \
1740 -command do_fsck_objects
1741
1742 .mbar.repository add separator
1743
1744 if {[is_Cygwin]} {
1745 .mbar.repository add command \
1745 - -label {Create Desktop Icon} \
1746 + -label [mc "Create Desktop Icon"] \
1747 -command do_cygwin_shortcut
1748 } elseif {[is_Windows]} {
1749 .mbar.repository add command \
1749 - -label {Create Desktop Icon} \
1750 + -label [mc "Create Desktop Icon"] \
1751 -command do_windows_shortcut
1752 } elseif {[is_MacOSX]} {
1753 .mbar.repository add command \
1753 - -label {Create Desktop Icon} \
1754 + -label [mc "Create Desktop Icon"] \
1755 -command do_macosx_app
1756 }
1757 }
1758
1758 -.mbar.repository add command -label Quit \
1759 +.mbar.repository add command -label [mc Quit] \
1760 -command do_quit \
1761 -accelerator $M1T-Q
1762
1763 # -- Edit Menu
1764 #
1765 menu .mbar.edit
1765 -.mbar.edit add command -label Undo \
1766 +.mbar.edit add command -label [mc Undo] \
1767 -command {catch {[focus] edit undo}} \
1768 -accelerator $M1T-Z
1768 -.mbar.edit add command -label Redo \
1769 +.mbar.edit add command -label [mc Redo] \
1770 -command {catch {[focus] edit redo}} \
1771 -accelerator $M1T-Y
1772 .mbar.edit add separator
1772 -.mbar.edit add command -label Cut \
1773 +.mbar.edit add command -label [mc Cut] \
1774 -command {catch {tk_textCut [focus]}} \
1775 -accelerator $M1T-X
1775 -.mbar.edit add command -label Copy \
1776 +.mbar.edit add command -label [mc Copy] \
1777 -command {catch {tk_textCopy [focus]}} \
1778 -accelerator $M1T-C
1778 -.mbar.edit add command -label Paste \
1779 +.mbar.edit add command -label [mc Paste] \
1780 -command {catch {tk_textPaste [focus]; [focus] see insert}} \
1781 -accelerator $M1T-V
1781 -.mbar.edit add command -label Delete \
1782 +.mbar.edit add command -label [mc Delete] \
1783 -command {catch {[focus] delete sel.first sel.last}} \
1784 -accelerator Del
1785 .mbar.edit add separator
1785 -.mbar.edit add command -label {Select All} \
1786 +.mbar.edit add command -label [mc "Select All"] \
1787 -command {catch {[focus] tag add sel 0.0 end}} \
1788 -accelerator $M1T-A
1789
@@ -1791,29 +1792,29 @@ menu .mbar.edit
1792 if {[is_enabled branch]} {
1793 menu .mbar.branch
1794
1794 - .mbar.branch add command -label {Create...} \
1795 + .mbar.branch add command -label [mc "Create..."] \
1796 -command branch_create::dialog \
1797 -accelerator $M1T-N
1798 lappend disable_on_lock [list .mbar.branch entryconf \
1799 [.mbar.branch index last] -state]
1800
1800 - .mbar.branch add command -label {Checkout...} \
1801 + .mbar.branch add command -label [mc "Checkout..."] \
1802 -command branch_checkout::dialog \
1803 -accelerator $M1T-O
1804 lappend disable_on_lock [list .mbar.branch entryconf \
1805 [.mbar.branch index last] -state]
1806
1806 - .mbar.branch add command -label {Rename...} \
1807 + .mbar.branch add command -label [mc "Rename..."] \
1808 -command branch_rename::dialog
1809 lappend disable_on_lock [list .mbar.branch entryconf \
1810 [.mbar.branch index last] -state]
1811
1811 - .mbar.branch add command -label {Delete...} \
1812 + .mbar.branch add command -label [mc "Delete..."] \
1813 -command branch_delete::dialog
1814 lappend disable_on_lock [list .mbar.branch entryconf \
1815 [.mbar.branch index last] -state]
1816
1816 - .mbar.branch add command -label {Reset...} \
1817 + .mbar.branch add command -label [mc "Reset..."] \
1818 -command merge::reset_hard
1819 lappend disable_on_lock [list .mbar.branch entryconf \
1820 [.mbar.branch index last] -state]
@@ -1825,7 +1826,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
1826 menu .mbar.commit
1827
1828 .mbar.commit add radiobutton \
1828 - -label {New Commit} \
1829 + -label [mc "New Commit"] \
1830 -command do_select_commit_type \
1831 -variable selected_commit_type \
1832 -value new
@@ -1833,7 +1834,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
1834 [list .mbar.commit entryconf [.mbar.commit index last] -state]
1835
1836 .mbar.commit add radiobutton \
1836 - -label {Amend Last Commit} \
1837 + -label [mc "Amend Last Commit"] \
1838 -command do_select_commit_type \
1839 -variable selected_commit_type \
1840 -value amend
@@ -1842,40 +1843,40 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
1843
1844 .mbar.commit add separator
1845
1845 - .mbar.commit add command -label Rescan \
1846 + .mbar.commit add command -label [mc Rescan] \
1847 -command do_rescan \
1848 -accelerator F5
1849 lappend disable_on_lock \
1850 [list .mbar.commit entryconf [.mbar.commit index last] -state]
1851
1851 - .mbar.commit add command -label {Stage To Commit} \
1852 + .mbar.commit add command -label [mc "Stage To Commit"] \
1853 -command do_add_selection
1854 lappend disable_on_lock \
1855 [list .mbar.commit entryconf [.mbar.commit index last] -state]
1856
1856 - .mbar.commit add command -label {Stage Changed Files To Commit} \
1857 + .mbar.commit add command -label [mc "Stage Changed Files To Commit"] \
1858 -command do_add_all \
1859 -accelerator $M1T-I
1860 lappend disable_on_lock \
1861 [list .mbar.commit entryconf [.mbar.commit index last] -state]
1862
1862 - .mbar.commit add command -label {Unstage From Commit} \
1863 + .mbar.commit add command -label [mc "Unstage From Commit"] \
1864 -command do_unstage_selection
1865 lappend disable_on_lock \
1866 [list .mbar.commit entryconf [.mbar.commit index last] -state]
1867
1867 - .mbar.commit add command -label {Revert Changes} \
1868 + .mbar.commit add command -label [mc "Revert Changes"] \
1869 -command do_revert_selection
1870 lappend disable_on_lock \
1871 [list .mbar.commit entryconf [.mbar.commit index last] -state]
1872
1873 .mbar.commit add separator
1874
1874 - .mbar.commit add command -label {Sign Off} \
1875 + .mbar.commit add command -label [mc "Sign Off"] \
1876 -command do_signoff \
1877 -accelerator $M1T-S
1878
1878 - .mbar.commit add command -label Commit \
1879 + .mbar.commit add command -label [mc Commit] \
1880 -command do_commit \
1881 -accelerator $M1T-Return
1882 lappend disable_on_lock \
@@ -1886,12 +1887,12 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
1887 #
1888 if {[is_enabled branch]} {
1889 menu .mbar.merge
1889 - .mbar.merge add command -label {Local Merge...} \
1890 + .mbar.merge add command -label [mc "Local Merge..."] \
1891 -command merge::dialog \
1892 -accelerator $M1T-M
1893 lappend disable_on_lock \
1894 [list .mbar.merge entryconf [.mbar.merge index last] -state]
1894 - .mbar.merge add command -label {Abort Merge...} \
1895 + .mbar.merge add command -label [mc "Abort Merge..."] \
1896 -command merge::reset_hard
1897 lappend disable_on_lock \
1898 [list .mbar.merge entryconf [.mbar.merge index last] -state]
@@ -1903,38 +1904,38 @@ if {[is_enabled transport]} {
1904 menu .mbar.fetch
1905
1906 menu .mbar.push
1906 - .mbar.push add command -label {Push...} \
1907 + .mbar.push add command -label [mc "Push..."] \
1908 -command do_push_anywhere \
1909 -accelerator $M1T-P
1909 - .mbar.push add command -label {Delete...} \
1910 + .mbar.push add command -label [mc "Delete..."] \
1911 -command remote_branch_delete::dialog
1912 }
1913
1914 if {[is_MacOSX]} {
1915 # -- Apple Menu (Mac OS X only)
1916 #
1916 - .mbar add cascade -label Apple -menu .mbar.apple
1917 + .mbar add cascade -label [mc Apple] -menu .mbar.apple
1918 menu .mbar.apple
1919
1919 - .mbar.apple add command -label "About [appname]" \
1920 + .mbar.apple add command -label [mc "About %s" [appname]] \
1921 -command do_about
1921 - .mbar.apple add command -label "Options..." \
1922 + .mbar.apple add command -label [mc "Options..."] \
1923 -command do_options
1924 } else {
1925 # -- Edit Menu
1926 #
1927 .mbar.edit add separator
1927 - .mbar.edit add command -label {Options...} \
1928 + .mbar.edit add command -label [mc "Options..."] \
1929 -command do_options
1930 }
1931
1932 # -- Help Menu
1933 #
1933 -.mbar add cascade -label Help -menu .mbar.help
1934 +.mbar add cascade -label [mc Help] -menu .mbar.help
1935 menu .mbar.help
1936
1937 if {![is_MacOSX]} {
1937 - .mbar.help add command -label "About [appname]" \
1938 + .mbar.help add command -label [mc "About %s" [appname]] \
1939 -command do_about
1940 }
1941
@@ -1971,7 +1972,7 @@ if {[file isfile $doc_path]} {
1972 }
1973
1974 if {$browser ne {}} {
1974 - .mbar.help add command -label {Online Documentation} \
1975 + .mbar.help add command -label [mc "Online Documentation"] \
1976 -command [list exec $browser $doc_url &]
1977 }
1978 unset browser doc_path doc_url
@@ -2093,7 +2094,7 @@ frame .branch \
2094 -borderwidth 1 \
2095 -relief sunken
2096 label .branch.l1 \
2096 - -text {Current Branch:} \
2097 + -text [mc "Current Branch:"] \
2098 -anchor w \
2099 -justify left
2100 label .branch.cb \
@@ -2114,7 +2115,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
2115 # -- Index File List
2116 #
2117 frame .vpane.files.index -height 100 -width 200
2117 -label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
2118 +label .vpane.files.index.title -text [mc "Staged Changes (Will Be Committed)"] \
2119 -background lightgreen
2120 text $ui_index -background white -borderwidth 0 \
2121 -width 20 -height 10 \
@@ -2134,7 +2135,7 @@ pack $ui_index -side left -fill both -expand 1
2135 # -- Working Directory File List
2136 #
2137 frame .vpane.files.workdir -height 100 -width 200
2137 -label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
2138 +label .vpane.files.workdir.title -text [mc "Unstaged Changes (Will Not Be Committed)"] \
2139 -background lightsalmon
2140 text $ui_workdir -background white -borderwidth 0 \
2141 -width 20 -height 10 \
@@ -2175,29 +2176,29 @@ label .vpane.lower.commarea.buttons.l -text {} \
2176 pack .vpane.lower.commarea.buttons.l -side top -fill x
2177 pack .vpane.lower.commarea.buttons -side left -fill y
2178
2178 -button .vpane.lower.commarea.buttons.rescan -text {Rescan} \
2179 +button .vpane.lower.commarea.buttons.rescan -text [mc Rescan] \
2180 -command do_rescan
2181 pack .vpane.lower.commarea.buttons.rescan -side top -fill x
2182 lappend disable_on_lock \
2183 {.vpane.lower.commarea.buttons.rescan conf -state}
2184
2184 -button .vpane.lower.commarea.buttons.incall -text {Stage Changed} \
2185 +button .vpane.lower.commarea.buttons.incall -text [mc "Stage Changed"] \
2186 -command do_add_all
2187 pack .vpane.lower.commarea.buttons.incall -side top -fill x
2188 lappend disable_on_lock \
2189 {.vpane.lower.commarea.buttons.incall conf -state}
2190
2190 -button .vpane.lower.commarea.buttons.signoff -text {Sign Off} \
2191 +button .vpane.lower.commarea.buttons.signoff -text [mc "Sign Off"] \
2192 -command do_signoff
2193 pack .vpane.lower.commarea.buttons.signoff -side top -fill x
2194
2194 -button .vpane.lower.commarea.buttons.commit -text {Commit} \
2195 +button .vpane.lower.commarea.buttons.commit -text [mc Commit] \
2196 -command do_commit
2197 pack .vpane.lower.commarea.buttons.commit -side top -fill x
2198 lappend disable_on_lock \
2199 {.vpane.lower.commarea.buttons.commit conf -state}
2200
2200 -button .vpane.lower.commarea.buttons.push -text {Push} \
2201 +button .vpane.lower.commarea.buttons.push -text [mc Push] \
2202 -command do_push_anywhere
2203 pack .vpane.lower.commarea.buttons.push -side top -fill x
2204
@@ -2208,14 +2209,14 @@ frame .vpane.lower.commarea.buffer.header
2209 set ui_comm .vpane.lower.commarea.buffer.t
2210 set ui_coml .vpane.lower.commarea.buffer.header.l
2211 radiobutton .vpane.lower.commarea.buffer.header.new \
2211 - -text {New Commit} \
2212 + -text [mc "New Commit"] \
2213 -command do_select_commit_type \
2214 -variable selected_commit_type \
2215 -value new
2216 lappend disable_on_lock \
2217 [list .vpane.lower.commarea.buffer.header.new conf -state]
2218 radiobutton .vpane.lower.commarea.buffer.header.amend \
2218 - -text {Amend Last Commit} \
2219 + -text [mc "Amend Last Commit"] \
2220 -command do_select_commit_type \
2221 -variable selected_commit_type \
2222 -value amend
@@ -2227,12 +2228,12 @@ label $ui_coml \
2228 proc trace_commit_type {varname args} {
2229 global ui_coml commit_type
2230 switch -glob -- $commit_type {
2230 - initial {set txt {Initial Commit Message:}}
2231 - amend {set txt {Amended Commit Message:}}
2232 - amend-initial {set txt {Amended Initial Commit Message:}}
2233 - amend-merge {set txt {Amended Merge Commit Message:}}
2234 - merge {set txt {Merge Commit Message:}}
2235 - * {set txt {Commit Message:}}
2231 + initial {set txt [mc "Initial Commit Message:"]}
2232 + amend {set txt [mc "Amended Commit Message:"]}
2233 + amend-initial {set txt [mc "Amended Initial Commit Message:"]}
2234 + amend-merge {set txt [mc "Amended Merge Commit Message:"]}
2235 + merge {set txt [mc "Merge Commit Message:"]}
2236 + * {set txt [mc "Commit Message:"]}
2237 }
2238 $ui_coml conf -text $txt
2239 }
@@ -2261,23 +2262,23 @@ pack .vpane.lower.commarea.buffer -side left -fill y
2262 set ctxm .vpane.lower.commarea.buffer.ctxm
2263 menu $ctxm -tearoff 0
2264 $ctxm add command \
2264 - -label {Cut} \
2265 + -label [mc Cut] \
2266 -command {tk_textCut $ui_comm}
2267 $ctxm add command \
2267 - -label {Copy} \
2268 + -label [mc Copy] \
2269 -command {tk_textCopy $ui_comm}
2270 $ctxm add command \
2270 - -label {Paste} \
2271 + -label [mc Paste] \
2272 -command {tk_textPaste $ui_comm}
2273 $ctxm add command \
2273 - -label {Delete} \
2274 + -label [mc Delete] \
2275 -command {$ui_comm delete sel.first sel.last}
2276 $ctxm add separator
2277 $ctxm add command \
2277 - -label {Select All} \
2278 + -label [mc "Select All"] \
2279 -command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
2280 $ctxm add command \
2280 - -label {Copy All} \
2281 + -label [mc "Copy All"] \
2282 -command {
2283 $ui_comm tag add sel 0.0 end
2284 tk_textCopy $ui_comm
@@ -2285,7 +2286,7 @@ $ctxm add command \
2286 }
2287 $ctxm add separator
2288 $ctxm add command \
2288 - -label {Sign Off} \
2289 + -label [mc "Sign Off"] \
2290 -command do_signoff
2291 bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
2292
@@ -2301,7 +2302,7 @@ proc trace_current_diff_path {varname args} {
2302 } else {
2303 set p $current_diff_path
2304 set s [mapdesc [lindex $file_states($p) 0] $p]
2304 - set f {File:}
2305 + set f [mc "File:"]
2306 set p [escape_path $p]
2307 set o normal
2308 }
@@ -2335,7 +2336,7 @@ pack .vpane.lower.diff.header.path -fill x
2336 set ctxm .vpane.lower.diff.header.ctxm
2337 menu $ctxm -tearoff 0
2338 $ctxm add command \
2338 - -label {Copy} \
2339 + -label [mc Copy] \
2340 -command {
2341 clipboard clear
2342 clipboard append \
@@ -2403,19 +2404,19 @@ $ui_diff tag raise sel
2404 set ctxm .vpane.lower.diff.body.ctxm
2405 menu $ctxm -tearoff 0
2406 $ctxm add command \
2406 - -label {Refresh} \
2407 + -label [mc Refresh] \
2408 -command reshow_diff
2409 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2410 $ctxm add command \
2410 - -label {Copy} \
2411 + -label [mc Copy] \
2412 -command {tk_textCopy $ui_diff}
2413 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2414 $ctxm add command \
2414 - -label {Select All} \
2415 + -label [mc "Select All"] \
2416 -command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
2417 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2418 $ctxm add command \
2418 - -label {Copy All} \
2419 + -label [mc "Copy All"] \
2420 -command {
2421 $ui_diff tag add sel 0.0 end
2422 tk_textCopy $ui_diff
@@ -2424,36 +2425,36 @@ $ctxm add command \
2425 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2426 $ctxm add separator
2427 $ctxm add command \
2427 - -label {Apply/Reverse Hunk} \
2428 + -label [mc "Apply/Reverse Hunk"] \
2429 -command {apply_hunk $cursorX $cursorY}
2430 set ui_diff_applyhunk [$ctxm index last]
2431 lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
2432 $ctxm add separator
2433 $ctxm add command \
2433 - -label {Decrease Font Size} \
2434 + -label [mc "Decrease Font Size"] \
2435 -command {incr_font_size font_diff -1}
2436 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2437 $ctxm add command \
2437 - -label {Increase Font Size} \
2438 + -label [mc "Increase Font Size"] \
2439 -command {incr_font_size font_diff 1}
2440 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2441 $ctxm add separator
2442 $ctxm add command \
2442 - -label {Show Less Context} \
2443 + -label [mc "Show Less Context"] \
2444 -command {if {$repo_config(gui.diffcontext) >= 1} {
2445 incr repo_config(gui.diffcontext) -1
2446 reshow_diff
2447 }}
2448 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2449 $ctxm add command \
2449 - -label {Show More Context} \
2450 + -label [mc "Show More Context"] \
2451 -command {if {$repo_config(gui.diffcontext) < 99} {
2452 incr repo_config(gui.diffcontext)
2453 reshow_diff
2454 }}
2455 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
2456 $ctxm add separator
2456 -$ctxm add command -label {Options...} \
2457 +$ctxm add command -label [mc "Options..."] \
2458 -command do_options
2459 proc popup_diff_menu {ctxm x y X Y} {
2460 global current_diff_path file_states
@@ -2461,7 +2462,7 @@ proc popup_diff_menu {ctxm x y X Y} {
2462 set ::cursorY $y
2463 if {$::ui_index eq $::current_diff_side} {
2464 set s normal
2464 - set l "Unstage Hunk From Commit"
2465 + set l [mc "Unstage Hunk From Commit"]
2466 } else {
2467 if {$current_diff_path eq {}
2468 || ![info exists file_states($current_diff_path)]
@@ -2470,7 +2471,7 @@ proc popup_diff_menu {ctxm x y X Y} {
2471 } else {
2472 set s normal
2473 }
2473 - set l "Stage Hunk For Commit"
2474 + set l [mc "Stage Hunk For Commit"]
2475 }
2476 if {$::is_3way_diff} {
2477 set s disabled
@@ -2484,7 +2485,7 @@ bind_button3 $ui_diff [list popup_diff_menu $ctxm %x %y %X %Y]
2485 #
2486 set main_status [::status_bar::new .status]
2487 pack .status -anchor w -side bottom -fill x
2487 -$main_status show {Initializing...}
2488 +$main_status show [mc "Initializing..."]
2489
2490 # -- Load geometry
2491 #
lib/blame.tcl
+5 -5
@@ -74,11 +74,11 @@ constructor new {i_commit i_path} {
74 set path $i_path
75
76 make_toplevel top w
77 - wm title $top "[appname] ([reponame]): File Viewer"
77 + wm title $top [append "[appname] ([reponame]): " [mc "File Viewer"]]
78
79 frame $w.header -background gold
80 label $w.header.commit_l \
81 - -text {Commit:} \
81 + -text [mc "Commit:"] \
82 -background gold \
83 -anchor w \
84 -justify left
@@ -101,7 +101,7 @@ constructor new {i_commit i_path} {
101 -anchor w \
102 -justify left
103 label $w.header.path_l \
104 - -text {File:} \
104 + -text [mc "File:"] \
105 -background gold \
106 -anchor w \
107 -justify left
@@ -246,7 +246,7 @@ constructor new {i_commit i_path} {
246
247 menu $w.ctxm -tearoff 0
248 $w.ctxm add command \
249 - -label "Copy Commit" \
249 + -label [mc "Copy Commit"] \
250 -command [cb _copycommit]
251
252 foreach i $w_columns {
@@ -366,7 +366,7 @@ method _load {jump} {
366 set amov_data [list [list]]
367 set asim_data [list [list]]
368
369 - $status show "Reading $commit:[escape_path $path]..."
369 + $status show [mc "Reading %s..." "$commit:[escape_path $path]"]
370 $w_path conf -text [escape_path $path]
371 if {$commit eq {}} {
372 set fd [open $path r]
lib/branch_checkout.tcl
+8 -8
@@ -11,37 +11,37 @@ field opt_detach 0; # force a detached head case?
11
12 constructor dialog {} {
13 make_toplevel top w
14 - wm title $top "[appname] ([reponame]): Checkout Branch"
14 + wm title $top [append "[appname] ([reponame]): " [mc "Checkout Branch"]]
15 if {$top ne {.}} {
16 wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
17 }
18
19 - label $w.header -text {Checkout Branch} -font font_uibold
19 + label $w.header -text [mc "Checkout Branch"] -font font_uibold
20 pack $w.header -side top -fill x
21
22 frame $w.buttons
23 - button $w.buttons.create -text Checkout \
23 + button $w.buttons.create -text [mc Checkout] \
24 -default active \
25 -command [cb _checkout]
26 pack $w.buttons.create -side right
27 - button $w.buttons.cancel -text {Cancel} \
27 + button $w.buttons.cancel -text [mc Cancel] \
28 -command [list destroy $w]
29 pack $w.buttons.cancel -side right -padx 5
30 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
31
32 - set w_rev [::choose_rev::new $w.rev {Revision}]
32 + set w_rev [::choose_rev::new $w.rev [mc Revision]]
33 $w_rev bind_listbox <Double-Button-1> [cb _checkout]
34 pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
35
36 - labelframe $w.options -text {Options}
36 + labelframe $w.options -text [mc Options]
37
38 checkbutton $w.options.fetch \
39 - -text {Fetch Tracking Branch} \
39 + -text [mc "Fetch Tracking Branch"] \
40 -variable @opt_fetch
41 pack $w.options.fetch -anchor nw
42
43 checkbutton $w.options.detach \
44 - -text {Detach From Local Branch} \
44 + -text [mc "Detach From Local Branch"] \
45 -variable @opt_detach
46 pack $w.options.detach -anchor nw
47
lib/branch_create.tcl
+19 -19
@@ -19,28 +19,28 @@ constructor dialog {} {
19 global repo_config
20
21 make_toplevel top w
22 - wm title $top "[appname] ([reponame]): Create Branch"
22 + wm title $top [append "[appname] ([reponame]): " [mc "Create Branch"]]
23 if {$top ne {.}} {
24 wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
25 }
26
27 - label $w.header -text {Create New Branch} -font font_uibold
27 + label $w.header -text [mc "Create New Branch"] -font font_uibold
28 pack $w.header -side top -fill x
29
30 frame $w.buttons
31 - button $w.buttons.create -text Create \
31 + button $w.buttons.create -text [mc Create] \
32 -default active \
33 -command [cb _create]
34 pack $w.buttons.create -side right
35 - button $w.buttons.cancel -text {Cancel} \
35 + button $w.buttons.cancel -text [mc Cancel] \
36 -command [list destroy $w]
37 pack $w.buttons.cancel -side right -padx 5
38 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
39
40 - labelframe $w.desc -text {Branch Name}
40 + labelframe $w.desc -text [mc "Branch Name"]
41 radiobutton $w.desc.name_r \
42 -anchor w \
43 - -text {Name:} \
43 + -text [mc "Name:"] \
44 -value user \
45 -variable @name_type
46 set w_name $w.desc.name_t
@@ -55,7 +55,7 @@ constructor dialog {} {
55
56 radiobutton $w.desc.match_r \
57 -anchor w \
58 - -text {Match Tracking Branch Name} \
58 + -text [mc "Match Tracking Branch Name"] \
59 -value match \
60 -variable @name_type
61 grid $w.desc.match_r -sticky we -padx {0 5} -columnspan 2
@@ -63,38 +63,38 @@ constructor dialog {} {
63 grid columnconfigure $w.desc 1 -weight 1
64 pack $w.desc -anchor nw -fill x -pady 5 -padx 5
65
66 - set w_rev [::choose_rev::new $w.rev {Starting Revision}]
66 + set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
67 pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
68
69 - labelframe $w.options -text {Options}
69 + labelframe $w.options -text [mc Options]
70
71 frame $w.options.merge
72 - label $w.options.merge.l -text {Update Existing Branch:}
72 + label $w.options.merge.l -text [mc "Update Existing Branch:"]
73 pack $w.options.merge.l -side left
74 radiobutton $w.options.merge.no \
75 - -text No \
75 + -text [mc No] \
76 -value none \
77 -variable @opt_merge
78 pack $w.options.merge.no -side left
79 radiobutton $w.options.merge.ff \
80 - -text {Fast Forward Only} \
80 + -text [mc "Fast Forward Only"] \
81 -value ff \
82 -variable @opt_merge
83 pack $w.options.merge.ff -side left
84 radiobutton $w.options.merge.reset \
85 - -text {Reset} \
85 + -text [mc Reset] \
86 -value reset \
87 -variable @opt_merge
88 pack $w.options.merge.reset -side left
89 pack $w.options.merge -anchor nw
90
91 checkbutton $w.options.fetch \
92 - -text {Fetch Tracking Branch} \
92 + -text [mc "Fetch Tracking Branch"] \
93 -variable @opt_fetch
94 pack $w.options.fetch -anchor nw
95
96 checkbutton $w.options.checkout \
97 - -text {Checkout After Creation} \
97 + -text [mc "Checkout After Creation"] \
98 -variable @opt_checkout
99 pack $w.options.checkout -anchor nw
100 pack $w.options -anchor nw -fill x -pady 5 -padx 5
@@ -128,7 +128,7 @@ method _create {} {
128 -type ok \
129 -title [wm title $w] \
130 -parent $w \
131 - -message "Please select a tracking branch."
131 + -message [mc "Please select a tracking branch."]
132 return
133 }
134 if {![regsub ^refs/heads/ [lindex $spec 2] {} newbranch]} {
@@ -137,7 +137,7 @@ method _create {} {
137 -type ok \
138 -title [wm title $w] \
139 -parent $w \
140 - -message "Tracking branch [$w get] is not a branch in the remote repository."
140 + -message [mc "Tracking branch %s is not a branch in the remote repository." [$w get]]
141 return
142 }
143 }
@@ -150,7 +150,7 @@ method _create {} {
150 -type ok \
151 -title [wm title $w] \
152 -parent $w \
153 - -message "Please supply a branch name."
153 + -message [mc "Please supply a branch name."]
154 focus $w_name
155 return
156 }
@@ -161,7 +161,7 @@ method _create {} {
161 -type ok \
162 -title [wm title $w] \
163 -parent $w \
164 - -message "'$newbranch' is not an acceptable branch name."
164 + -message [mc "'%s' is not an acceptable branch name." $newbranch]
165 focus $w_name
166 return
167 }
lib/branch_delete.tcl
+10 -12
@@ -12,29 +12,29 @@ constructor dialog {} {
12 global current_branch
13
14 make_toplevel top w
15 - wm title $top "[appname] ([reponame]): Delete Branch"
15 + wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch"]]
16 if {$top ne {.}} {
17 wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
18 }
19
20 - label $w.header -text {Delete Local Branch} -font font_uibold
20 + label $w.header -text [mc "Delete Local Branch"] -font font_uibold
21 pack $w.header -side top -fill x
22
23 frame $w.buttons
24 set w_delete $w.buttons.delete
25 button $w_delete \
26 - -text Delete \
26 + -text [mc Delete] \
27 -default active \
28 -state disabled \
29 -command [cb _delete]
30 pack $w_delete -side right
31 button $w.buttons.cancel \
32 - -text {Cancel} \
32 + -text [mc Cancel] \
33 -command [list destroy $w]
34 pack $w.buttons.cancel -side right -padx 5
35 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
36
37 - labelframe $w.list -text {Local Branches}
37 + labelframe $w.list -text [mc "Local Branches"]
38 set w_heads $w.list.l
39 listbox $w_heads \
40 -height 10 \
@@ -49,9 +49,9 @@ constructor dialog {} {
49
50 set w_check [choose_rev::new \
51 $w.check \
52 - {Delete Only If Merged Into} \
52 + [mc "Delete Only If Merged Into"] \
53 ]
54 - $w_check none {Always (Do not perform merge test.)}
54 + $w_check none [mc "Always (Do not perform merge test.)"]
55 pack $w.check -anchor nw -fill x -pady 5 -padx 5
56
57 foreach h [load_all_heads] {
@@ -100,7 +100,7 @@ method _delete {} {
100 lappend to_delete [list $b $o]
101 }
102 if {$not_merged ne {}} {
103 - set msg "The following branches are not completely merged into [$w_check get]:
103 + set msg "[mc "The following branches are not completely merged into %s:" [$w_check get]]
104
105 - [join $not_merged "\n - "]"
106 tk_messageBox \
@@ -112,9 +112,7 @@ method _delete {} {
112 }
113 if {$to_delete eq {}} return
114 if {$check_cmt eq {}} {
115 - set msg {Recovering deleted branches is difficult.
116 -
117 -Delete the selected branches?}
115 + set msg [mc "Recovering deleted branches is difficult. \n\n Delete the selected branches?"]
116 if {[tk_messageBox \
117 -icon warning \
118 -type yesno \
@@ -140,7 +138,7 @@ Delete the selected branches?}
138 -type ok \
139 -title [wm title $w] \
140 -parent $w \
143 - -message "Failed to delete branches:\n$failed"
141 + -message [mc "Failed to delete branches:\n%s" $failed]
142 }
143
144 destroy $w
lib/branch_rename.tcl
+11 -11
@@ -11,7 +11,7 @@ constructor dialog {} {
11 global current_branch
12
13 make_toplevel top w
14 - wm title $top "[appname] ([reponame]): Rename Branch"
14 + wm title $top [append "[appname] ([reponame]): " [mc "Rename Branch"]]
15 if {$top ne {.}} {
16 wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
17 }
@@ -19,24 +19,24 @@ constructor dialog {} {
19 set oldname $current_branch
20 set newname [get_config gui.newbranchtemplate]
21
22 - label $w.header -text {Rename Branch} -font font_uibold
22 + label $w.header -text [mc "Rename Branch"] -font font_uibold
23 pack $w.header -side top -fill x
24
25 frame $w.buttons
26 - button $w.buttons.rename -text Rename \
26 + button $w.buttons.rename -text [mc Rename] \
27 -default active \
28 -command [cb _rename]
29 pack $w.buttons.rename -side right
30 - button $w.buttons.cancel -text {Cancel} \
30 + button $w.buttons.cancel -text [mc Cancel] \
31 -command [list destroy $w]
32 pack $w.buttons.cancel -side right -padx 5
33 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
34
35 frame $w.rename
36 - label $w.rename.oldname_l -text {Branch:}
36 + label $w.rename.oldname_l -text [mc "Branch:"]
37 eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]
38
39 - label $w.rename.newname_l -text {New Name:}
39 + label $w.rename.newname_l -text [mc "New Name:"]
40 entry $w.rename.newname_t \
41 -borderwidth 1 \
42 -relief sunken \
@@ -72,7 +72,7 @@ method _rename {} {
72 -type ok \
73 -title [wm title $w] \
74 -parent $w \
75 - -message "Please select a branch to rename."
75 + -message [mc "Please select a branch to rename."]
76 focus $w.rename.oldname_m
77 return
78 }
@@ -83,7 +83,7 @@ method _rename {} {
83 -type ok \
84 -title [wm title $w] \
85 -parent $w \
86 - -message "Please supply a branch name."
86 + -message [mc "Please supply a branch name."]
87 focus $w.rename.newname_t
88 return
89 }
@@ -93,7 +93,7 @@ method _rename {} {
93 -type ok \
94 -title [wm title $w] \
95 -parent $w \
96 - -message "Branch '$newname' already exists."
96 + -message [mc "Branch '%s' already exists." $newname]
97 focus $w.rename.newname_t
98 return
99 }
@@ -103,7 +103,7 @@ method _rename {} {
103 -type ok \
104 -title [wm title $w] \
105 -parent $w \
106 - -message "We do not like '$newname' as a branch name."
106 + -message [mc "'%s' is not an acceptable branch name." $newname]
107 focus $w.rename.newname_t
108 return
109 }
@@ -114,7 +114,7 @@ method _rename {} {
114 -type ok \
115 -title [wm title $w] \
116 -parent $w \
117 - -message "Failed to rename '$oldname'.\n\n$err"
117 + -message [append [mc "Failed to rename '%s'." $oldname] "\n\n$err"]
118 return
119 }
120
lib/browser.tcl
+11 -11
@@ -14,7 +14,7 @@ field w
14 field browser_commit
15 field browser_path
16 field browser_files {}
17 -field browser_status {Starting...}
17 +field browser_status [mc "Starting..."]
18 field browser_stack {}
19 field browser_busy 1
20
@@ -23,7 +23,7 @@ field ls_buf {}; # Buffered record output from ls-tree
23 constructor new {commit {path {}}} {
24 global cursor_ptr M1B
25 make_toplevel top w
26 - wm title $top "[appname] ([reponame]): File Browser"
26 + wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
27
28 set browser_commit $commit
29 set browser_path $browser_commit:$path
@@ -124,7 +124,7 @@ method _parent {} {
124 } else {
125 regsub {/[^/]+$} $browser_path {} browser_path
126 }
127 - set browser_status "Loading $browser_path..."
127 + set browser_status [mc "Loading %s..." $browser_path]
128 _ls $this [lindex $parent 0] [lindex $parent 1]
129 }
130 }
@@ -141,7 +141,7 @@ method _enter {} {
141 tree {
142 set name [lindex $info 2]
143 set escn [escape_path $name]
144 - set browser_status "Loading $escn..."
144 + set browser_status [mc "Loading %s..." $escn]
145 append browser_path $escn
146 _ls $this [lindex $info 1] $name
147 }
@@ -185,7 +185,7 @@ method _ls {tree_id {name {}}} {
185 -align center -padx 5 -pady 1 \
186 -name icon0 \
187 -image ::browser::img_parent
188 - $w insert end {[Up To Parent]}
188 + $w insert end [mc "\[Up To Parent\]"]
189 lappend browser_files parent
190 }
191 lappend browser_stack [list $tree_id $name]
@@ -244,7 +244,7 @@ method _read {fd} {
244
245 if {[eof $fd]} {
246 close $fd
247 - set browser_status Ready.
247 + set browser_status [mc "Ready."]
248 set browser_busy 0
249 set ls_buf {}
250 if {$n > 0} {
@@ -265,27 +265,27 @@ field w_rev ; # mega-widget to pick the initial revision
265
266 constructor dialog {} {
267 make_toplevel top w
268 - wm title $top "[appname] ([reponame]): Browse Branch Files"
268 + wm title $top [append "[appname] ([reponame]): " [mc "Browse Branch Files"]]
269 if {$top ne {.}} {
270 wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
271 }
272
273 label $w.header \
274 - -text {Browse Branch Files} \
274 + -text [mc "Browse Branch Files"] \
275 -font font_uibold
276 pack $w.header -side top -fill x
277
278 frame $w.buttons
279 - button $w.buttons.browse -text Browse \
279 + button $w.buttons.browse -text [mc Browse] \
280 -default active \
281 -command [cb _open]
282 pack $w.buttons.browse -side right
283 - button $w.buttons.cancel -text {Cancel} \
283 + button $w.buttons.cancel -text [mc Cancel] \
284 -command [list destroy $w]
285 pack $w.buttons.cancel -side right -padx 5
286 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
287
288 - set w_rev [::choose_rev::new $w.rev {Revision}]
288 + set w_rev [::choose_rev::new $w.rev [mc Revision]]
289 $w_rev bind_listbox <Double-Button-1> [cb _open]
290 pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
291
lib/checkout_op.tcl
+24 -24
@@ -76,7 +76,7 @@ method run {} {
76 _toplevel $this {Refreshing Tracking Branch}
77 set w_cons [::console::embed \
78 $w.console \
79 - "Fetching $r_name from $remote"]
79 + [mc "Fetching %s from %s" $r_name $remote]]
80 pack $w.console -fill both -expand 1
81 $w_cons exec $cmd [cb _finish_fetch]
82
@@ -137,7 +137,7 @@ method _finish_fetch {ok} {
137 destroy $w
138 set w {}
139 } else {
140 - button $w.close -text Close -command [list destroy $w]
140 + button $w.close -text [mc Close] -command [list destroy $w]
141 pack $w.close -side bottom -anchor e -padx 10 -pady 10
142 }
143
@@ -166,7 +166,7 @@ method _update_ref {} {
166 # Assume it does not exist, and that is what the error was.
167 #
168 if {!$create} {
169 - _error $this "Branch '$newbranch' does not exist."
169 + _error $this [mc "Branch '%s' does not exist." $newbranch]
170 return 0
171 }
172
@@ -176,7 +176,7 @@ method _update_ref {} {
176 # We were told to create it, but not do a merge.
177 # Bad. Name shouldn't have existed.
178 #
179 - _error $this "Branch '$newbranch' already exists."
179 + _error $this [mc "Branch '%s' already exists." $newbranch]
180 return 0
181 } elseif {!$create && $merge_type eq {none}} {
182 # We aren't creating, it exists and we don't merge.
@@ -203,7 +203,7 @@ method _update_ref {} {
203 set new $cur
204 set new_hash $cur
205 } else {
206 - _error $this "Branch '$newbranch' already exists.\n\nIt cannot fast-forward to $new_expr.\nA merge is required."
206 + _error $this [mc "Branch '%s' already exists.\n\nIt cannot fast-forward to %s.\nA merge is required." $newbranch $new_expr]
207 return 0
208 }
209 }
@@ -217,7 +217,7 @@ method _update_ref {} {
217 }
218 }
219 default {
220 - _error $this "Merge strategy '$merge_type' not supported."
220 + _error $this [mc "Merge strategy '%s' not supported." $merge_type]
221 return 0
222 }
223 }
@@ -236,7 +236,7 @@ method _update_ref {} {
236 if {[catch {
237 git update-ref -m $reflog_msg $ref $new $cur
238 } err]} {
239 - _error $this "Failed to update '$newbranch'.\n\n$err"
239 + _error $this [append [mc "Failed to update '%s'." $newbranch] "\n\n$err"]
240 return 0
241 }
242 }
@@ -248,7 +248,7 @@ method _checkout {} {
248 if {[lock_index checkout_op]} {
249 after idle [cb _start_checkout]
250 } else {
251 - _error $this "Staging area (index) is already locked."
251 + _error $this [mc "Staging area (index) is already locked."]
252 delete_this
253 }
254 }
@@ -263,12 +263,12 @@ method _start_checkout {} {
263 && $curType eq {normal}
264 && $curHEAD eq $HEAD} {
265 } elseif {$commit_type ne $curType || $HEAD ne $curHEAD} {
266 - info_popup {Last scanned state does not match repository state.
266 + info_popup [mc "Last scanned state does not match repository state.
267
268 Another Git program has modified this repository since the last scan. A rescan must be performed before the current branch can be changed.
269
270 The rescan will be automatically started now.
271 -}
271 +"]
272 unlock_index
273 rescan ui_ready
274 delete_this
@@ -350,12 +350,12 @@ method _readtree_wait {fd} {
350 if {[catch {close $fd}]} {
351 set err $readtree_d
352 regsub {^fatal: } $err {} err
353 - $::main_status stop "Aborted checkout of '[_name $this]' (file level merging is required)."
354 - warn_popup "File level merge required.
353 + $::main_status stop [mc "Aborted checkout of '%s' (file level merging is required)." [_name $this]]
354 + warn_popup [append [mc "File level merge required."] "
355
356 $err
357
358 -Staying on branch '$current_branch'."
358 +" [mc "Staying on branch '%s'." $current_branch]]
359 unlock_index
360 delete_this
361 return
@@ -426,9 +426,9 @@ method _after_readtree {} {
426 }
427
428 if {$is_detached} {
429 - info_popup "You are no longer on a local branch.
429 + info_popup [mc "You are no longer on a local branch.
430
431 -If you wanted to be on a branch, create one now starting from 'This Detached Checkout'."
431 +If you wanted to be on a branch, create one now starting from 'This Detached Checkout'."]
432 }
433
434 # -- Update our repository state. If we were previously in
@@ -475,7 +475,7 @@ method _confirm_reset {cur} {
475 pack [label $w.msg1 \
476 -anchor w \
477 -justify left \
478 - -text "Resetting '$name' to $new_expr will lose the following commits:" \
478 + -text [mc "Resetting '%s' to '%s' will lose the following commits:" $name $new_expr]\
479 ] -anchor w
480
481 set list $w.list.l
@@ -497,21 +497,21 @@ method _confirm_reset {cur} {
497 pack [label $w.msg2 \
498 -anchor w \
499 -justify left \
500 - -text {Recovering lost commits may not be easy.} \
500 + -text [mc "Recovering lost commits may not be easy."] \
501 ]
502 pack [label $w.msg3 \
503 -anchor w \
504 -justify left \
505 - -text "Reset '$name'?" \
505 + -text [mc "Reset '%s'?" $name] \
506 ]
507
508 frame $w.buttons
509 button $w.buttons.visualize \
510 - -text Visualize \
510 + -text [mc Visualize] \
511 -command $gitk
512 pack $w.buttons.visualize -side left
513 button $w.buttons.reset \
514 - -text Reset \
514 + -text [mc Reset] \
515 -command "
516 set @reset_ok 1
517 destroy $w
@@ -519,7 +519,7 @@ method _confirm_reset {cur} {
519 pack $w.buttons.reset -side right
520 button $w.buttons.cancel \
521 -default active \
522 - -text Cancel \
522 + -text [mc Cancel] \
523 -command [list destroy $w]
524 pack $w.buttons.cancel -side right -padx 5
525 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -575,13 +575,13 @@ method _toplevel {title} {
575 }
576
577 method _fatal {err} {
578 - error_popup "Failed to set current branch.
578 + error_popup [append [mc "Failed to set current branch.
579
580 This working directory is only partially switched. We successfully updated your files, but failed to update an internal Git file.
581
582 -This should not have occurred. [appname] will now close and give up.
582 +This should not have occurred. %s will now close and give up." [appname]] "
583
584 -$err"
584 +$err"]
585 exit 1
586 }
587
lib/choose_rev.tcl
+8 -8
@@ -50,14 +50,14 @@ constructor _new {path unmerged_only title} {
50 if {$is_detached} {
51 radiobutton $w.detachedhead_r \
52 -anchor w \
53 - -text {This Detached Checkout} \
53 + -text [mc "This Detached Checkout"] \
54 -value HEAD \
55 -variable @revtype
56 grid $w.detachedhead_r -sticky we -padx {0 5} -columnspan 2
57 }
58
59 radiobutton $w.expr_r \
60 - -text {Revision Expression:} \
60 + -text [mc "Revision Expression:"] \
61 -value expr \
62 -variable @revtype
63 entry $w.expr_t \
@@ -71,17 +71,17 @@ constructor _new {path unmerged_only title} {
71
72 frame $w.types
73 radiobutton $w.types.head_r \
74 - -text {Local Branch} \
74 + -text [mc "Local Branch"] \
75 -value head \
76 -variable @revtype
77 pack $w.types.head_r -side left
78 radiobutton $w.types.trck_r \
79 - -text {Tracking Branch} \
79 + -text [mc "Tracking Branch"] \
80 -value trck \
81 -variable @revtype
82 pack $w.types.trck_r -side left
83 radiobutton $w.types.tag_r \
84 - -text {Tag} \
84 + -text [mc "Tag"] \
85 -value tag \
86 -variable @revtype
87 pack $w.types.tag_r -side left
@@ -314,7 +314,7 @@ method commit_or_die {} {
314 }
315
316 set top [winfo toplevel $w]
317 - set msg "Invalid revision: [get $this]\n\n$err"
317 + set msg [append [mc "Invalid revision: %s" [get $this]] "\n\n$err"]
318 tk_messageBox \
319 -icon error \
320 -type ok \
@@ -335,7 +335,7 @@ method _expr {} {
335 if {$i ne {}} {
336 return [lindex $cur_specs $i 1]
337 } else {
338 - error "No revision selected."
338 + error [mc "No revision selected."]
339 }
340 }
341
@@ -343,7 +343,7 @@ method _expr {} {
343 if {$c_expr ne {}} {
344 return $c_expr
345 } else {
346 - error "Revision expression is empty."
346 + error [mc "Revision expression is empty."]
347 }
348 }
349 HEAD { return HEAD }
lib/commit.tcl
+26 -26
@@ -6,19 +6,19 @@ proc load_last_commit {} {
6 global repo_config
7
8 if {[llength $PARENT] == 0} {
9 - error_popup {There is nothing to amend.
9 + error_popup [mc "There is nothing to amend.
10
11 You are about to create the initial commit. There is no commit before this to amend.
12 -}
12 +"]
13 return
14 }
15
16 repository_state curType curHEAD curMERGE_HEAD
17 if {$curType eq {merge}} {
18 - error_popup {Cannot amend while merging.
18 + error_popup [mc "Cannot amend while merging.
19
20 You are currently in the middle of a merge that has not been fully completed. You cannot amend the prior commit unless you first abort the current merge activity.
21 -}
21 +"]
22 return
23 }
24
@@ -46,7 +46,7 @@ You are currently in the middle of a merge that has not been fully completed. Y
46 }
47 set msg [string trim $msg]
48 } err]} {
49 - error_popup "Error loading commit data for amend:\n\n$err"
49 + error_popup [append [mc "Error loading commit data for amend:"] "\n\n$err"]
50 return
51 }
52
@@ -73,12 +73,12 @@ proc committer_ident {} {
73
74 if {$GIT_COMMITTER_IDENT eq {}} {
75 if {[catch {set me [git var GIT_COMMITTER_IDENT]} err]} {
76 - error_popup "Unable to obtain your identity:\n\n$err"
76 + error_popup [append [mc "Unable to obtain your identity:"] "\n\n$err"]
77 return {}
78 }
79 if {![regexp {^(.*) [0-9]+ [-+0-9]+$} \
80 $me me GIT_COMMITTER_IDENT]} {
81 - error_popup "Invalid GIT_COMMITTER_IDENT:\n\n$me"
81 + error_popup [append [mc "Invalid GIT_COMMITTER_IDENT:"] "\n\n$me"]
82 return {}
83 }
84 }
@@ -130,12 +130,12 @@ proc commit_tree {} {
130 && $curType eq {normal}
131 && $curHEAD eq $HEAD} {
132 } elseif {$commit_type ne $curType || $HEAD ne $curHEAD} {
133 - info_popup {Last scanned state does not match repository state.
133 + info_popup [mc "Last scanned state does not match repository state.
134
135 Another Git program has modified this repository since the last scan. A rescan must be performed before another commit can be created.
136
137 The rescan will be automatically started now.
138 -}
138 +"]
139 unlock_index
140 rescan ui_ready
141 return
@@ -151,26 +151,26 @@ The rescan will be automatically started now.
151 D? -
152 M? {set files_ready 1}
153 U? {
154 - error_popup "Unmerged files cannot be committed.
154 + error_popup [mc "Unmerged files cannot be committed.
155
156 -File [short_path $path] has merge conflicts. You must resolve them and stage the file before committing.
157 -"
156 +File %s has merge conflicts. You must resolve them and stage the file before committing.
157 +" [short_path $path]]
158 unlock_index
159 return
160 }
161 default {
162 - error_popup "Unknown file state [lindex $s 0] detected.
162 + error_popup [mc "Unknown file state %s detected.
163
164 -File [short_path $path] cannot be committed by this program.
165 -"
164 +File %s cannot be committed by this program.
165 +" [lindex $s 0] [short_path $path]]
166 }
167 }
168 }
169 if {!$files_ready && ![string match *merge $curType]} {
170 - info_popup {No changes to commit.
170 + info_popup [mc "No changes to commit.
171
172 You must stage at least 1 file before you can commit.
173 -}
173 +"]
174 unlock_index
175 return
176 }
@@ -180,14 +180,14 @@ You must stage at least 1 file before you can commit.
180 set msg [string trim [$ui_comm get 1.0 end]]
181 regsub -all -line {[ \t\r]+$} $msg {} msg
182 if {$msg eq {}} {
183 - error_popup {Please supply a commit message.
183 + error_popup [mc "Please supply a commit message.
184
185 A good commit message has the following format:
186
187 - First line: Describe in one sentance what you did.
188 - Second line: Blank
189 - Remaining lines: Describe why this change is good.
190 -}
190 +"]
191 unlock_index
192 return
193 }
@@ -254,7 +254,7 @@ proc commit_committree {fd_wt curHEAD msg} {
254
255 gets $fd_wt tree_id
256 if {$tree_id eq {} || [catch {close $fd_wt} err]} {
257 - error_popup "write-tree failed:\n\n$err"
257 + error_popup [append [mc "write-tree failed:"] "\n\n$err"]
258 ui_status {Commit failed.}
259 unlock_index
260 return
@@ -276,14 +276,14 @@ proc commit_committree {fd_wt curHEAD msg} {
276 }
277
278 if {$tree_id eq $old_tree} {
279 - info_popup {No changes to commit.
279 + info_popup [mc "No changes to commit.
280
281 No files were modified by this commit and it was not a merge commit.
282
283 A rescan will be automatically started now.
284 -}
284 +"]
285 unlock_index
286 - rescan {ui_status {No changes to commit.}}
286 + rescan {ui_status [mc "No changes to commit."]}
287 return
288 }
289 }
@@ -314,7 +314,7 @@ A rescan will be automatically started now.
314 }
315 lappend cmd <$msg_p
316 if {[catch {set cmt_id [eval git $cmd]} err]} {
317 - error_popup "commit-tree failed:\n\n$err"
317 + error_popup [append [mc "commit-tree failed:"] "\n\n$err"]
318 ui_status {Commit failed.}
319 unlock_index
320 return
@@ -336,7 +336,7 @@ A rescan will be automatically started now.
336 if {[catch {
337 git update-ref -m $reflogm HEAD $cmt_id $curHEAD
338 } err]} {
339 - error_popup "update-ref failed:\n\n$err"
339 + error_popup [append [mc "update-ref failed:"] "\n\n$err"]
340 ui_status {Commit failed.}
341 unlock_index
342 return
@@ -427,5 +427,5 @@ A rescan will be automatically started now.
427 display_all_files
428 unlock_index
429 reshow_diff
430 - ui_status "Created commit [string range $cmt_id 0 7]: $subject"
430 + ui_status [mc "Created commit %s: %s" [string range $cmt_id 0 7] $subject]
431 }
lib/console.tcl
+7 -7
@@ -52,7 +52,7 @@ method _init {} {
52 -state disabled \
53 -xscrollcommand [list $w.m.sbx set] \
54 -yscrollcommand [list $w.m.sby set]
55 - label $w.m.s -text {Working... please wait...} \
55 + label $w.m.s -text [mc "Working... please wait..."] \
56 -anchor w \
57 -justify left \
58 -font font_uibold
@@ -66,11 +66,11 @@ method _init {} {
66 pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
67
68 menu $w.ctxm -tearoff 0
69 - $w.ctxm add command -label "Copy" \
69 + $w.ctxm add command -label [mc "Copy"] \
70 -command "tk_textCopy $w.m.t"
71 - $w.ctxm add command -label "Select All" \
71 + $w.ctxm add command -label [mc "Select All"] \
72 -command "focus $w.m.t;$w.m.t tag add sel 0.0 end"
73 - $w.ctxm add command -label "Copy All" \
73 + $w.ctxm add command -label [mc "Copy All"] \
74 -command "
75 $w.m.t tag add sel 0.0 end
76 tk_textCopy $w.m.t
@@ -78,7 +78,7 @@ method _init {} {
78 "
79
80 if {$is_toplevel} {
81 - button $w.ok -text {Close} \
81 + button $w.ok -text [mc "Close"] \
82 -state disabled \
83 -command [list destroy $w]
84 pack $w.ok -side bottom -anchor e -pady 10 -padx 10
@@ -181,7 +181,7 @@ method insert {txt} {
181 method done {ok} {
182 if {$ok} {
183 if {[winfo exists $w.m.s]} {
184 - $w.m.s conf -background green -text {Success}
184 + $w.m.s conf -background green -text [mc "Success"]
185 if {$is_toplevel} {
186 $w.ok conf -state normal
187 focus $w.ok
@@ -191,7 +191,7 @@ method done {ok} {
191 if {![winfo exists $w.m.s]} {
192 _init $this
193 }
194 - $w.m.s conf -background red -text {Error: Command Failed}
194 + $w.m.s conf -background red -text [mc "Error: Command Failed"]
195 if {$is_toplevel} {
196 $w.ok conf -state normal
197 focus $w.ok
lib/database.tcl
+14 -14
@@ -24,14 +24,14 @@ proc do_stats {} {
24 toplevel $w
25 wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
26
27 - label $w.header -text {Database Statistics}
27 + label $w.header -text [mc "Database Statistics"]
28 pack $w.header -side top -fill x
29
30 frame $w.buttons -border 1
31 - button $w.buttons.close -text Close \
31 + button $w.buttons.close -text [mc Close] \
32 -default active \
33 -command [list destroy $w]
34 - button $w.buttons.gc -text {Compress Database} \
34 + button $w.buttons.gc -text [mc "Compress Database"] \
35 -default normal \
36 -command "destroy $w;do_gc"
37 pack $w.buttons.close -side right
@@ -40,16 +40,16 @@ proc do_stats {} {
40
41 frame $w.stat -borderwidth 1 -relief solid
42 foreach s {
43 - {count {Number of loose objects}}
44 - {size {Disk space used by loose objects} { KiB}}
45 - {in-pack {Number of packed objects}}
46 - {packs {Number of packs}}
47 - {size-pack {Disk space used by packed objects} { KiB}}
48 - {prune-packable {Packed objects waiting for pruning}}
49 - {garbage {Garbage files}}
43 + {count {mc "Number of loose objects"}}
44 + {size {mc "Disk space used by loose objects"} { KiB}}
45 + {in-pack {mc "Number of packed objects"}}
46 + {packs {mc "Number of packs"}}
47 + {size-pack {mc "Disk space used by packed objects"} { KiB}}
48 + {prune-packable {mc "Packed objects waiting for pruning"}}
49 + {garbage {mc "Garbage files"}}
50 } {
51 set name [lindex $s 0]
52 - set label [lindex $s 1]
52 + set label [eval [lindex $s 1]]
53 if {[catch {set value $stats($name)}]} continue
54 if {[llength $s] > 2} {
55 set value "$value[lindex $s 2]"
@@ -64,12 +64,12 @@ proc do_stats {} {
64 bind $w <Visibility> "grab $w; focus $w.buttons.close"
65 bind $w <Key-Escape> [list destroy $w]
66 bind $w <Key-Return> [list destroy $w]
67 - wm title $w "[appname] ([reponame]): Database Statistics"
67 + wm title $w [append "[appname] ([reponame]): " [mc "Database Statistics"]]
68 tkwait window $w
69 }
70
71 proc do_gc {} {
72 - set w [console::new {gc} {Compressing the object database}]
72 + set w [console::new {gc} [mc "Compressing the object database"]]
73 console::chain $w {
74 {exec git pack-refs --prune}
75 {exec git reflog expire --all}
@@ -80,7 +80,7 @@ proc do_gc {} {
80
81 proc do_fsck_objects {} {
82 set w [console::new {fsck-objects} \
83 - {Verifying the object database with fsck-objects}]
83 + [mc "Verifying the object database with fsck-objects"]]
84 set cmd [list git fsck-objects]
85 lappend cmd --full
86 lappend cmd --cache
lib/diff.tcl
+8 -8
@@ -39,13 +39,13 @@ proc handle_empty_diff {} {
39 set s $file_states($path)
40 if {[lindex $s 0] ne {_M}} return
41
42 - info_popup "No differences detected.
42 + info_popup [mc "No differences detected.
43
44 -[short_path $path] has no changes.
44 +%s has no changes.
45
46 The modification date of this file was updated by another application, but the content within the file was not changed.
47
48 -A rescan will be automatically started to find other files which may have the same state."
48 +A rescan will be automatically started to find other files which may have the same state." [short_path $path]]
49
50 clear_diff
51 display_file $path __
@@ -94,7 +94,7 @@ proc show_diff {path w {lno {}}} {
94 set diff_active 0
95 unlock_index
96 ui_status "Unable to display [escape_path $path]"
97 - error_popup "Error loading file:\n\n$err"
97 + error_popup [append [mc "Error loading file:"] "\n\n$err"]
98 return
99 }
100 $ui_diff conf -state normal
@@ -159,7 +159,7 @@ proc show_diff {path w {lno {}}} {
159 set diff_active 0
160 unlock_index
161 ui_status "Unable to display [escape_path $path]"
162 - error_popup "Error loading diff:\n\n$err"
162 + error_popup [append [mc "Error loading diff:"] "\n\n$err"]
163 return
164 }
165
@@ -275,14 +275,14 @@ proc apply_hunk {x y} {
275 set apply_cmd {apply --cached --whitespace=nowarn}
276 set mi [lindex $file_states($current_diff_path) 0]
277 if {$current_diff_side eq $ui_index} {
278 - set mode unstage
278 + set failed_msg [mc "Failed to unstage selected hunk."]
279 lappend apply_cmd --reverse
280 if {[string index $mi 0] ne {M}} {
281 unlock_index
282 return
283 }
284 } else {
285 - set mode stage
285 + set failed_msg [mc "Failed to stage selected hunk."]
286 if {[string index $mi 1] ne {M}} {
287 unlock_index
288 return
@@ -307,7 +307,7 @@ proc apply_hunk {x y} {
307 puts -nonewline $p $current_diff_header
308 puts -nonewline $p [$ui_diff get $s_lno $e_lno]
309 close $p} err]} {
310 - error_popup "Failed to $mode selected hunk.\n\n$err"
310 + error_popup [append $failed_msg "\n\n$err"]
311 unlock_index
312 return
313 }
lib/error.tcl
+4 -4
@@ -9,7 +9,7 @@ proc error_popup {msg} {
9 set cmd [list tk_messageBox \
10 -icon error \
11 -type ok \
12 - -title "$title: error" \
12 + -title [append "$title: " [mc "error"]] \
13 -message $msg]
14 if {[winfo ismapped .]} {
15 lappend cmd -parent .
@@ -25,7 +25,7 @@ proc warn_popup {msg} {
25 set cmd [list tk_messageBox \
26 -icon warning \
27 -type ok \
28 - -title "$title: warning" \
28 + -title [append "$title: " [mc "warning"]] \
29 -message $msg]
30 if {[winfo ismapped .]} {
31 lappend cmd -parent .
@@ -78,7 +78,7 @@ proc hook_failed_popup {hook msg} {
78 -font font_diff \
79 -yscrollcommand [list $w.m.sby set]
80 label $w.m.l2 \
81 - -text {You must correct the above errors before committing.} \
81 + -text [mc "You must correct the above errors before committing."] \
82 -anchor w \
83 -justify left \
84 -font font_uibold
@@ -99,6 +99,6 @@ proc hook_failed_popup {hook msg} {
99
100 bind $w <Visibility> "grab $w; focus $w"
101 bind $w <Key-Return> "destroy $w"
102 - wm title $w "[appname] ([reponame]): error"
102 + wm title $w [append "[appname] ([reponame]): " [mc "error"]]
103 tkwait window $w
104 }
lib/index.tcl
+16 -7
@@ -345,26 +345,35 @@ proc revert_helper {txt paths} {
345 }
346 }
347
348 +
349 + # Split question between singular and plural cases, because
350 + # such distinction is needed in some languages. Previously, the
351 + # code used "Revert changes in" for both, but that can't work
352 + # in languages where 'in' must be combined with word from
353 + # rest of string (in diffrent way for both cases of course).
354 + #
355 + # FIXME: Unfortunately, even that isn't enough in some languages
356 + # as they have quite complex plural-form rules. Unfortunately,
357 + # msgcat doesn't seem to support that kind of string translation.
358 + #
359 set n [llength $pathList]
360 if {$n == 0} {
361 unlock_index
362 return
363 } elseif {$n == 1} {
353 - set s "[short_path [lindex $pathList]]"
364 + set query [mc "Revert changes in file %s?" [short_path [lindex $pathList]]]
365 } else {
355 - set s "these $n files"
366 + set query [mc "Revert changes in these %i files?" $n]
367 }
368
369 set reply [tk_dialog \
370 .confirm_revert \
371 "[appname] ([reponame])" \
361 - "Revert changes in $s?
362 -
363 -Any unstaged changes will be permanently lost by the revert." \
372 + [mc "Any unstaged changes will be permanently lost by the revert."] \
373 question \
374 1 \
366 - {Do Nothing} \
367 - {Revert Changes} \
375 + [mc "Do Nothing"] \
376 + [mc "Revert Changes"] \
377 ]
378 if {$reply == 1} {
379 checkout_index \
lib/merge.tcl
+30 -30
@@ -10,10 +10,10 @@ method _can_merge {} {
10 global HEAD commit_type file_states
11
12 if {[string match amend* $commit_type]} {
13 - info_popup {Cannot merge while amending.
13 + info_popup [mc "Cannot merge while amending.
14
15 You must finish amending this commit before starting any type of merge.
16 -}
16 +"]
17 return 0
18 }
19
@@ -24,12 +24,12 @@ You must finish amending this commit before starting any type of merge.
24 #
25 repository_state curType curHEAD curMERGE_HEAD
26 if {$commit_type ne $curType || $HEAD ne $curHEAD} {
27 - info_popup {Last scanned state does not match repository state.
27 + info_popup [mc "Last scanned state does not match repository state.
28
29 Another Git program has modified this repository since the last scan. A rescan must be performed before a merge can be performed.
30
31 The rescan will be automatically started now.
32 -}
32 +"]
33 unlock_index
34 rescan ui_ready
35 return 0
@@ -41,22 +41,22 @@ The rescan will be automatically started now.
41 continue; # and pray it works!
42 }
43 U? {
44 - error_popup "You are in the middle of a conflicted merge.
44 + error_popup [mc "You are in the middle of a conflicted merge.
45
46 -File [short_path $path] has merge conflicts.
46 +File %s has merge conflicts.
47
48 You must resolve them, stage the file, and commit to complete the current merge. Only then can you begin another merge.
49 -"
49 +" [short_path $path]]
50 unlock_index
51 return 0
52 }
53 ?? {
54 - error_popup "You are in the middle of a change.
54 + error_popup [mc "You are in the middle of a change.
55
56 -File [short_path $path] is modified.
56 +File %s is modified.
57
58 You should complete the current commit before starting a merge. Doing so will help you abort a failed merge, should the need arise.
59 -"
59 +" [short_path $path]]
60 unlock_index
61 return 0
62 }
@@ -103,7 +103,7 @@ method _start {} {
103 regsub {^[^:@]*@} $remote {} remote
104 }
105 set branch [lindex $spec 2]
106 - set stitle "$branch of $remote"
106 + set stitle [mc "%s of %s" $branch $remote]
107 }
108 regsub ^refs/heads/ $branch {} branch
109 puts $fh "$cmit\t\tbranch '$branch' of $remote"
@@ -116,9 +116,9 @@ method _start {} {
116 lappend cmd HEAD
117 lappend cmd $name
118
119 - set msg "Merging $current_branch and $stitle"
119 + set msg [mc "Merging %s and %s" $current_branch $stitle]
120 ui_status "$msg..."
121 - set cons [console::new "Merge" "merge $stitle"]
121 + set cons [console::new [mc "Merge"] "merge $stitle"]
122 console::exec $cons $cmd [cb _finish $cons]
123
124 wm protocol $w WM_DELETE_WINDOW {}
@@ -128,9 +128,9 @@ method _start {} {
128 method _finish {cons ok} {
129 console::done $cons $ok
130 if {$ok} {
131 - set msg {Merge completed successfully.}
131 + set msg [mc "Merge completed successfully."]
132 } else {
133 - set msg {Merge failed. Conflict resolution is required.}
133 + set msg [mc "Merge failed. Conflict resolution is required."]
134 }
135 unlock_index
136 rescan [list ui_status $msg]
@@ -147,7 +147,7 @@ constructor dialog {} {
147 }
148
149 make_toplevel top w
150 - wm title $top "[appname] ([reponame]): Merge"
150 + wm title $top [append "[appname] ([reponame]): " [mc "Merge"]]
151 if {$top ne {.}} {
152 wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
153 }
@@ -155,26 +155,26 @@ constructor dialog {} {
155 set _start [cb _start]
156
157 label $w.header \
158 - -text "Merge Into $current_branch" \
158 + -text [mc "Merge Into %s" $current_branch] \
159 -font font_uibold
160 pack $w.header -side top -fill x
161
162 frame $w.buttons
163 button $w.buttons.visualize \
164 - -text Visualize \
164 + -text [mc Visualize] \
165 -command [cb _visualize]
166 pack $w.buttons.visualize -side left
167 button $w.buttons.merge \
168 - -text Merge \
168 + -text [mc Merge] \
169 -command $_start
170 pack $w.buttons.merge -side right
171 button $w.buttons.cancel \
172 - -text {Cancel} \
172 + -text [mc "Cancel"] \
173 -command [cb _cancel]
174 pack $w.buttons.cancel -side right -padx 5
175 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
176
177 - set w_rev [::choose_rev::new_unmerged $w.rev {Revision To Merge}]
177 + set w_rev [::choose_rev::new_unmerged $w.rev [mc "Revision To Merge"]]
178 pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
179
180 bind $w <$M1B-Key-Return> $_start
@@ -209,34 +209,34 @@ proc reset_hard {} {
209 global HEAD commit_type file_states
210
211 if {[string match amend* $commit_type]} {
212 - info_popup {Cannot abort while amending.
212 + info_popup [mc "Cannot abort while amending.
213
214 You must finish amending this commit.
215 -}
215 +"]
216 return
217 }
218
219 if {![lock_index abort]} return
220
221 if {[string match *merge* $commit_type]} {
222 - set op_question "Abort merge?
222 + set op_question [mc "Abort merge?
223
224 Aborting the current merge will cause *ALL* uncommitted changes to be lost.
225
226 -Continue with aborting the current merge?"
226 +Continue with aborting the current merge?"]
227 } else {
228 - set op_question "Reset changes?
228 + set op_question [mc "Reset changes?
229
230 Resetting the changes will cause *ALL* uncommitted changes to be lost.
231
232 -Continue with resetting the current changes?"
232 +Continue with resetting the current changes?"]
233 }
234
235 if {[ask_popup $op_question] eq {yes}} {
236 set fd [git_read --stderr read-tree --reset -u -v HEAD]
237 fconfigure $fd -blocking 0 -translation binary
238 fileevent $fd readable [namespace code [list _reset_wait $fd]]
239 - $::main_status start {Aborting} {files reset}
239 + $::main_status start [mc "Aborting"] {files reset}
240 } else {
241 unlock_index
242 }
@@ -263,9 +263,9 @@ proc _reset_wait {fd} {
263 catch {file delete [gitdir GITGUI_MSG]}
264
265 if {$fail} {
266 - warn_popup "Abort failed.\n\n$err"
266 + warn_popup "[mc "Abort failed."]\n\n$err"
267 }
268 - rescan {ui_status {Abort completed. Ready.}}
268 + rescan {ui_status [mc "Abort completed. Ready."]}
269 } else {
270 fconfigure $fd -blocking 0
271 }
lib/option.tcl
+24 -25
@@ -62,7 +62,7 @@ proc do_about {} {
62 toplevel $w
63 wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
64
65 - label $w.header -text "About [appname]" \
65 + label $w.header -text [mc "About %s" [appname]] \
66 -font font_uibold
67 pack $w.header -side top -fill x
68
@@ -74,8 +74,7 @@ proc do_about {} {
74 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
75
76 label $w.desc \
77 - -text "git-gui - a graphical user interface for Git.
78 -$copyright" \
77 + -text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
78 -padx 5 -pady 5 \
79 -justify left \
80 -anchor w \
@@ -157,48 +156,48 @@ proc do_options {} {
156 toplevel $w
157 wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
158
160 - label $w.header -text "Options" \
159 + label $w.header -text [mc "Options"] \
160 -font font_uibold
161 pack $w.header -side top -fill x
162
163 frame $w.buttons
165 - button $w.buttons.restore -text {Restore Defaults} \
164 + button $w.buttons.restore -text [mc "Restore Defaults"] \
165 -default normal \
166 -command do_restore_defaults
167 pack $w.buttons.restore -side left
169 - button $w.buttons.save -text Save \
168 + button $w.buttons.save -text [mc Save] \
169 -default active \
170 -command [list do_save_config $w]
171 pack $w.buttons.save -side right
173 - button $w.buttons.cancel -text {Cancel} \
172 + button $w.buttons.cancel -text [mc "Cancel"] \
173 -default normal \
174 -command [list destroy $w]
175 pack $w.buttons.cancel -side right -padx 5
176 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
177
179 - labelframe $w.repo -text "[reponame] Repository"
180 - labelframe $w.global -text {Global (All Repositories)}
178 + labelframe $w.repo -text [mc "%s Repository" [reponame]]
179 + labelframe $w.global -text [mc "Global (All Repositories)"]
180 pack $w.repo -side left -fill both -expand 1 -pady 5 -padx 5
181 pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5
182
183 set optid 0
184 foreach option {
186 - {t user.name {User Name}}
187 - {t user.email {Email Address}}
188 -
189 - {b merge.summary {Summarize Merge Commits}}
190 - {i-1..5 merge.verbosity {Merge Verbosity}}
191 - {b merge.diffstat {Show Diffstat After Merge}}
192 -
193 - {b gui.trustmtime {Trust File Modification Timestamps}}
194 - {b gui.pruneduringfetch {Prune Tracking Branches During Fetch}}
195 - {b gui.matchtrackingbranch {Match Tracking Branches}}
196 - {i-0..99 gui.diffcontext {Number of Diff Context Lines}}
197 - {t gui.newbranchtemplate {New Branch Name Template}}
185 + {t user.name {mc "User Name"}}
186 + {t user.email {mc "Email Address"}}
187 +
188 + {b merge.summary {mc "Summarize Merge Commits"}}
189 + {i-1..5 merge.verbosity {mc "Merge Verbosity"}}
190 + {b merge.diffstat {mc "Show Diffstat After Merge"}}
191 +
192 + {b gui.trustmtime {mc "Trust File Modification Timestamps"}}
193 + {b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
194 + {b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
195 + {i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
196 + {t gui.newbranchtemplate {mc "New Branch Name Template"}}
197 } {
198 set type [lindex $option 0]
199 set name [lindex $option 1]
201 - set text [lindex $option 2]
200 + set text [eval [lindex $option 2]]
201 incr optid
202 foreach f {repo global} {
203 switch -glob -- $type {
@@ -246,7 +245,7 @@ proc do_options {} {
245 foreach option $font_descs {
246 set name [lindex $option 0]
247 set font [lindex $option 1]
249 - set text [lindex $option 2]
248 + set text [eval [lindex $option 2]]
249
250 set global_config_new(gui.$font^^family) \
251 [font configure $font -family]
@@ -272,7 +271,7 @@ proc do_options {} {
271 bind $w <Visibility> "grab $w; focus $w.buttons.save"
272 bind $w <Key-Escape> "destroy $w"
273 bind $w <Key-Return> [list do_save_config $w]
275 - wm title $w "[appname] ([reponame]): Options"
274 + wm title $w [append "[appname] ([reponame]): " [mc "Options"]]
275 tkwait window $w
276 }
277
@@ -303,7 +302,7 @@ proc do_restore_defaults {} {
302
303 proc do_save_config {w} {
304 if {[catch {save_config} err]} {
306 - error_popup "Failed to completely save options:\n\n$err"
305 + error_popup [append [mc "Failed to completely save options:"] "\n\n$err"]
306 }
307 reshow_diff
308 destroy $w
lib/remote.tcl
+3 -3
@@ -159,7 +159,7 @@ proc populate_fetch_menu {} {
159 if {$enable} {
160 lappend prune_list $r
161 $m add command \
162 - -label "Fetch from $r..." \
162 + -label [mc "Fetch from %s..." $r] \
163 -command [list fetch_from $r]
164 }
165 }
@@ -169,7 +169,7 @@ proc populate_fetch_menu {} {
169 }
170 foreach r $prune_list {
171 $m add command \
172 - -label "Prune from $r..." \
172 + -label [mc "Prune from %s..." $r] \
173 -command [list prune_from $r]
174 }
175 }
@@ -203,7 +203,7 @@ proc populate_push_menu {} {
203 $m add separator
204 }
205 $m add command \
206 - -label "Push to $r..." \
206 + -label [mc "Push to %s..." $r] \
207 -command [list push_to $r]
208 incr fast_count
209 }
lib/remote_branch_delete.tcl
+20 -22
@@ -26,28 +26,28 @@ constructor dialog {} {
26 global all_remotes M1B
27
28 make_toplevel top w
29 - wm title $top "[appname] ([reponame]): Delete Remote Branch"
29 + wm title $top [append "[appname] ([reponame]): " [mc "Delete Remote Branch"]]
30 if {$top ne {.}} {
31 wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
32 }
33
34 - label $w.header -text {Delete Remote Branch} -font font_uibold
34 + label $w.header -text [mc "Delete Remote Branch"] -font font_uibold
35 pack $w.header -side top -fill x
36
37 frame $w.buttons
38 - button $w.buttons.delete -text Delete \
38 + button $w.buttons.delete -text [mc Delete] \
39 -default active \
40 -command [cb _delete]
41 pack $w.buttons.delete -side right
42 - button $w.buttons.cancel -text {Cancel} \
42 + button $w.buttons.cancel -text [mc "Cancel"] \
43 -command [list destroy $w]
44 pack $w.buttons.cancel -side right -padx 5
45 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
46
47 - labelframe $w.dest -text {From Repository}
47 + labelframe $w.dest -text [mc "From Repository"]
48 if {$all_remotes ne {}} {
49 radiobutton $w.dest.remote_r \
50 - -text {Remote:} \
50 + -text [mc "Remote:"] \
51 -value remote \
52 -variable @urltype
53 eval tk_optionMenu $w.dest.remote_m @remote $all_remotes
@@ -63,7 +63,7 @@ constructor dialog {} {
63 set urltype url
64 }
65 radiobutton $w.dest.url_r \
66 - -text {Arbitrary URL:} \
66 + -text [mc "Arbitrary URL:"] \
67 -value url \
68 -variable @urltype
69 entry $w.dest.url_t \
@@ -81,7 +81,7 @@ constructor dialog {} {
81 grid columnconfigure $w.dest 1 -weight 1
82 pack $w.dest -anchor nw -fill x -pady 5 -padx 5
83
84 - labelframe $w.heads -text {Branches}
84 + labelframe $w.heads -text [mc "Branches"]
85 listbox $w.heads.l \
86 -height 10 \
87 -width 70 \
@@ -96,7 +96,7 @@ constructor dialog {} {
96 -anchor w \
97 -justify left
98 button $w.heads.footer.rescan \
99 - -text {Rescan} \
99 + -text [mc "Rescan"] \
100 -command [cb _rescan]
101 pack $w.heads.footer.status -side left -fill x
102 pack $w.heads.footer.rescan -side right
@@ -106,9 +106,9 @@ constructor dialog {} {
106 pack $w.heads.l -side left -fill both -expand 1
107 pack $w.heads -fill both -expand 1 -pady 5 -padx 5
108
109 - labelframe $w.validate -text {Delete Only If}
109 + labelframe $w.validate -text [mc "Delete Only If"]
110 radiobutton $w.validate.head_r \
111 - -text {Merged Into:} \
111 + -text [mc "Merged Into:"] \
112 -value head \
113 -variable @checktype
114 set head_m [tk_optionMenu $w.validate.head_m @check_head {}]
@@ -116,7 +116,7 @@ constructor dialog {} {
116 trace add variable @check_head write [cb _write_check_head]
117 grid $w.validate.head_r $w.validate.head_m -sticky w
118 radiobutton $w.validate.always_r \
119 - -text {Always (Do not perform merge checks)} \
119 + -text [mc "Always (Do not perform merge checks)"] \
120 -value always \
121 -variable @checktype
122 grid $w.validate.always_r -columnspan 2 -sticky w
@@ -149,7 +149,7 @@ method _delete {} {
149 -type ok \
150 -title [wm title $w] \
151 -parent $w \
152 - -message "A branch is required for 'Merged Into'."
152 + -message [mc "A branch is required for 'Merged Into'."]
153 return
154 }
155 set crev $full_cache("$cache\nrefs/heads/$check_head")
@@ -186,9 +186,7 @@ method _delete {} {
186 - [join $not_merged "\n - "]"
187
188 if {$need_fetch} {
189 - append msg "
190 -
191 -One or more of the merge tests failed because you have not fetched the necessary commits. Try fetching from $uri first."
189 + append msg "\n\n" [mc "One or more of the merge tests failed because you have not fetched the necessary commits. Try fetching from %s first." $uri]
190 }
191
192 tk_messageBox \
@@ -206,7 +204,7 @@ One or more of the merge tests failed because you have not fetched the necessary
204 -type ok \
205 -title [wm title $w] \
206 -parent $w \
209 - -message "Please select one or more branches to delete."
207 + -message [mc "Please select one or more branches to delete."]
208 return
209 }
210
@@ -215,9 +213,9 @@ One or more of the merge tests failed because you have not fetched the necessary
213 -type yesno \
214 -title [wm title $w] \
215 -parent $w \
218 - -message {Recovering deleted branches is difficult.
216 + -message [mc "Recovering deleted branches is difficult.
217
220 -Delete the selected branches?}] ne yes} {
218 +Delete the selected branches?"]] ne yes} {
219 return
220 }
221
@@ -225,7 +223,7 @@ Delete the selected branches?}] ne yes} {
223
224 set cons [console::new \
225 "push $uri" \
228 - "Deleting branches from $uri"]
226 + [mc "Deleting branches from %s" $uri]]
227 console::exec $cons $push_cmd
228 }
229
@@ -285,12 +283,12 @@ method _load {cache uri} {
283 $w.heads.l conf -state disabled
284 set head_list [list]
285 set full_list [list]
288 - set status {No repository selected.}
286 + set status [mc "No repository selected."]
287 return
288 }
289
290 if {[catch {set x $cached($cache)}]} {
293 - set status "Scanning $uri..."
291 + set status [mc "Scanning %s..." $uri]
292 $w.heads.l conf -state disabled
293 set head_list [list]
294 set full_list [list]
lib/shortcut.tcl
+6 -6
@@ -6,7 +6,7 @@ proc do_windows_shortcut {} {
6
7 set fn [tk_getSaveFile \
8 -parent . \
9 - -title "[appname] ([reponame]): Create Desktop Icon" \
9 + -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
10 -initialfile "Git [reponame].bat"]
11 if {$fn != {}} {
12 if {[file extension $fn] ne {.bat}} {
@@ -23,7 +23,7 @@ proc do_windows_shortcut {} {
23 puts $fd " \"[file normalize $argv0]\""
24 close $fd
25 } err]} {
26 - error_popup "Cannot write script:\n\n$err"
26 + error_popup [append [mc "Cannot write script:"] "\n\n$err"]
27 }
28 }
29 }
@@ -42,7 +42,7 @@ proc do_cygwin_shortcut {} {
42 }
43 set fn [tk_getSaveFile \
44 -parent . \
45 - -title "[appname] ([reponame]): Create Desktop Icon" \
45 + -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
46 -initialdir $desktop \
47 -initialfile "Git [reponame].bat"]
48 if {$fn != {}} {
@@ -71,7 +71,7 @@ proc do_cygwin_shortcut {} {
71 puts $fd " &\""
72 close $fd
73 } err]} {
74 - error_popup "Cannot write script:\n\n$err"
74 + error_popup [append [mc "Cannot write script:"] "\n\n$err"]
75 }
76 }
77 }
@@ -81,7 +81,7 @@ proc do_macosx_app {} {
81
82 set fn [tk_getSaveFile \
83 -parent . \
84 - -title "[appname] ([reponame]): Create Desktop Icon" \
84 + -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
85 -initialdir [file join $env(HOME) Desktop] \
86 -initialfile "Git [reponame].app"]
87 if {$fn != {}} {
@@ -146,7 +146,7 @@ proc do_macosx_app {} {
146
147 file attributes $exe -permissions u+x,g+x,o+x
148 } err]} {
149 - error_popup "Cannot write icon:\n\n$err"
149 + error_popup [append [mc "Cannot write icon:"] "\n\n$err"]
150 }
151 }
152 }
lib/status_bar.tcl
+1 -1
@@ -55,7 +55,7 @@ method update {have total} {
55 set pdone [expr {100 * $have / $total}]
56 }
57
58 - set status [format "%s ... %i of %i %s (%2i%%)" \
58 + set status [mc "%s ... %i of %i %s (%2i%%)" \
59 $prefix $have $total $units $pdone]
60 $w_c coords bar 0 0 $pdone 20
61 }
lib/transport.tcl
+15 -15
@@ -4,7 +4,7 @@
4 proc fetch_from {remote} {
5 set w [console::new \
6 "fetch $remote" \
7 - "Fetching new changes from $remote"]
7 + [mc "Fetching new changes from %s" $remote]]
8 set cmds [list]
9 lappend cmds [list exec git fetch $remote]
10 if {[is_config_true gui.pruneduringfetch]} {
@@ -16,14 +16,14 @@ proc fetch_from {remote} {
16 proc prune_from {remote} {
17 set w [console::new \
18 "remote prune $remote" \
19 - "Pruning tracking branches deleted from $remote"]
19 + [mc "Pruning tracking branches deleted from %s" $remote]]
20 console::exec $w [list git remote prune $remote]
21 }
22
23 proc push_to {remote} {
24 set w [console::new \
25 "push $remote" \
26 - "Pushing changes to $remote"]
26 + [mc "Pushing changes to %s" $remote]]
27 set cmd [list git push]
28 lappend cmd -v
29 lappend cmd $remote
@@ -65,7 +65,7 @@ proc start_push_anywhere_action {w} {
65
66 set cons [console::new \
67 "push $r_url" \
68 - "Pushing $cnt $unit to $r_url"]
68 + [mc "Pushing %s %s to %s" $cnt $unit $r_url]]
69 console::exec $cons $cmd
70 destroy $w
71 }
@@ -81,21 +81,21 @@ proc do_push_anywhere {} {
81 toplevel $w
82 wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
83
84 - label $w.header -text {Push Branches} -font font_uibold
84 + label $w.header -text [mc "Push Branches"] -font font_uibold
85 pack $w.header -side top -fill x
86
87 frame $w.buttons
88 - button $w.buttons.create -text Push \
88 + button $w.buttons.create -text [mc Push] \
89 -default active \
90 -command [list start_push_anywhere_action $w]
91 pack $w.buttons.create -side right
92 - button $w.buttons.cancel -text {Cancel} \
92 + button $w.buttons.cancel -text [mc "Cancel"] \
93 -default normal \
94 -command [list destroy $w]
95 pack $w.buttons.cancel -side right -padx 5
96 pack $w.buttons -side bottom -fill x -pady 10 -padx 10
97
98 - labelframe $w.source -text {Source Branches}
98 + labelframe $w.source -text [mc "Source Branches"]
99 listbox $w.source.l \
100 -height 10 \
101 -width 70 \
@@ -112,10 +112,10 @@ proc do_push_anywhere {} {
112 pack $w.source.l -side left -fill both -expand 1
113 pack $w.source -fill both -expand 1 -pady 5 -padx 5
114
115 - labelframe $w.dest -text {Destination Repository}
115 + labelframe $w.dest -text [mc "Destination Repository"]
116 if {$all_remotes ne {}} {
117 radiobutton $w.dest.remote_r \
118 - -text {Remote:} \
118 + -text [mc "Remote:"] \
119 -value remote \
120 -variable push_urltype
121 eval tk_optionMenu $w.dest.remote_m push_remote $all_remotes
@@ -130,7 +130,7 @@ proc do_push_anywhere {} {
130 set push_urltype url
131 }
132 radiobutton $w.dest.url_r \
133 - -text {Arbitrary URL:} \
133 + -text [mc "Arbitrary URL:"] \
134 -value url \
135 -variable push_urltype
136 entry $w.dest.url_t \
@@ -150,13 +150,13 @@ proc do_push_anywhere {} {
150 grid columnconfigure $w.dest 1 -weight 1
151 pack $w.dest -anchor nw -fill x -pady 5 -padx 5
152
153 - labelframe $w.options -text {Transfer Options}
153 + labelframe $w.options -text [mc "Transfer Options"]
154 checkbutton $w.options.thin \
155 - -text {Use thin pack (for slow network connections)} \
155 + -text [mc "Use thin pack (for slow network connections)"] \
156 -variable push_thin
157 grid $w.options.thin -columnspan 2 -sticky w
158 checkbutton $w.options.tags \
159 - -text {Include tags} \
159 + -text [mc "Include tags"] \
160 -variable push_tags
161 grid $w.options.tags -columnspan 2 -sticky w
162 grid columnconfigure $w.options 1 -weight 1
@@ -169,6 +169,6 @@ proc do_push_anywhere {} {
169 bind $w <Visibility> "grab $w; focus $w.buttons.create"
170 bind $w <Key-Escape> "destroy $w"
171 bind $w <Key-Return> [list start_push_anywhere_action $w]
172 - wm title $w "[appname] ([reponame]): Push"
172 + wm title $w [append "[appname] ([reponame]): " [mc "Push"]]
173 tkwait window $w
174 }