From 64601f5bfbdd87d8c03da89b2789c6df7630d4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Tue, 26 Dec 2023 08:12:34 +0000 Subject: [PATCH] Mark some Agama service strings for translation --- service/lib/agama/manager.rb | 21 ++++++++++++--------- service/lib/agama/storage/manager.rb | 19 +++++++++++-------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/service/lib/agama/manager.rb b/service/lib/agama/manager.rb index 48579520c6..fe2ae6d25a 100644 --- a/service/lib/agama/manager.rb +++ b/service/lib/agama/manager.rb @@ -44,6 +44,7 @@ module Agama class Manager include WithProgress include Helpers + include Yast::I18n # @return [Logger] attr_reader :logger @@ -58,6 +59,8 @@ class Manager # # @param logger [Logger] def initialize(config, logger) + textdomain "agama" + @config = config @logger = logger @installation_phase = InstallationPhase.new @@ -82,8 +85,8 @@ def config_phase installation_phase.config start_progress(2) - progress.step("Probing Storage") { storage.probe } - progress.step("Probing Software") { software.probe } + progress.step(_("Probing Storage")) { storage.probe } + progress.step(_("Probing Software")) { software.probe } logger.info("Config phase done") rescue StandardError => e @@ -103,7 +106,7 @@ def install_phase Yast::Installation.destdir = "/mnt" - progress.step("Partitioning") do + progress.step(_("Partitioning")) do storage.install proxy.propose # propose software after /mnt is already separated, so it uses proper @@ -111,14 +114,14 @@ def install_phase software.propose end - progress.step("Installing Software") { software.install } + progress.step(_("Installing Software")) { software.install } on_target do - progress.step("Writing Users") { users.write } - progress.step("Writing Network Configuration") { network.install } - progress.step("Saving Language Settings") { language.finish } - progress.step("Writing repositories information") { software.finish } - progress.step("Finishing storage configuration") { storage.finish } + progress.step(_("Writing Users")) { users.write } + progress.step(_("Writing Network Configuration")) { network.install } + progress.step(_("Saving Language Settings")) { language.finish } + progress.step(_("Writing repositories information")) { software.finish } + progress.step(_("Finishing storage configuration")) { storage.finish } end logger.info("Install phase done") diff --git a/service/lib/agama/storage/manager.rb b/service/lib/agama/storage/manager.rb index 54e812e358..7eecdea6a4 100644 --- a/service/lib/agama/storage/manager.rb +++ b/service/lib/agama/storage/manager.rb @@ -44,6 +44,7 @@ module Storage class Manager include WithIssues include WithProgress + include Yast::I18n # @return [Config] attr_reader :config @@ -53,6 +54,8 @@ class Manager # @param config [Config] # @param logger [Logger] def initialize(config, logger) + textdomain "agama" + @config = config @logger = logger register_proposal_callbacks @@ -105,10 +108,10 @@ def on_probe(&block) def probe start_progress(4) config.pick_product(software.selected_product) - progress.step("Activating storage devices") { activate_devices } - progress.step("Probing storage devices") { probe_devices } - progress.step("Calculating the storage proposal") { calculate_proposal } - progress.step("Selecting Linux Security Modules") { security.probe } + progress.step(_("Activating storage devices")) { activate_devices } + progress.step(_("Probing storage devices")) { probe_devices } + progress.step(_("Calculating the storage proposal")) { calculate_proposal } + progress.step(_("Selecting Linux Security Modules")) { security.probe } update_issues @on_probe_callbacks&.each(&:call) end @@ -116,14 +119,14 @@ def probe # Prepares the partitioning to install the system def install start_progress(4) - progress.step("Preparing bootloader proposal") do + progress.step(_("Preparing bootloader proposal")) do # first make bootloader proposal to be sure that required packages are installed proposal = ::Bootloader::ProposalClient.new.make_proposal({}) logger.debug "Bootloader proposal #{proposal.inspect}" end - progress.step("Adding storage-related packages") { add_packages } - progress.step("Preparing the storage devices") { perform_storage_actions } - progress.step("Writing bootloader sysconfig") do + progress.step(_("Adding storage-related packages")) { add_packages } + progress.step(_("Preparing the storage devices")) { perform_storage_actions } + progress.step(_("Writing bootloader sysconfig")) do # call inst bootloader to get properly initialized bootloader # sysconfig before package installation Yast::WFM.CallFunction("inst_bootloader", [])