From 39012ebd0db15caa3cc4c14f089f05b1d2551cdc Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 05 Sep 2012 15:30:04 -0400 Subject: Set text domain before getting message strings. --- diff --git a/lib/changelog.sh b/lib/changelog.sh index 7127282..d78dbd7 100644 --- a/lib/changelog.sh +++ b/lib/changelog.sh @@ -204,18 +204,35 @@ _ob_parse_changelog_error() _obpche_line_nr="${2}" _obpche_msg_id="${3}" _obpche_file_info= + _obpche_orig_text_domain= shift 3 _obpche_file_info=$(printf '%20s(l%d):' "${_obpche_file}" \ "${_obpche_line_nr}") + _obpche_orig_text_domain="$(ob_get_text_domain)" + ob_set_text_domain 'libopkbuild.1' + oh_warn "${_obpche_file_info} $(ob_get_msg "${_obpche_msg_id}")" "${@}" - unset _obpche_file _obpche_line_nr _obpche_msg_id _obpche_file_info + ob_set_text_domain "${_obpche_orig_text_domain}" + + unset _obpche_file _obpche_line_nr _obpche_msg_id \ + _obpche_file_info _obpche_orig_text_domain= return 0 } _ob_get_changelog_expect_str() { + _obgces_orig_text_domain= + + _obgces_orig_text_domain="$(ob_get_text_domain)" + ob_set_text_domain 'libopkbuild.1' + echo "$(ob_get_msg "changelog_expect_${1}")" + + ob_set_text_domain "${_obgces_orig_text_domain}" + + unset _obgces_orig_text_domain + return 0 } diff --git a/lib/control.sh b/lib/control.sh index 0132121..fec7652 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -137,6 +137,7 @@ _ob_parse_control_error() _obpcoe_line_nr="${2}" _obpcoe_msg_id="${3}" _obpcoe_file_info= + _obpcoe_orig_text_domain= shift 3 if [ "${_obpcoe_line_nr}" -eq 0 ]; then @@ -146,8 +147,14 @@ _ob_parse_control_error() "${_obpcoe_line_nr}")" fi + _obpcoe_orig_text_domain="$(ob_get_text_domain)" + ob_set_text_domain 'libopkbuild.1' + oh_warn "${_obpcoe_file_info} $(ob_get_msg "${_obpcoe_msg_id}")" "${@}" - unset _obpcoe_file _obpcoe_line_nr _obpcoe_msg_id _obpcoe_file_info + ob_set_text_domain "${_obpcoe_orig_text_domain}" + + unset _obpcoe_file _obpcoe_line_nr _obpcoe_msg_id \ + _obpcoe_file_info _obpcoe_orig_text_domain return 0 } -- cgit v0.9.1