Skip to content

Commit

Permalink
gui: tui: Reword messages for advanced disk config
Browse files Browse the repository at this point in the history
Fixes: clearlinux#533

Change from partition label to partition name to be consistent
with how the data is named in the external tools.

Signed-off-by: Mark D Horn <[email protected]>
  • Loading branch information
mdhorn committed Sep 24, 2019
1 parent 19c777a commit 0e1188d
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 53 deletions.
7 changes: 5 additions & 2 deletions gui/pages/disk_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,16 @@ func NewDiskConfigPage(controller Controller, model *model.SystemInstall) (Page,
} else {
sc.AddClass("label-radio")
}
reqs := []string{"CLR_BOOT:vfat", "CLR_SWAP:linux-swap", "CLR_ROOT:ext*|xfs"}
disk.advancedButton.SetTooltipText(utils.Locale.Get("Minimum requirements: %s", strings.Join(reqs, ", ")))
advancedBox.PackStart(disk.advancedButton, false, false, 0)
if _, err := disk.advancedButton.Connect("toggled", disk.advancedButtonToggled); err != nil {
return nil, err
}

advancedDescription := utils.Locale.Get("Use partitioning tool to configure and select media via partition labels.")
advancedDescription := utils.Locale.Get("Use partitioning tool to configure and select media via partition names.")
advancedLabel, err := gtk.LabelNew(advancedDescription)

if err != nil {
return nil, err
}
Expand All @@ -394,7 +397,7 @@ func NewDiskConfigPage(controller Controller, model *model.SystemInstall) (Page,
if err != nil {
return nil, err
}
disk.partitionButton.SetTooltipText(utils.Locale.Get("Launch the external partitioning tool to label the partitions to be used for the installation."))
disk.partitionButton.SetTooltipText(utils.Locale.Get("Launch the external partitioning tool to name the partitions to be used for the installation."))

if _, err = disk.partitionButton.Connect("clicked", disk.runDiskPartitionTool); err != nil {
return nil, err
Expand Down
27 changes: 14 additions & 13 deletions locale/en_US/LC_MESSAGES/clr-installer.po
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ msgstr "Erase Disk"
msgid "Advanced"
msgstr "Advanced"

msgid "Labeled"
msgstr "Labeled"

msgid "No media found for installation"
msgstr "No media found for installation"

Expand Down Expand Up @@ -332,14 +329,18 @@ msgstr "Erase all data on selected media and install Clear Linux* OS."
msgid "Advanced Installation"
msgstr "Advanced Installation"

msgid "Use partitioning tool to configure and select media via partition labels."
msgstr "Use partitioning tool to configure and select media via partition labels."
msgid "Use partitioning tool to configure and select media via partition names."
msgstr "Use partitioning tool to configure and select media via partition names."

#, c-format
msgid "Minimum requirements: %s"
msgstr "Minimum requirements: %s"

msgid "PARTITION MEDIA"
msgstr "PARTITION MEDIA"

msgid "Launch the external partitioning tool to label the partitions to be used for the installation."
msgstr "Launch the external partitioning tool to label the partitions to be used for the installation."
msgid "Launch the external partitioning tool to name the partitions to be used for the installation."
msgstr "Launch the external partitioning tool to name the partitions to be used for the installation."

#, c-format
msgid "Could not launch %s. Check log %s"
Expand All @@ -350,20 +351,20 @@ msgid "%s must be %s"
msgstr "%s must be %s"

#, c-format
msgid "Found multiple %s partition labels"
msgstr "Found multiple %s partition labels"
msgid "Found multiple %s partition names"
msgstr "Found multiple %s partition names"

#, c-format
msgid "Found invalid %s partition label"
msgstr "Found invalid %s partition label"
msgid "Found invalid %s partition name"
msgstr "Found invalid %s partition name"

#, c-format
msgid "Encryption of %s is not supported"
msgstr "Encryption of %s is not supported"

#, c-format
msgid "Missing %s partition label"
msgstr "Missing %s partition label"
msgid "Missing %s partition name"
msgstr "Missing %s partition name"

msgid "CHANGE LANGUAGE"
msgstr "CHANGE LANGUAGE"
Expand Down
27 changes: 14 additions & 13 deletions locale/es_MX/LC_MESSAGES/clr-installer.po
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ msgstr "Borrar disco"
msgid "Advanced"
msgstr "Avanzado"

msgid "Labeled"
msgstr "Etiquetado"

msgid "No media found for installation"
msgstr "No se encontraron medios para instalar."

Expand Down Expand Up @@ -332,14 +329,18 @@ msgstr "Elimina todos los datos del medio seleccionado y permite instalar el sis
msgid "Advanced Installation"
msgstr "Instalación avanzada"

msgid "Use partitioning tool to configure and select media via partition labels."
msgstr "Utilice la herramienta de partición para configurar y seleccionar medios a través de etiquetas de partición."
msgid "Use partitioning tool to configure and select media via partition names."
msgstr "Utilice la herramienta de partición para configurar y seleccionar medios a través de nombres de partición."

#, c-format
msgid "Minimum requirements: %s"
msgstr "Requisitos mínimos: %s"

msgid "PARTITION MEDIA"
msgstr "MEDIOS DE PARTICION"

msgid "Launch the external partitioning tool to label the partitions to be used for the installation."
msgstr "Inicie la herramienta de particionamiento externo para etiquetar las particiones que se utilizarán para la instalación."
msgid "Launch the external partitioning tool to name the partitions to be used for the installation."
msgstr "Inicie la herramienta de particionamiento externo para asignar un nombre a las particiones que se utilizarán para la instalación."

#, c-format
msgid "Could not launch %s. Check log %s"
Expand All @@ -350,20 +351,20 @@ msgid "%s must be %s"
msgstr "%s debe ser %s"

#, c-format
msgid "Found multiple %s partition labels"
msgstr "Se encontraron varias etiquetas de partición %s"
msgid "Found multiple %s partition names"
msgstr "Encontrados varios nombres de partición %s"

#, c-format
msgid "Found invalid %s partition label"
msgstr "Se ha encontrado una etiqueta de partición %s no válida"
msgid "Found invalid %s partition name"
msgstr "Encontrado nombre de partición %s no válido"

#, c-format
msgid "Encryption of %s is not supported"
msgstr "El cifrado de %s no es compatible"

#, c-format
msgid "Missing %s partition label"
msgstr "Falta la etiqueta de partición %s"
msgid "Missing %s partition name"
msgstr "Falta el nombre de partición %s"

msgid "CHANGE LANGUAGE"
msgstr "CAMBIAR IDIOMA"
Expand Down
27 changes: 14 additions & 13 deletions locale/zh_CN/LC_MESSAGES/clr-installer.po
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ msgstr "擦除磁盘"
msgid "Advanced"
msgstr "高级"

msgid "Labeled"
msgstr "标记"

msgid "No media found for installation"
msgstr "未找到安装媒介"

Expand Down Expand Up @@ -332,14 +329,18 @@ msgstr "擦除选定媒介上的所有数据,然后安装 Clear Linux* OS。"
msgid "Advanced Installation"
msgstr "高级安装"

msgid "Use partitioning tool to configure and select media via partition labels."
msgstr "使用分区工具通过分区标签配置和选择媒体。"
msgid "Use partitioning tool to configure and select media via partition names."
msgstr "使用分区工具通过分区名称配置和选择媒体。"

#, c-format
msgid "Minimum requirements: %s"
msgstr "最低要求:%s"

msgid "PARTITION MEDIA"
msgstr "分区媒体"

msgid "Launch the external partitioning tool to label the partitions to be used for the installation."
msgstr "启动外部分区工具以标记要用于安装的分区。"
msgid "Launch the external partitioning tool to name the partitions to be used for the installation."
msgstr "启动外部分区工具以命名要用于安装的分区。"

#, c-format
msgid "Could not launch %s. Check log %s"
Expand All @@ -350,20 +351,20 @@ msgid "%s must be %s"
msgstr "%s 必须为 %s"

#, c-format
msgid "Found multiple %s partition labels"
msgstr "找到多个 %s 分区标签"
msgid "Found multiple %s partition names"
msgstr "找到多个 %s 分区名称"

#, c-format
msgid "Found invalid %s partition label"
msgstr "发现无效的 %s 分区标签"
msgid "Found invalid %s partition name"
msgstr "找到无效的 %s 分区名称"

#, c-format
msgid "Encryption of %s is not supported"
msgstr "不支持 %s 加密"

#, c-format
msgid "Missing %s partition label"
msgstr "缺少 %s 分区标签"
msgid "Missing %s partition name"
msgstr "缺少 %s 分区名称"

msgid "CHANGE LANGUAGE"
msgstr "更改语言"
Expand Down
22 changes: 11 additions & 11 deletions storage/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -1432,15 +1432,15 @@ func FindAdvancedInstallTargets(medias []*BlockDevice) []*BlockDevice {
label := ch.PartitionLabel

if label != "" {
log.Debug("FindAdvancedInstallTargets: Found partition %s with label %s", ch.Name, label)
log.Debug("FindAdvancedInstallTargets: Found partition %s with name %s", ch.Name, label)
}

for _, part := range strings.Split(label, "_") {
lowerPart := strings.ToLower(part)

if !clrFound {
if lowerPart == "clr" {
log.Debug("FindAdvancedInstallTargets: Partition label contains clr %s", ch.Name)
log.Debug("FindAdvancedInstallTargets: Partition name contains clr %s", ch.Name)
clrFound = true
}
continue
Expand Down Expand Up @@ -1539,7 +1539,7 @@ func FormatInstallPortion(target InstallTarget) string {
if target.EraseDisk {
portion = ""
} else {
portion = utils.Locale.Get("Labeled")
portion = utils.Locale.Get("Advanced")
}
}

Expand Down Expand Up @@ -1586,7 +1586,7 @@ func validateAdvancedPartitions(rootSize uint64, medias []*BlockDevice) []string
label := ch.PartitionLabel

if label != "" {
log.Debug("validateAdvancedPartitions: Found partition %s with label %s", ch.Name, label)
log.Debug("validateAdvancedPartitions: Found partition %s with name %s", ch.Name, label)
}

for _, part := range strings.Split(label, "_") {
Expand All @@ -1602,7 +1602,7 @@ func validateAdvancedPartitions(rootSize uint64, medias []*BlockDevice) []string
switch lowerPart {
case "boot":
if bootFound {
warning := utils.Locale.Get("Found multiple %s partition labels", "CLR_BOOT")
warning := utils.Locale.Get("Found multiple %s partition names", "CLR_BOOT")
results = append(results, warning)
log.Warning("validateAdvancedPartitions: %s %+v", warning, ch)
} else {
Expand All @@ -1622,7 +1622,7 @@ func validateAdvancedPartitions(rootSize uint64, medias []*BlockDevice) []string
}
case "root":
if rootFound {
warning := utils.Locale.Get("Found multiple %s partition labels", "CLR_ROOT")
warning := utils.Locale.Get("Found multiple %s partition names", "CLR_ROOT")
results = append(results, warning)
log.Warning("validateAdvancedPartitions: %s %+v", warning, ch)
} else {
Expand All @@ -1643,7 +1643,7 @@ func validateAdvancedPartitions(rootSize uint64, medias []*BlockDevice) []string
}
case "swap":
if swapFound {
warning := utils.Locale.Get("Found multiple %s partition labels", "CLR_SWAP")
warning := utils.Locale.Get("Found multiple %s partition names", "CLR_SWAP")
results = append(results, warning)
log.Warning("validateAdvancedPartitions: %s %+v", warning, ch)
} else {
Expand All @@ -1663,7 +1663,7 @@ func validateAdvancedPartitions(rootSize uint64, medias []*BlockDevice) []string
}
case "mnt":
failed := false
warning := utils.Locale.Get("Found invalid %s partition label", label)
warning := utils.Locale.Get("Found invalid %s partition name", label)

mntParts := strings.Split(label, "MNT_")
if len(mntParts) != 2 {
Expand Down Expand Up @@ -1700,19 +1700,19 @@ func validateAdvancedPartitions(rootSize uint64, medias []*BlockDevice) []string
}

if !bootFound {
warning := utils.Locale.Get("Missing %s partition label", "CLR_BOOT")
warning := utils.Locale.Get("Missing %s partition name", "CLR_BOOT")
results = append(results, warning)
log.Warning("validateAdvancedPartitions: %s", warning)
}

if !swapFound {
warning := utils.Locale.Get("Missing %s partition label", "CLR_SWAP")
warning := utils.Locale.Get("Missing %s partition name", "CLR_SWAP")
results = append(results, warning)
log.Warning("validateAdvancedPartitions: %s", warning)
}

if !rootFound {
warning := utils.Locale.Get("Missing %s partition label", "CLR_ROOT")
warning := utils.Locale.Get("Missing %s partition name", "CLR_ROOT")
results = append(results, warning)
log.Warning("validateAdvancedPartitions: %s", warning)
}
Expand Down
2 changes: 1 addition & 1 deletion tui/media_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func newMediaConfigPage(tui *Tui) (Page, error) {
page.advancedRadio.OnChange(page.advancedRadioOnChange)

// Description of Advanced
clui.CreateLabel(radioButtonFrame, 1, 1, "Use partitioning tool to select media via partition labels.", Fixed)
clui.CreateLabel(radioButtonFrame, 1, 1, "Use partitioning tool to select media via partition names.", Fixed)

listFrame := clui.CreateFrame(contentFrame, 60, 4, BorderNone, Fixed)
listFrame.SetPack(clui.Vertical)
Expand Down

0 comments on commit 0e1188d

Please sign in to comment.