-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make desktop files translatable #604
Conversation
Is translating the gschema file useful? Does anybody read the gschema.xml files? Or do the texts from the gschema.xml files show up in some user interface? I don’t know a the moment. |
As far as I know, they show up in tools such as Dconf Editor, and they usually are translated in GNOME and related apps. |
I tried to check how this looks like when using dconf-editor: Surprisingly it just says "No schema found" for all typing-booster dconf/gsettings options. It correctly shows all the options but does not even show the English texts. Weird, what could be the reason for that? |
Interesting. To be honest, I have no idea. :-/ The gschema file looks correct. |
How does it look for you when you do this with dconf-editor? |
The typing-booster namespace is completely missing. The file itself however seems to be installed in a correct place:
Looks like the typing-booster gschema file gets ignored for some reason (most likely because it contains something invalid). |
That's strange. org.freedesktop.ibus.engine.m17n is also missing in dconf-editor on my system. When I compare the m17n and typing-booster gschemas with the other ones, there is one difference: They do not contain |
Peek.2025-01-18.22-18.mp4 |
The ibus-m17n, ibus-table, and ibus-typing-booster offer many different engines which share the same schema but have different paths. The schema path is set dynamically at run time, for example here: https://github.com/mike-fabian/ibus-typing-booster/blob/main/engine/hunspell_table.py#L142 schema_path = '/org/freedesktop/ibus/engine/typing-booster/'
if self._engine_name != 'typing-booster':
try:
match = itb_util.M17N_ENGINE_NAME_PATTERN.search(
self._engine_name)
if not match:
raise ValueError('Invalid engine name.')
self._m17n_ime_lang = match.group('lang')
self._m17n_ime_name = match.group('name')
symbol = ''
for pattern, pattern_symbol in itb_util.M17N_IME_SYMBOLS:
if re.fullmatch(pattern, self._engine_name):
symbol = pattern_symbol
break
self._input_mode_true_symbol = symbol
self._input_mode_false_symbol = '•' + symbol
schema_path = ('/org/freedesktop/ibus/engine/tb/'
f'{self._m17n_ime_lang}/{self._m17n_ime_name}/') Similar for ibus-table and ibus-m17n. |
What OS are you using? I am running (fully updated) Fedora 41. |
The number of engines available varies, for ibus-m17n and ibus-typing-booster it depends on which
As you can see there are a lot of them. Example:
Same, the OS in the video is a fully updated Fedora 41 running in a qemu virtual machine, XFCE desktop. |
An example for an m17n-db input method offered by ibus-typing-booster and ibus-m17n: mfabian@hathi:~
$ ls /usr/share/m17n/latn-post.mim
/usr/share/m17n/latn-post.mim
mfabian@hathi:~
$ ibus list-engine | grep latn-post
tb:t:latn-post - t-latn-post (tb)
m17n:t:latn-post - t-latn-post (m17n)
mfabian@hathi:~
$ dconf dump /org/freedesktop/ibus/engine/m17n/t/latn-post/
[/]
lookup-table-orientation=1
preedit-background='#F9F06B'
preedit-foreground='#EA340A'
preedit-underline=2
use-us-layout=false
mfabian@hathi:~
$ dconf dump /org/freedesktop/ibus/engine/tb/t/latn-post/
[/]
addspaceoncommit=true
arrowkeysreopenpreedit=false
asciidigits=false
... |
And it is also possible to add even more m17n-db input methods in the users home directory, for example I have a tokipona input method here:
Supported by both ibus-m17n and ibus-typing-booster:
These dconf/gsettings are created dynamically at runtime, it is enough to put such an input method into
|
All the many ibus-typing-booster engines share the same schema file because they all have the same possible settings (Although some set different defaults at runtime then the defaults in the schema file). But the paths have to be different because one can user several engines and set the options differently for each engine. |
I think I understand now why You probably never used any of these engines, and if you have used any of them, then you did not change any user settings. Therefore there is nothing in the user settings for any of these engines and then dconf-editor shows nothing. Look at this example screenshot: You see that at Because these are the only Therefore, mfabian@f41:~$ dconf dump /org/freedesktop/ibus/engine/tb/ | grep '^\['
[hi/inscript2]
[hi/itrans]
[mai/inscript]
[mai/inscript2]
[t/latn-post]
[t/rfc1345]
mfabian@f41:~$ |
Ah, that makes sense! I have not used them on this machine. |
Here in this video, I add another one, After doing that, mfabian@f41:~$ dconf dump /org/freedesktop/ibus/engine/tb/ | grep '^\['
[cs/kbd]
[hi/inscript2]
[hi/itrans]
[mai/inscript]
[mai/inscript2]
[t/latn-post]
[t/rfc1345]
mfabian@f41:~$
mfabian@f41:~$ dconf dump /org/freedesktop/ibus/engine/tb/cs/kbd/
[/]
addspaceoncommit=true
offtherecord=true
preeditunderline=1
tabenable=true
mfabian@f41:~$ And in dconf-editor, a new Peek.2025-01-18.23-01.mp4 |
I am afraid dconf-editor will not show these text from the gschema.xml file then if that gschema.xml file is used for many paths set at runtime. Not sure whether it is even possible to fix that in dconf-editor. I can change this settings without problems using dconf-editor, I just cannot see the text explaining the settings from the gschema.xml. If it is not possible to fix that for dconf-editor, we might be translating a lot of strings for nothing. That is a pity though, I wonder whether this can be fixed somehow ... |
I have removed the gschema file from POTFILES.in. We can add it later, in a separate PR. |
Some fun with ChatGPT: |
…tup tool Related: #604 This pull request originally wanted to make the schema file translatable as well. That turned out to be useless at the moment as no tools seem to be able to display texts from schema files when dynamic paths are used. Typing Booster has to use dynamic paths as it offers many engines which share the same schema file but can have different settings. At the moment dconf-editor apparently cannot display texts from a schema file at all if the schema file has no static path. I have no idea whether it is possible fix this in dconf and as long as there are no tools reading and displaying the texts from the schema file, translating it seems useless. But if this ever changes and we want to translate the schema file, the texts in the schema file should not gratuitously differ from the texts in the setup tool. If the texts are identical as far as possible, this reduces the work for the translators. I had already started making the texts in the schema file identical to those in the setup tool before I realized that translations is useless at the moment. Committing these changes anyway cannot hurt, it might be helpful if the situation changes and translating the schema file becomes useful.
Generating translations into the desktop files works now. I changed the comment in the emoji-picker.desktop.in.in to the same string as in the metainfo.xml to make translations reusable:
So Czech is already there in the generated emoji-picker.desktop:
For the ibus-setup-typing-booster.desktop I was unable to reuse existing strings, so that needs two new strings translated, see: https://translate.fedoraproject.org/translate/ibus-typing-booster/-/cs/?q=state:%3Ctranslated
|
@AsciiWolf Thank you, that worked!:
|
Same procedure for ibus-table, make desktop file translatable and generate translations into desktop file: |
Great, thanks! :-) Please also do it for ibus-m17n if possible. |
ibus-m17n already has a translatable desktop file, I think. |
mfabian@hathi:/local/mfabian/src/ibus-m17n (release-candidate-1.4.35)
$ cat src/ibus-setup-m17n.desktop
[Desktop Entry]
Name[de]=IBus M17n Einstellungen
Name[zh_CN]=IBus M17N 设置
Name[tr]=IBus M17N Kurulumu
Name[uk]=Налаштування M17N IBus
Name[id]=IBus M17N Setup
Name[ja]=IBus M17N の設定
Name[pt_BR]=Configuração do IBus M17N
Name[fr]=Configuration d’IBus M17N
Name[es]=Ajuste IBus M17N
Name[si]=IBus M17N පිහිටුවීම
Name[bn]=আইবাস এম17এন সেটআপ
Name[ar]=إعداد IBus M17N
Name[ka]=IBus M17N -ის მორგება
Name[sv]=Installation av IBus M17N
Name[lt]=IBus M17N sąranka
Name[hi]=आईबीस एम17एन सेटअप
Name[ru]=Настройка IBus M17N
Name[ml]=ഐബസ് എം17എന് സജ്ജീകരണങ്ങള്
Name[cs]=Nastavení IBus M17N
Name[el]=Διευθέτηση IBus M17N
Name[kab]=Asesteb IBus M17N
Name=IBus M17N Setup
Comment[de]=IBus M17N Einstellungen
Comment[zh_CN]=设置 IBus M17N 引擎
Comment[tr]=IBus M17N motorunu kur
Comment[uk]=Налаштувати рушій M17N IBus
Comment[id]=Set up IBus M17N mesin
Comment[ja]=IBus M17n エンジンを設定する
Comment[pt_BR]=Configure o motor IBus M17N
Comment[fr]=Configurer le moteur IBus M17N
Comment[es]=Ajuste motor IBus M17N
Comment[si]=IBus M17N යන්ත්රය පිහිටුවන්න
Comment[bn]=আইবাস এম17এন ইঞ্জিন সেট আপ করুন
Comment[ar]=إعداد محرك IBus M17N
Comment[ka]=მოირგეთ IBus M17N ძრავა
Comment[sv]=Ställ in IBus M17N-motor
Comment[lt]=Nustatyti IBus M17N modulį
Comment[hi]=आईबीस एम17एन इंजन सेट करें
Comment[ru]=Настройка движка IBus M17N
Comment[ml]=ഐബസ് എം17എന് സജ്ജീകരിക്കുക
Comment[cs]=Nastavte modul IBus M17N
Comment[el]=Διευθέτηση μηχανής IBus M17N
Comment[kab]=Sbadu amsedday IBus M17N
Comment=Set up IBus M17N engine
Exec=/usr/libexec/ibus-setup-m17n
NoDisplay=true
Type=Application
StartupNotify=true
mfabian@hathi:/local/mfabian/src/ibus-m17n (release-candidate-1.4.35)
$ |
Probably won't work until #597 gets fixed, but let's add them there.