summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/locale.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/locale.sh b/lib/locale.sh
index 6c2baad..b1314bf 100644
--- a/lib/locale.sh
+++ b/lib/locale.sh
@@ -24,6 +24,7 @@ _OB_LOCALE_SM='true'
_OB_DEFAULT_LOCALE='en_US'
_OB_TEXT_DOMAIN=
+_OB_LOCALE_PATH='@@LOCALEDIR@@/%s/LC_MESSAGES/%s.ms'
ob_get_text_domain()
{
@@ -70,6 +71,23 @@ ob_set_text_domain()
return 0
}
+ob_set_locale_path()
+{
+ _obslp_format=
+
+ if [ ${#} -eq 1 ]; then
+ _obslp_format="${1}"
+ else
+ unset _obslp_format
+ return 125
+ fi
+
+ _OB_LOCALE_PATH="${_obslp_format}"
+
+ unset _obslp_format
+ return 0
+}
+
ob_get_msg()
{
_obgm_msgid=
@@ -89,7 +107,8 @@ ob_get_msg()
_ob_try_load_messages()
{
_obtlm_locale="${1}"
- _obtlm_ms="@@LOCALEDIR@@/${_obtlm_locale}/LC_MESSAGES/${_OB_TEXT_DOMAIN}.ms"
+ _obtlm_ms="$(printf "${_OB_LOCALE_PATH}" \
+ "${_obtlm_locale}" "${_OB_TEXT_DOMAIN}")"
if [ -f "${_obtlm_ms}" ]; then
. "${_obtlm_ms}"