-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set installer language and keyboard layout #1375
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b22b4cf
fix(dbus): refresh AvailableProducts property
imobachgs 28bf296
feat(dbus): use a explicit method to change the locale
imobachgs aa19a27
feat(rust): use the SetLocale function
imobachgs b56d3d5
feat: AvailableProducts is now a D-Bus method
imobachgs 7aa964e
chore(rust): make rustfmt happy
imobachgs 114f718
fix(web): move the LogsButton to the sidebar
imobachgs e68b697
feat(web): fix language switching
imobachgs 3c556bf
chore(web): drop unused language/keymap switchers
imobachgs 5cb71f1
fix(web): remove options from the installation progress
imobachgs d70a751
fix(web): fix InstallationFinished tests
imobachgs c76a3f1
fix(web): do not allow changing the keyboard on remote installations
imobachgs 969f7aa
doc: update changes files
imobachgs 05dfb88
Merge branch 'master' into set-locale
imobachgs 93c611b
fix(web): show installer options only in the Overview
imobachgs fe4090a
doc(dbus): specify the locale format in SetLocale
imobachgs 13e8051
Merge branch 'master' into set-locale
imobachgs 47e43c1
Merge branch 'master' into set-locale
imobachgs 624e68c
Merge branch 'master' into set-locale
imobachgs d472344
fix(web): fix a typo in a test
imobachgs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
# | ||
# All Rights Reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it | ||
# under the terms of version 2 of the GNU General Public License as published | ||
# by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, contact SUSE LLC. | ||
# | ||
# To contact SUSE LLC about this file by physical or electronic mail, you may | ||
# find current contact information at www.suse.com. | ||
|
||
module Agama | ||
module DBus | ||
module Clients | ||
# Mixin for clients of services that define the Locale D-Bus interface | ||
# | ||
# Provides a method to interact with the API of the Locale interface. | ||
# | ||
# @note This mixin is expected to be included in a class inherited from {Clients::Base} and | ||
# it requires a #dbus_object method that returns a {::DBus::Object} implementing the | ||
# Locale interface. | ||
module WithLocale | ||
# Changes the service locale | ||
# | ||
# @param locale [String] new locale | ||
def locale=(locale) | ||
dbus_object.SetLocale(locale) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) [2024] SUSE LLC | ||
# | ||
# All Rights Reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify it | ||
# under the terms of version 2 of the GNU General Public License as published | ||
# by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
# more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along | ||
# with this program; if not, contact SUSE LLC. | ||
# | ||
# To contact SUSE LLC about this file by physical or electronic mail, you may | ||
# find current contact information at www.suse.com. | ||
|
||
require "yast" | ||
require "dbus" | ||
|
||
Yast.import "WFM" | ||
|
||
module Agama | ||
module DBus | ||
module Interfaces | ||
# Mixin to define the Locale interface. | ||
# | ||
# @note This mixin is expected to be included in a class that inherits from {DBus::BaseObject} | ||
# and it requires a #locale= method that sets the service's locale. | ||
module Locale | ||
include Yast::I18n | ||
include Yast::Logger | ||
|
||
LOCALE_INTERFACE = "org.opensuse.Agama1.Locale" | ||
|
||
def self.included(base) | ||
base.class_eval do | ||
dbus_interface LOCALE_INTERFACE do | ||
# It expects a locale (en_US.UTF-8) as argument. | ||
dbus_method :SetLocale, "in locale:s" do |locale| | ||
self.locale = locale | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Names of locales differ, notably between Linux and browsers:
en_US.UTF-8
vsen-us
so we should specify what the API expects or we will get subtle bugsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, it expects an
en_US.UTF-8
kind of locale. That's the only locale that the backend understands. The transformation is performed in the installerL10n.jsx context.I have added a comment to clarify that. Thanks!