Date: Wed, 14 May 2014 21:48:00 -0400 From: Allan Jude <freebsd@allanjude.com> To: Devin Teske <dteske@freebsd.org>, roberto@freebsd.org Cc: freebsd-sysinstall@freebsd.org Subject: bsdinstall patch [3/3] variable reuse Message-ID: <53741CD0.9000403@allanjude.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------000708090104070403090106 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit dteske@ reused the variable 'disks' in zfsboot it starts off being used to track the grammar for the number of disks (singular vs plural) and then it is reused as the list of available disks replace the variable with disks_grammar and move 'disk' and 'disks' to msg_ vars so they can be translated in the future. --------------000708090104070403090106 Content-Type: text/x-patch; name="zfsboot.grammar.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="zfsboot.grammar.patch" Index: usr.sbin/bsdinstall/scripts/zfsboot =================================================================== --- usr.sbin/bsdinstall/scripts/zfsboot (revision 266106) +++ usr.sbin/bsdinstall/scripts/zfsboot (working copy) @@ -209,6 +209,8 @@ msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n" msg_disk_info="Disk Info" msg_disk_info_help="Get detailed information on disk device(s)" +msg_disk_singular="disk" +msg_disk_plural="disks" msg_encrypt_disks="Encrypt Disks?" msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions" msg_error="Error" @@ -287,13 +289,14 @@ local usegeli="$msg_no" [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" - local disks n + local disks n disks_grammar f_count n $ZFSBOOT_DISKS - { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar + { [ $n -eq 1 ] && disks_grammar=$msg_disk_singular; } || + disks_grammar=$msg_disk_plural # grammar local menu_list=" '>>> $msg_install' '$msg_install_desc' '$msg_install_help' - 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks' + 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar' '$msg_pool_type_disks_help' '- $msg_rescan_devices' '*' '$msg_rescan_devices_help' --------------000708090104070403090106--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53741CD0.9000403>