Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve and simplify setting input methods and dictionaries using new…
… helper functions Resolves: #318 New behaviour: Let’s start the setup tool in Hindi locale: $ LC_ALL=hi_IN.UTF-8 python3 setup/main.py & Setting 'dictionary' or 'inputmethod' to an empty string actually sets the default for the current locale: $ dconf write /org/freedesktop/ibus/engine/typing-booster/dictionary '""' $ dconf read /org/freedesktop/ibus/engine/typing-booster/dictionary 'hi_IN,en_GB' $ dconf write /org/freedesktop/ibus/engine/typing-booster/inputmethod '""' $ dconf read /org/freedesktop/ibus/engine/typing-booster/inputmethod 'hi-inscript2,NoIME' The typing booster engine does the same as the setup tool, it converts empty strings to the locale defaults, but only at startup. So when the typing booster engine runs in a different locale than the setup tool, setting empty strings does not cause a conflict. The code to set the locale defaults is only executed in the setup tool then because the typing booster engine is already running. And when it next restarts, these keys are not empty strings anymore because the setup tool already changed them. The new code also does some normalization of the 'dictionary' and 'inputmethod' values (removes encodings, changes to CLDR locale spellings, removes duplicates, normalizes the spellings of the special dictionary 'None' and the special input method 'NoIME'): $ dconf write /org/freedesktop/ibus/engine/typing-booster/dictionary '"nOnE, en_US.UTF8,en_US,en.UTF-8,en,C, nan_TW.utf8@latin,sr_RS.utf8@latin"' $ dconf read /org/freedesktop/ibus/engine/typing-booster/dictionary 'None,en_US,en,en_US_POSIX,nan_Latn_TW,sr_Latn_RS' $ dconf write /org/freedesktop/ibus/engine/typing-booster/inputmethod '"nOiME,, t-latn-post,foobar, "' $ dconf read /org/freedesktop/ibus/engine/typing-booster/inputmethod 'NoIME,t-latn-post,foobar'
- Loading branch information
1 parent
d0df28b
commit 02d9197
Showing
3 changed files
with
38 additions
and
176 deletions.
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