summaryrefslogtreecommitdiff
path: root/gettext-tools/examples/hello-tcl-tk/hello.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'gettext-tools/examples/hello-tcl-tk/hello.tcl')
-rw-r--r--gettext-tools/examples/hello-tcl-tk/hello.tcl19
1 files changed, 19 insertions, 0 deletions
diff --git a/gettext-tools/examples/hello-tcl-tk/hello.tcl b/gettext-tools/examples/hello-tcl-tk/hello.tcl
new file mode 100644
index 0000000..4dfee53
--- /dev/null
+++ b/gettext-tools/examples/hello-tcl-tk/hello.tcl
@@ -0,0 +1,19 @@
+#!@WISH@
+# Example for use of GNU gettext.
+# This file is in the public domain.
+#
+# Source code of the Tcl/Tk program.
+
+package require msgcat
+::msgcat::mcload [file join "@pkgdatadir@" "msgs"]
+proc _ {s} {return [::msgcat::mc $s]}
+
+frame .my
+button .my.button \
+ -text [_ "Hello, world!"] \
+ -command exit
+label .my.label \
+ -text [format [_ "This program is running as process number %d."] [pid]]
+pack .my.button -side top
+pack .my.label -side bottom
+pack .my