Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions service/lib/agama/autoyast/localization_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# find current contact information at www.suse.com.

require "yast"
require "json"

# :nodoc:
module Agama
Expand Down Expand Up @@ -49,9 +50,15 @@ def read
attr_reader :profile

def keyboard
section = profile.fetch_as_hash("keyboard")
keymap = section["keymap"]
return {} if keymap.nil?
ay_keymap = profile.fetch_as_hash("keyboard")["keymap"]
return {} if ay_keymap.nil?

keyboard = yast_keyboards.find { |k| k["alias"] == ay_keymap }
keymap = if keyboard
keyboard["code"]
else
ay_keymap
end

{ "keyboard" => keymap.to_s }
end
Expand Down Expand Up @@ -79,6 +86,22 @@ def timezone

{ "timezone" => timezone.to_s }
end

YAST_KEYBOARDS_MAP = "/usr/share/agama/yast-keyboards.json"

def yast_keyboards
return @keymaps_map if @keymaps_map

local_path = File.expand_path("../../../share/yast-keyboards.json", __dir__)
puts local_path
path = if File.exist?(local_path)
local_path
else
"/usr/share/agama/yast-keyboards.json"
end

@keymaps_map = JSON.parse(File.read(path))
end
end
end
end
5 changes: 5 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue May 6 11:33:52 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Convert YaST-specific keymap identifiers (gh#agama-project/agama#1902).

-------------------------------------------------------------------
Wed Apr 30 08:18:27 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
Loading
Loading