diff options
author | dteske <dteske@FreeBSD.org> | 2013-05-12 00:46:18 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-05-12 00:46:18 +0000 |
commit | 98359e968c11e761ba299fe27ff83221f1d68c69 (patch) | |
tree | 10173738cc7815d53afdb3f66acd59ccfaced9f2 /usr.sbin/bsdconfig/share | |
parent | 04e3ea451562b4ae0f29a5675408c0ec055927ce (diff) | |
download | FreeBSD-src-98359e968c11e761ba299fe27ff83221f1d68c69.zip FreeBSD-src-98359e968c11e761ba299fe27ff83221f1d68c69.tar.gz |
Fix i18n violations in the package management module. A few words like
`packages', `installed', and `selected' were not internationalized.
Diffstat (limited to 'usr.sbin/bsdconfig/share')
-rwxr-xr-x | usr.sbin/bsdconfig/share/packages/index.subr | 9 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/share/packages/packages.subr | 31 |
2 files changed, 28 insertions, 12 deletions
diff --git a/usr.sbin/bsdconfig/share/packages/index.subr b/usr.sbin/bsdconfig/share/packages/index.subr index 2d4b60c..afbd31b 100755 --- a/usr.sbin/bsdconfig/share/packages/index.subr +++ b/usr.sbin/bsdconfig/share/packages/index.subr @@ -112,6 +112,7 @@ f_index_read() export msg_no_description_provided export msg_all msg_all_desc export VALID_VARNAME_CHARS + export msg_packages eval "$( debug= f_getvar "$var_to_get" | awk -F'|' ' function asorti(src, dest) @@ -140,12 +141,13 @@ f_index_read() # cached (also acting as a visitation indicator) if ( ENVIRON["_index_page_" varcat "_1"] ) cat = cat "*" - printf "'\''%s'\'' '\''%s packages'\'' '\''%s'\''\n", + printf "'\''%s'\'' '\''%s " packages "'\'' '\''%s'\''\n", cat, npkgs, desc } BEGIN { valid_chars = ENVIRON["VALID_VARNAME_CHARS"] default_desc = ENVIRON["msg_no_description_provided"] + packages = ENVIRON["msg_packages"] tpkgs = 0 prefix = "" } @@ -221,11 +223,12 @@ f_index_extract_pages() debug= f_getvar "$var_to_get" | awk -F'|' \ -v cat="$category" \ -v pagesize="$pagesize" \ - -v var_basename="$var_basename" ' + -v var_basename="$var_basename" \ + -v i18n_all="$msg_all" ' BEGIN { n = page = 0 } /'\''/{ gsub(/'\''/, "'\''\\'\'\''") } { - if ( cat !~ /(^$|^All$)/ && $7 !~ \ + if ( cat !~ "(^$|^" i18n_all "$)" && $7 !~ \ "(^|[[:space:]])" cat "([[:space:]]|$)" ) next starting_new_page = (n++ == (pagesize * page)) if ( starting_new_page ) diff --git a/usr.sbin/bsdconfig/share/packages/packages.subr b/usr.sbin/bsdconfig/share/packages/packages.subr index 0d602d4..5caf78d 100755 --- a/usr.sbin/bsdconfig/share/packages/packages.subr +++ b/usr.sbin/bsdconfig/share/packages/packages.subr @@ -78,20 +78,28 @@ f_package_accent_category_menu() while [ $# -gt 0 ]; do cat="${1%\*}" desc="${2%%; *}" help="$3" shift 3 # cat/desc/help - f_str2varname "${cat# }" varcat - # Add an asterisk to the category if its index has been cached - f_isset _index_page_${varcat}_1 && cat="$cat*" + cat="${cat# }" # Trim leading space inserted by sort-method + f_str2varname "$cat" varcat # Add number of installed packages for this category (if any) n=0 - debug= f_getvar "_${varcat}_ninstalled" n && - [ $n -ge 1 ] && desc="$desc; $n installed" + case "$cat" in + "$msg_all") debug= f_getvar "_All_ninstalled" n ;; + *) debug= f_getvar "_${varcat}_ninstalled" n ;; + esac && + [ $n -ge 1 ] && desc="$desc; $n $msg_installed_lc" # Add number of selected packages for this category (if any) n=0 - debug= f_getvar "_${varcat}_nselected" n && - [ $n -ge 1 ] && desc="$desc; $n selected" + case "$cat" in + "$msg_all") debug= f_getvar "_All_nselected" n ;; + *) debug= f_getvar "_${varcat}_nselected" n ;; + esac && + [ $n -ge 1 ] && desc="$desc; $n $msg_selected" + + # Add an asterisk to the category if its index has been cached + f_isset _index_page_${varcat}_1 && cat="$cat*" # Update buffer with modified elements menu_buf="$menu_buf @@ -365,7 +373,7 @@ f_package_menu_select() # Get number of packages for this category case "$category" in - "All"|"") npkgs="${_npkgs:-0}";; + "$msg_all"|"") npkgs="${_npkgs:-0}";; *) f_getvar _npkgs_$varcat npkgs esac @@ -437,7 +445,12 @@ f_package_menu_select() " # End-Quote local prompt="" - f_category_desc_get "$category" prompt + # Accept/Translate i18n "All" but other category names must + # match tree definitions from INDEX, ports, FTP, etc. + case "$category" in + "$msg_all"|"") f_category_desc_get "All" prompt ;; + *) f_category_desc_get "$category" prompt ;; + esac prompt="$prompt $( printf "$msg_page_of_npages" \ "$page" "$npages" )" |