From: paul Date: Wed, 4 Nov 2015 15:44:40 +0000 (+0000) Subject: localization "l10n" function X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=1356a6f6654dc4d348be7d44095f543b9fd81356;p=cgilite localization "l10n" function svn path=/trunk/; revision=18 --- diff --git a/misc.sh b/misc.sh index 9d92805..ee4eaaf 100755 --- a/misc.sh +++ b/misc.sh @@ -50,3 +50,8 @@ invalidate(){ printf %s\\n "${value}" \ | sed -rn "2q; /^(${regex})\$/{bd}; p;q; :d;a${default}" } + +declare -A item_name +l10n(){ + [ -n "$item_name[$1]" ] && printf %s "$item_name[$1]" || printf %s "$1" +}