mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-22 12:35:13 +00:00
Install and use translations.
This commit is contained in:
parent
5158c380fe
commit
7d434787b6
1
Makefile
1
Makefile
@ -15,6 +15,7 @@ all:
|
|||||||
install:
|
install:
|
||||||
@install -Dm755 ${PROG} ${DESTDIR}${PREFIX}/bin/${PROG}
|
@install -Dm755 ${PROG} ${DESTDIR}${PREFIX}/bin/${PROG}
|
||||||
@install -Dm666 doc/${PROG}.1 ${DESTDIR}${MANDIR}/man1/${PROG}.1
|
@install -Dm666 doc/${PROG}.1 ${DESTDIR}${MANDIR}/man1/${PROG}.1
|
||||||
|
make -C extras/po install
|
||||||
|
|
||||||
test:
|
test:
|
||||||
make -C extras/test
|
make -C extras/test
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
|
LOCALEDIR ?= /usr/share/locale
|
||||||
|
TOMBFILE = LC_MESSAGES/tomb.po
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@rm -f tomb.pot
|
@rm -f tomb.pot
|
||||||
@./generate_translatable_strings.sh > tomb.pot
|
@./generate_translatable_strings.sh > tomb.pot
|
||||||
@echo "Strings generated in tomb.pot"
|
@echo "Strings generated in tomb.pot"
|
||||||
|
|
||||||
|
install: *.mo
|
||||||
|
@install -Dm755 es.mo ${LOCALEDIR}/es/${TOMBFILE}
|
||||||
|
|
||||||
|
es.mo: es.po
|
||||||
|
msgfmt -o $@ $<
|
||||||
|
14
tomb
14
tomb
@ -69,6 +69,9 @@ typeset -H tomb_secret
|
|||||||
# Make sure sbin is in PATH
|
# Make sure sbin is in PATH
|
||||||
PATH+=:/sbin:/usr/sbin
|
PATH+=:/sbin:/usr/sbin
|
||||||
|
|
||||||
|
# For gettext
|
||||||
|
export TEXTDOMAIN=tomb
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# {{{ Safety functions
|
# {{{ Safety functions
|
||||||
@ -410,9 +413,10 @@ option_value() {
|
|||||||
|
|
||||||
# Messaging function with pretty coloring
|
# Messaging function with pretty coloring
|
||||||
function _msg() {
|
function _msg() {
|
||||||
|
local msg="$(gettext -s "$2")"
|
||||||
local command="print -P"
|
local command="print -P"
|
||||||
local progname="$fg[magenta]${TOMBEXEC##*/}$reset_color"
|
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
|
local -i returncode
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -420,19 +424,19 @@ function _msg() {
|
|||||||
command+=" -n"; pchars=" > "; pcolor="yellow"
|
command+=" -n"; pchars=" > "; pcolor="yellow"
|
||||||
;;
|
;;
|
||||||
message)
|
message)
|
||||||
pchars=" . "; pcolor="white"; message="$fg_no_bold[$pcolor]${2}$reset_color"
|
pchars=" . "; pcolor="white"; message="$fg_no_bold[$pcolor]$msg$reset_color"
|
||||||
;;
|
;;
|
||||||
verbose)
|
verbose)
|
||||||
pchars="[D]"; pcolor="blue"
|
pchars="[D]"; pcolor="blue"
|
||||||
;;
|
;;
|
||||||
success)
|
success)
|
||||||
pchars="(*)"; pcolor="green"; message="$fg_no_bold[$pcolor]${2}$reset_color"
|
pchars="(*)"; pcolor="green"; message="$fg_no_bold[$pcolor]$msg$reset_color"
|
||||||
;;
|
;;
|
||||||
warning)
|
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)
|
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
|
returncode=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Loading…
Reference in New Issue
Block a user