diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-11 23:14:31 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-03-11 23:14:31 (EDT) |
commit | 3c96056f9f00fd448972339225fd28c1ec4bd546 (patch) | |
tree | 7ae27b4590a22f4c3b5a5741f5dbdcbbd983ef00 /lib | |
parent | e0380430cdb4a272d3f858abc132eddc676ce58c (diff) |
_ob_get_msg(): New internal function
Use it in _ob_*_msg().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/locale.sh | 14 | ||||
-rw-r--r-- | lib/output.sh | 18 |
2 files changed, 17 insertions, 15 deletions
diff --git a/lib/locale.sh b/lib/locale.sh index ae3c88c..b564f7f 100644 --- a/lib/locale.sh +++ b/lib/locale.sh @@ -142,3 +142,17 @@ ob_get_msg() return 0 } + +_ob_get_msg() +{ + local msgid="${1}" + shift 1 + local orig_text_domain= + + orig_text_domain="$(ob_get_text_domain)" + ob_set_text_domain "${_OB_INTERNAL_TEXT_DOMAIN}" + ob_get_msg "${msgid}" + ob_set_text_domain "${orig_text_domain}" + + return 0 +} diff --git a/lib/output.sh b/lib/output.sh index 0befca1..bc262e9 100644 --- a/lib/output.sh +++ b/lib/output.sh @@ -88,12 +88,8 @@ _ob_error_msg() { local msgid="${1}" shift 1 - local orig_text_domain= - orig_text_domain="$(ob_get_text_domain)" - ob_set_text_domain "${_OB_INTERNAL_TEXT_DOMAIN}" - ob_error "$(ob_get_msg "${msgid}")" "${@}" - ob_set_text_domain "${orig_text_domain}" + ob_error "$(_ob_get_msg "${msgid}")" "${@}" return 0 } @@ -102,12 +98,8 @@ _ob_warn_msg() { local msgid="${1}" shift 1 - local orig_text_domain= - orig_text_domain="$(ob_get_text_domain)" - ob_set_text_domain "${_OB_INTERNAL_TEXT_DOMAIN}" - ob_warn "$(ob_get_msg "${msgid}")" "${@}" - ob_set_text_domain "${orig_text_domain}" + ob_warn "$(_ob_get_msg "${msgid}")" "${@}" return 0 } @@ -116,12 +108,8 @@ _ob_info_msg() { local msgid="${1}" shift 1 - local orig_text_domain= - orig_text_domain="$(ob_get_text_domain)" - ob_set_text_domain "${_OB_INTERNAL_TEXT_DOMAIN}" - ob_info "$(ob_get_msg "${msgid}")" "${@}" - ob_set_text_domain "${orig_text_domain}" + ob_info "$(_ob_get_msg "${msgid}")" "${@}" return 0 } |