URI: 
       tMerge pull request #123 from gdrooid/i18n - tomb - the crypto undertaker
  HTML git clone git://parazyd.org/tomb.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit f794b78795e762aede6f204f2c6d30119ae354e9
   DIR parent 31ab169e2fc1ec77ad95264612aa24216d1d1b95
  HTML Author: Jaromil <jaromil@dyne.org>
       Date:   Tue, 19 Aug 2014 18:48:49 +0200
       
       Merge pull request #123 from gdrooid/i18n
       
       Install and use translations.
       Diffstat:
         M INSTALL.md                          |       8 ++++++++
         M extras/po/Makefile                  |       9 +++++++++
         M tomb                                |      14 +++++++++-----
       
       3 files changed, 26 insertions(+), 5 deletions(-)
       ---
   DIR diff --git a/INSTALL.md b/INSTALL.md
       t@@ -63,3 +63,11 @@ Once any of the above is installed Tomb will find the tool automatically.
        Tomb comes with a bunch of extra tools that contribute to enhance its
        functionality or integrate it into particular system environments.
        
       +### Install translations
       +
       +There are translations available for Tomb. If you wish to install them
       +navigate to extras/po and run 'make install' as root:
       +
       +    cd extras/po
       +    sudo make install
       +
   DIR diff --git a/extras/po/Makefile b/extras/po/Makefile
       t@@ -1,4 +1,13 @@
       +LOCALEDIR ?= /usr/share/locale
       +TOMBFILE = LC_MESSAGES/tomb.po
       +
        all:
                @rm -f tomb.pot
                @./generate_translatable_strings.sh > tomb.pot
                @echo "Strings generated in tomb.pot"
       +
       +install: *.mo
       +        @install -Dm755 es.mo ${LOCALEDIR}/es/${TOMBFILE}
       +
       +es.mo: es.po
       +        msgfmt -o $@ $<
   DIR diff --git a/tomb b/tomb
       t@@ -69,6 +69,9 @@ typeset -H tomb_secret
        # Make sure sbin is in PATH
        PATH+=:/sbin:/usr/sbin
        
       +# For gettext
       +export TEXTDOMAIN=tomb
       +
        # }}}
        
        # {{{ Safety functions
       t@@ -427,9 +430,10 @@ option_value() {
        
        # Messaging function with pretty coloring
        function _msg() {
       +    local msg="$(gettext -s "$2")"
            local command="print -P"
            local progname="$fg[magenta]${TOMBEXEC##*/}$reset_color"
       -    local message="$fg_bold[normal]$fg_no_bold[normal]${2}$reset_color"
       +    local message="$fg_bold[normal]$fg_no_bold[normal]$msg$reset_color"
            local -i returncode
        
            case "$1" in
       t@@ -437,19 +441,19 @@ function _msg() {
                    command+=" -n"; pchars=" > "; pcolor="yellow"
                    ;;
                message)
       -            pchars=" . "; pcolor="white"; message="$fg_no_bold[$pcolor]${2}$reset_color"
       +            pchars=" . "; pcolor="white"; message="$fg_no_bold[$pcolor]$msg$reset_color"
                    ;;
                verbose)
                    pchars="[D]"; pcolor="blue"
                    ;;
                success)
       -            pchars="(*)"; pcolor="green"; message="$fg_no_bold[$pcolor]${2}$reset_color"
       +            pchars="(*)"; pcolor="green"; message="$fg_no_bold[$pcolor]$msg$reset_color"
                    ;;
                warning)
       -            pchars="[W]"; pcolor="yellow"; message="$fg_no_bold[$pcolor]${2}$reset_color"
       +            pchars="[W]"; pcolor="yellow"; message="$fg_no_bold[$pcolor]$msg$reset_color"
                    ;;
                failure)
       -            pchars="[E]"; pcolor="red"; message="$fg_no_bold[$pcolor]${2}$reset_color"
       +            pchars="[E]"; pcolor="red"; message="$fg_no_bold[$pcolor]$msg$reset_color"
                    returncode=1
                    ;;
                *)