Skip to content

Commit

Permalink
use more consistent wording
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 10, 2020
1 parent da12b85 commit 6c0117b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 47 deletions.
76 changes: 48 additions & 28 deletions src/lib/bootloader/grub2.rb
Expand Up @@ -188,87 +188,107 @@ def disk_order_summary
)
end

# Gets all location where stage1 will be written
def locations
locations = []

partition_location = Yast::BootStorage.boot_partitions.map(&:name).join(", ")
locations << partition_location + _(" (/boot)") if stage1.boot_partition?
locations << partition_location if stage1.boot_partition?
if stage1.extended_boot_partition?
partitions = Yast::BootStorage.boot_partitions.map do |partition|
Yast::BootStorage.extended_for_logical(partition).name
end
locations << partitions.join(", ") + _(" (/boot)")
end
if stage1.mbr?
# TRANSLATORS: MBR is acronym for Master Boot Record, if nothing locally specific
# is used in your language, then keep it as it is.
locations << Yast::BootStorage.boot_disks.map(&:name).join(", ") + _(" (MBR)")
locations << partitions.join(", ")
end
locations << Yast::BootStorage.boot_disks.map(&:name).join(", ") if stage1.mbr?
locations << stage1.custom_devices if !stage1.custom_devices.empty?

locations
end

def mbr_line
if stage1.mbr?
# TRANSLATORS: summary line where %s is disk specified, can be more disks, separated by comma
res = if stage1.mbr?
_(
"Install bootcode into MBR (<a href=\"disable_boot_mbr\">do not install</a>)"
"Write into MBR %s (<a href=\"disable_boot_mbr\">do not write</a>)"
)
# TRANSLATORS: summary line where %s is disk specified, can be more disks, separated by comma
else
_(
"Do not install bootcode into MBR (<a href=\"enable_boot_mbr\">install</a>)"
"Do not write into MBR %s (<a href=\"enable_boot_mbr\">write</a>)"
)
end

format(res, Yast::BootStorage.boot_disks.map(&:name).join(", "))
end

def partition_line
if stage1.boot_partition?
# TRANSLATORS: summary line where %s is partition specified, can be more disks,
# separated by comma
res = if stage1.boot_partition?
_(
"Install boot code into a partition with /boot " \
"(<a href=\"disable_boot_boot\">do not install</a>)"
"Write into a partition with /boot %s" \
"(<a href=\"disable_boot_boot\">do not write</a>)"
)
# TRANSLATORS: summary line where %s is partition specified, can be more disks,
# separated by comma
else
_(
"Do not install boot code into a partition with /boot " \
"(<a href=\"enable_boot_boot\">install</a>)"
"Do not write into a partition with /boot %s" \
"(<a href=\"enable_boot_boot\">write</a>)"
)
end
format(res, Yast::BootStorage.boot_partitions.map(&:name).join(", "))
end

def logical_partition_line
if stage1.boot_partition?
# TRANSLATORS: summary line where %s is partition specified, can be more disks,
# separated by comma
res = if stage1.boot_partition?
_(
"Install boot code into a logical partition with /boot " \
"(<a href=\"disable_boot_boot\">do not install</a>)"
"Write into a logical partition with /boot %s" \
"(<a href=\"disable_boot_boot\">do not write</a>)"
)
# TRANSLATORS: summary line where %s is partition specified, can be more disks,
# separated by comma
else
_(
"Do not install boot code into a logical partition with /boot " \
"(<a href=\"enable_boot_boot\">install</a>)"
"Do not write into a logical partition with /boot %s" \
"(<a href=\"enable_boot_boot\">write</a>)"
)
end
format(res, Yast::BootStorage.boot_partitions.map(&:name).join(", "))
end

def extended_partition_line
if stage1.extended_boot_partition?
# TRANSLATORS: summary line where %s is partition specified, can be more disks,
# separated by comma
res = if stage1.extended_boot_partition?
_(
"Install boot code into a extended partition with /boot " \
"(<a href=\"disable_boot_extended\">do not install</a>)"
"Write into an extended partition with /boot %s" \
"(<a href=\"disable_boot_extended\">do not write</a>)"
)
# TRANSLATORS: summary line where %s is partition specified, can be more disks,
# separated by comma
else
_(
"Do not install boot code into a extended partition with /boot " \
"(<a href=\"enable_boot_extended\">install</a>)"
"Do not into an extended partition with /boot %s" \
"(<a href=\"enable_boot_extended\">write</a>)"
)
end

partitions = Yast::BootStorage.boot_partitions.map do |partition|
Yast::BootStorage.extended_for_logical(partition).name
end
format(res, partitions.join(", "))
end

# FATE#303643 Enable one-click changes in bootloader proposal
#
#
def url_location_summary
log.info "Prepare url summary for GRUB2"
line = +"<ul>\n<li>"
line = +"<ul><li>"
line << mbr_line
line << "</li>\n"

Expand All @@ -288,15 +308,15 @@ def url_location_summary

if stage1.devices.empty?
# no location chosen, so warn user that it is problem unless he is sure
msg = _("Warning: No location for bootloader stage1 selected." \
msg = _("Warning: No location for boot code selected." \
"Unless you know what you are doing please select above location.")
line << "<li>" << Yast::HTML.Colorize(msg, "red") << "</li>"
end

line << "</ul>"

# TRANSLATORS: title for list of location proposals
_("Change Location: %s") % line
_("Boot Code: %s") % line
end

# summary for various boot flags
Expand Down
43 changes: 24 additions & 19 deletions src/lib/bootloader/grub2_widgets.rb
Expand Up @@ -324,21 +324,21 @@ def initialize
end

def label
_("Enable &Secure Boot Support")
_("&Secure Boot Support")
end

def help
if Yast::Arch.s390
_(
"<p><b>Enable Secure Boot Support</b> if checked enables Secure Boot support.<br>" \
"<p><b>Secure Boot Support</b> if checked enables Secure Boot support.<br>" \
"This does not turn on secure booting. " \
"It only switches to the new secure-boot enabled boot data format. " \
"Note that this new format works only on z15 or later and only for zFCP disks. " \
"The system does not boot if these requirements are not met.</p>"
)
else
_(
"<p><b>Enable Secure Boot Support</b> if checked enables Secure Boot support.<br>" \
"<p><b>Secure Boot Support</b> if checked enables Secure Boot support.<br>" \
"This does not turn on secure booting. " \
"It only sets up the boot loader in a way that supports secure booting. " \
"You still have to enable Secure Boot in the UEFI Firmware.</p> "
Expand Down Expand Up @@ -379,7 +379,7 @@ def initialize
end

def label
_("Enable &Trusted Boot Support")
_("&Trusted Boot Support")
end

def help
Expand Down Expand Up @@ -595,10 +595,10 @@ def contents
def help
# Translators: do not translate the quoted parts like "unit"
_(
"<p><b>Use graphical console</b> when checked it allows to use various " \
"<p><b>Graphical console</b> when checked it allows to use various " \
"display resolutions. The <tt>auto</tt> option tries to find " \
"the best one when booting starts.</p>\n" \
"<p><b>Use serial console</b> when checked it redirects the boot output " \
"<p><b>Serial console</b> when checked it redirects the boot output " \
"to a serial device like <tt>ttyS0</tt>. " \
"At least the <tt>--unit</tt> option has to be specified, " \
"and the complete syntax is <tt>%s</tt>. " \
Expand Down Expand Up @@ -713,7 +713,7 @@ def syntax
def graphical_console_frame
CheckBoxFrame(
Id(:gfxterm_frame),
_("Use &graphical console"),
_("&Graphical console"),
true,
HBox(
HSpacing(2),
Expand Down Expand Up @@ -762,7 +762,7 @@ def vga_modes_items
def serial_console_frame
CheckBoxFrame(
Id(:console_frame),
_("Use &serial console"),
_("&Serial console"),
true,
HBox(
HSpacing(2),
Expand Down Expand Up @@ -821,7 +821,7 @@ def contents

VBox(
Frame(
_("Boot Loader Location"),
_("Boot Code Location"),
HBox(
HSpacing(1),
VBox(*location_checkboxes),
Expand Down Expand Up @@ -910,20 +910,25 @@ def locations

def location_checkboxes
checkboxes = []
checkboxes << checkbox(:boot, _("Boo&t from Partition")) if locations.include?(:boot)
if locations.include?(:logical)
checkboxes << checkbox(:logical, _("Boo&t from Logical Partition"))
end
if locations.include?(:extended)
checkboxes << checkbox(:extended, _("Boot from &Extended Partition"))
end
checkboxes << checkbox(:mbr, _("Boot from &Master Boot Record")) if locations.include?(:mbr)
# TRANSLATORS: %s is used to specify exact devices
add_checkbox(checkboxes, :boot,
format(_("Wri&te to Partition (%s)"), stage1.boot_partition_names.join(", ")))
# TRANSLATORS: %s is used to specify exact devices
add_checkbox(checkboxes, :logical,
format(_("Wri&te to Logical Partition (%s)"), stage1.boot_partition_names.join(", ")))
# TRANSLATORS: %s is used to specify exact devices
add_checkbox(checkboxes, :extended,
format(_("Write to &Extended Partition (%s)"),
stage1.extended_boot_partition_names.join(", ")))
# TRANSLATORS: %s is used to specify exact devices
add_checkbox(checkboxes, :mbr,
format(_("Write to &Master Boot Record (%s)"), stage.boot_disk_names.join(", ")))

checkboxes.concat(custom_partition_content)
end

def checkbox(id, title)
Left(CheckBox(Id(id), title))
def add_checkbox(checkboxes, id, title)
checkboxes << Left(CheckBox(Id(id), title)) if locations.include?(id)
end

def custom_partition_content
Expand Down

0 comments on commit 6c0117b

Please sign in to comment.