Skip to content

Commit

Permalink
Select the language packages for installation
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Nov 24, 2023
1 parent ea074d0 commit f8a0c70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions service/lib/agama/software/proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ def initialize_target
Yast::Pkg.TargetFinish # ensure that previous target is closed
Yast::Pkg.TargetInitialize(Yast::Installation.destdir)
Yast::Pkg.TargetLoad
logger.info "Registering locales #{languages}"
Yast::Pkg.SetAdditionalLocales(languages)

preferred, *additional = languages
Yast::Pkg.SetPackageLocale(preferred) if preferred
Yast::Pkg.SetAdditionalLocales(additional)

Yast::Pkg.SetSolverFlags("ignoreAlreadyRecommended" => false, "onlyRequires" => false)
end

Expand Down
3 changes: 2 additions & 1 deletion service/test/agama/software/proposal_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@
end

it "selects the language packages" do
expect(Yast::Pkg).to receive(:SetPackageLocale).with("cs_CZ")
expect(Yast::Pkg).to receive(:SetAdditionalLocales).with(["de_DE"])
subject.languages = ["de_DE"]
subject.languages = ["cs_CZ", "de_DE"]
subject.calculate
end

Expand Down

0 comments on commit f8a0c70

Please sign in to comment.