diff options
author | Alexander Golubev <[email protected]> | 2024-02-07 08:03:16 +0300 |
---|---|---|
committer | TDE Gitea <[email protected]> | 2024-03-03 17:14:21 +0000 |
commit | 18a8b8d43577941388fa40666641f628860d6f7a (patch) | |
tree | 6a8235e35bfceb4d28911820af24cf4fa6a2c920 /kxkb/rules.cpp | |
parent | 1fea8982fd2f256273989956d962a3daa848041f (diff) | |
download | tdebase-18a8b8d43577941388fa40666641f628860d6f7a.tar.gz tdebase-18a8b8d43577941388fa40666641f628860d6f7a.zip |
kxkb: utilize a translations provseided by xkeyboard-config
xkeyboard-config package comes with a message catalogue of its own to
translate locale, keyboard model and xkb option names. It would be
easier and more robust to utilize it instead of redoing all
translation in-house.
Signed-off-by: Alexander Golubev <[email protected]>
Diffstat (limited to 'kxkb/rules.cpp')
-rw-r--r-- | kxkb/rules.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kxkb/rules.cpp b/kxkb/rules.cpp index 442a78c00..ab89b4f17 100644 --- a/kxkb/rules.cpp +++ b/kxkb/rules.cpp @@ -79,4 +79,11 @@ TQString XkbRules::getLayoutName(LayoutUnit layout) const { fullName += " (" + layout.variant + ")"; } return fullName; -}
\ No newline at end of file +} + +TQString XkbRules::trOpt(TQString opt) { + // xkeyboard-config's translation is generated directly from the xml and has some querks + // like sustitution for the '<' and '>'. We will have to workaroung those manually: + TQString translated = i18n(opt.replace("<", "<").replace(">", ">").utf8()); + return translated.replace("<", "<").replace(">", ">"); +} |