Calling popover.show() returns control to the main loop, but squeekboard structures are still borrowed meanwhile. That's dangerous and forbidden in Rust. Therefore, this forces the return from the stack and release of the borrows before the glib main loop is invoked again.
xkb layouts are translated fine by libgnome-desktop. If not
we should go fixing there since that makes keyboard layout
strings consistent with e.g. gnome-control-center.
There weren't any 'exotic' strings in the current translations
so what we get from libgnome-desktop should be just fine.
Handled via po. Remove now empty files. The match with resources.rs
shows that some of them weren't even used (e.g. fa-IR) showing why a
switch to po is useful (which allows to maintain us that outside of
code).
Single words are hard to translate in context, give some indication what
they do. They're automatically extracted into the pot file.
#. translators: This is a emmoji keyboard layout
#: data/popover.ui:6
msgid "Emoji"
msgstr "…"
#. translators: This is a terminal keyboard layout
#: data/popover.ui:12
msgid "Terminal"
msgstr "…"
This allows them to be translated via po so we don't have to maintain
the translation list by hand or care about empty translation files.
The only downside is that the "overlay layouts" in OVERLAY_NAMES need to
match the ones in the ui file but since a missing one is a clean crash
when selected there's little potential for subtle breackage. We could
even ensure consistency by comparing the two at run time but they change
only slowly this is not much of an issue (compared to how e.g. new
languages can be added now).
There's a lot of expectations to make Squeekboard merely a keyboard for the sake of desktop-like workflows, which would hinder the common use case of entering text. The new wording hopefully doesn't foster such a misunderstanding.
Since the current code uses a handcoded approach for popup construction
reuse the unused ui file to keep translatable strings. Since UI file in
popover.rs runs through glib the strings get translated.
Future rework will allow us to get rid of this duplication but since the
ui file went unnoticed for so long who could possibly complain.
Closes: #315