svn commit: r250538 - in head/usr.sbin/bsdconfig: include share/packages

Devin Teske dteske at FreeBSD.org
Wed May 15 05:04:42 UTC 2013


Author: dteske
Date: Sun May 12 00:46:18 2013
New Revision: 250538
URL: http://svnweb.freebsd.org/changeset/base/250538

Log:
  Fix i18n violations in the package management module. A few words like
  `packages', `installed', and `selected' were not internationalized.

Modified:
  head/usr.sbin/bsdconfig/include/messages.subr
  head/usr.sbin/bsdconfig/share/packages/index.subr
  head/usr.sbin/bsdconfig/share/packages/packages.subr

Modified: head/usr.sbin/bsdconfig/include/messages.subr
==============================================================================
--- head/usr.sbin/bsdconfig/include/messages.subr	Sun May 12 00:44:40 2013	(r250537)
+++ head/usr.sbin/bsdconfig/include/messages.subr	Sun May 12 00:46:18 2013	(r250538)
@@ -164,6 +164,7 @@ msg_install_from_an_ftp_server_thru_prox
 msg_install_from_the_existing_filesystem="Install from the existing filesystem"
 msg_install_over_nfs="Install over NFS"
 msg_installed="Installed"
+msg_installed_lc="installed"
 msg_installed_desc="Leave package as-is, installed"
 msg_invalid_gateway_ipv4_address_specified="Invalid gateway IPv4 address specified"
 msg_invalid_hostname_value="Invalid hostname value"
@@ -248,6 +249,7 @@ msg_options="Options"
 msg_options_editor="Options Editor"
 msg_other="other"
 msg_package_temp="Package Temp"
+msg_packages="packages"
 msg_page_of_npages="(Page %s of %s)"
 msg_palm_desc="Software support for the Palm(tm) series."
 msg_parallel_desc="Applications dealing with parallelism in computing."
@@ -318,6 +320,7 @@ msg_secure_mode_requires_x11="Secure-mod
 msg_security_desc="System security software."
 msg_select="Select"
 msg_select_a_site_thats_close="Select a site that's close!"
+msg_selected="selected"
 msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server"
 msg_shells_desc="Various shells (tcsh, bash, etc)."
 msg_singapore="Singapore"

Modified: head/usr.sbin/bsdconfig/share/packages/index.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/packages/index.subr	Sun May 12 00:44:40 2013	(r250537)
+++ head/usr.sbin/bsdconfig/share/packages/index.subr	Sun May 12 00:46:18 2013	(r250538)
@@ -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 )

Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/packages/packages.subr	Sun May 12 00:44:40 2013	(r250537)
+++ head/usr.sbin/bsdconfig/share/packages/packages.subr	Sun May 12 00:46:18 2013	(r250538)
@@ -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" )"
 
_______________________________________________
svn-src-all at freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"


More information about the svn-src-head mailing list