diff options
author | Daniel Baumann <daniel@debian.org> | 2008-10-29 09:36:29 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:03:43 +0100 |
commit | b28ffecee0815d624a17e77bb372450224ca27c4 (patch) | |
tree | d758cec2a4640aa4b7999e040d85a631fe0c860b /functions/l10n.sh | |
parent | 37d2fb4b0f5ac4c92ca589ab46d567f06551971f (diff) | |
download | vyos-live-build-b28ffecee0815d624a17e77bb372450224ca27c4.tar.gz vyos-live-build-b28ffecee0815d624a17e77bb372450224ca27c4.zip |
Check for availability of gettext at runtime, and only use it if existing.
Diffstat (limited to 'functions/l10n.sh')
-rwxr-xr-x | functions/l10n.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/functions/l10n.sh b/functions/l10n.sh index dfb22cb57..a1125ec44 100755 --- a/functions/l10n.sh +++ b/functions/l10n.sh @@ -7,9 +7,18 @@ # This is free software, and you are welcome to redistribute it # under certain conditions; see COPYING for details. -# gettext domain (.mo file name) -export TEXTDOMAIN=live-helper -# locale dir for gettext codes -export TEXTDOMAINDIR=/usr/share/locale -# load gettext functions -. gettext.sh +if [ -x "$(which gettext.sh 2>/dev/null)" ] +then + LH_L10N="enabled" + + # gettext domain (.mo file name) + export TEXTDOMAIN="live-helper" + + # locale dir for gettext codes + export TEXTDOMAINDIR="/usr/share/locale" + + # load gettext functions + . gettext.sh +else + LH_L10N="disabled" +fi |