From 1356a6f6654dc4d348be7d44095f543b9fd81356 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 4 Nov 2015 15:44:40 +0000 Subject: [PATCH] localization "l10n" function svn path=/trunk/; revision=18 --- misc.sh | 5 +++++ 1 file changed, 5 insertions(+) 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" +} -- 2.39.2