Skip to content

Commit

Permalink
Mark some Agama service strings for translation (#959)
Browse files Browse the repository at this point in the history
## Problem

Although all the infrastructure to translate the Ruby-based Agama
service is in-place, some strings are still not marked for translation.

## Solution

Mark the manager and software manager progress strings.
  • Loading branch information
imobachgs authored Dec 26, 2023
2 parents 1d3a757 + 64601f5 commit bd09092
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
21 changes: 12 additions & 9 deletions service/lib/agama/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module Agama
class Manager
include WithProgress
include Helpers
include Yast::I18n

# @return [Logger]
attr_reader :logger
Expand All @@ -58,6 +59,8 @@ class Manager
#
# @param logger [Logger]
def initialize(config, logger)
textdomain "agama"

@config = config
@logger = logger
@installation_phase = InstallationPhase.new
Expand All @@ -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
Expand All @@ -103,22 +106,22 @@ 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
# target
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")
Expand Down
19 changes: 11 additions & 8 deletions service/lib/agama/storage/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module Storage
class Manager
include WithIssues
include WithProgress
include Yast::I18n

# @return [Config]
attr_reader :config
Expand All @@ -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
Expand Down Expand Up @@ -105,25 +108,25 @@ 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

# 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", [])
Expand Down

0 comments on commit bd09092

Please sign in to comment.