2022-07-16 14:13:03 -07:00
|
|
|
local util = require("modules.ibus.util")
|
2022-08-03 18:04:09 -07:00
|
|
|
local popup = require("modules.ibus.popup")
|
|
|
|
local widget = require("modules.ibus.widget")
|
2022-07-16 14:13:03 -07:00
|
|
|
|
|
|
|
return {
|
2022-07-16 19:12:29 -07:00
|
|
|
widget = require("modules.ibus.widget").widget,
|
2022-07-16 14:13:03 -07:00
|
|
|
keybinds = require("modules.ibus.keybinds"),
|
|
|
|
|
2022-08-03 18:04:09 -07:00
|
|
|
set = function(lang)
|
|
|
|
-- Switch to a language. Used by host interface.
|
|
|
|
|
|
|
|
local lang_id
|
|
|
|
for k, v in pairs(config.ibus.language_list) do
|
|
|
|
if (v["indicator_code"] == lang) then
|
|
|
|
lang_id = k
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
util.set(lang_id, function()
|
|
|
|
popup.update()
|
|
|
|
widget.update()
|
|
|
|
end)
|
|
|
|
end,
|
|
|
|
|
2022-07-16 14:13:03 -07:00
|
|
|
init = function()
|
|
|
|
util.set(1)
|
|
|
|
end
|
|
|
|
}
|