This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Untranslatable menus when making Multilingual Interface

Tags: None
(comma "," separated)
User avatar
Ashark
Registered Member
Posts
19
Karma
0
Hello.
I am trying to make bilingual interface for kdenlive and for other applications as a bonus.
I developed a bilingwise script to do this.

But I have a problem with translating some elements: they are not being translated at all.
Look at this screenshot to understand what I mean:



The problem occures with some menu items. For example: File, New, Edit and other generic strings are not translated. I thought that maybe translations for them are in some other file. I tryed to bilingwise file ./4/ru/messages/kdelibs/kdelibs4.po, but it did not worked.

Can someone help me with replacing such generic strings with multilingual strings? In which file they are stored?
Also, I want to find out several other questions:
How can I add additional language to kde? I mean another locale. For now I just replace one of existing languages (for example, german), but I want user to have ability to freely switch between bilingual/singlelingual interfaces.
Find out why some elements in application are not translated, despite the fact they are surely bilingwised in po file and are written with i18n() function in code (High Quality, for example).
lueck
Mentor
Posts
225
Karma
2
Ashark wrote:Hello.
The problem occures with some menu items. For example: File, New, Edit and other generic strings are not translated. I thought that maybe translations for them are in some other file. I tryed to bilingwise file ./4/ru/messages/kdelibs/kdelibs4.po, but it did not worked.
Can someone help me with replacing such generic strings with multilingual strings? In which file they are stored?
Also, I want to find out several other questions:
How can I add additional language to kde? I mean another locale. For now I just replace one of existing languages (for example, german), but I want user to have ability to freely switch between bilingual/singlelingual interfaces.
Find out why some elements in application are not translated, despite the fact they are surely bilingwised in po file and are written with i18n() function in code (High Quality, for example).

Main question: kde4 or kf5 ?
User avatar
Ashark
Registered Member
Posts
19
Karma
0
I am on ArchLinux and of cource using kf5.
I just replaced that file in folder "4" (it also embarrassed me) because I thought that it was containing generic strings.
Do you know where they actually are?
lueck
Mentor
Posts
225
Karma
2
A KF5 application uses translations from a lot of catalogs:

1) the application catalog itself, in this case kdenlive.po
for stable kdenlive https://websvn.kde.org/branches/stable/ ... o?view=log

2) all catalogs from kf5 frameworks used by kdenlive
$ wcgrep "KF5::" kdemultimedia/kdenlive/
kdemultimedia/kdenlive/thumbnailer/CMakeLists.txt:14: KF5::KIOCore
kdemultimedia/kdenlive/thumbnailer/CMakeLists.txt:15: KF5::KIOWidgets
kdemultimedia/kdenlive/plugins/sampleplugin/CMakeLists.txt:21: KF5::KDELibs4Support
kdemultimedia/kdenlive/plugins/sampleplugin/CMakeLists.txt:23: KF5::KIOCore
kdemultimedia/kdenlive/src/CMakeLists.txt:264: KF5::WidgetsAddons
kdemultimedia/kdenlive/src/CMakeLists.txt:265: KF5::Archive
kdemultimedia/kdenlive/src/CMakeLists.txt:266: KF5::CoreAddons
kdemultimedia/kdenlive/src/CMakeLists.txt:267: KF5::KIOCore
kdemultimedia/kdenlive/src/CMakeLists.txt:268: KF5::KIOFileWidgets
kdemultimedia/kdenlive/src/CMakeLists.txt:269: KF5::KIOWidgets
kdemultimedia/kdenlive/src/CMakeLists.txt:270: KF5::NotifyConfig
kdemultimedia/kdenlive/src/CMakeLists.txt:271: KF5::NewStuff
kdemultimedia/kdenlive/src/CMakeLists.txt:272: KF5::DBusAddons
kdemultimedia/kdenlive/src/CMakeLists.txt:273: KF5::XmlGui
kdemultimedia/kdenlive/src/CMakeLists.txt:274: KF5::GuiAddons
kdemultimedia/kdenlive/src/CMakeLists.txt:275: KF5::Notifications
kdemultimedia/kdenlive/src/CMakeLists.txt:276: KF5::TextWidgets
kdemultimedia/kdenlive/src/CMakeLists.txt:277: KF5::IconThemes
kdemultimedia/kdenlive/src/CMakeLists.txt:278: KF5::Crash
kdemultimedia/kdenlive/src/CMakeLists.txt:293: target_link_libraries(kdenlive KF5::FileMetaData)

3) Qt translations for the Qt version kdenlive was build with

Please keep in mind that Qt does only load translation for certain locales (afaik only ISO 639-1)
see http://marc.info/?l=kde-i18n-doc&m=141329246521890&w=2

Btw I fail to understand the meaning of "bilingual interface"
User avatar
Ashark
Registered Member
Posts
19
Karma
0
Btw I fail to understand the meaning of "bilingual interface"

It is not for everyday usage, but for purposes of video tutorials.
Originally, I get that idea from Adobe's Premiere Pro video editor (see demonstration: https://youtu.be/IrdFLvN4RNA?t=1m56s). I liked that idea and decided to implement it in Linux.
There are two main advantages of using bilingued interface: 1) While you are watching english tutorials, you can easily see how some objects are called in your language. 2) When you are making video tutorial on your language, you can help the rest of internet (and also for some your language people who prefer english) to get the idea of what you are doing on video.
Really, it helped me to find out how some effects are called in english, because I used to use russian interface, and after switching to english for making video demo of some bug, I was lost a bit :o So, sinse now I will use bilingual interface for such cases.
lueck
Mentor
Posts
225
Karma
2
Ok you want a catalog with msgstr = ru / en_US.
You should have a look at https://websvn.kde.org/trunk/l10n-kf5/x-test/internal/
a script to generate the translation catalogs for locale x-test
User avatar
Ashark
Registered Member
Posts
19
Karma
0
Thank you, lueck!
Seems like it is what I was looking for. I will try to generate new catalog with that script.
User avatar
Ashark
Registered Member
Posts
19
Karma
0
I have discovered, that generic messages are stored in two files:
First level menu (File, Edit, etc...) are stored in kxmlgui5.po which is source for kxmlgui package in archlinux.
Second level menu (Keyboard shortcuts, Donate, etc...) are stored in kconfigwidgets5.po which is source for kconfigwidgets package in archlinux.
So I absolutely sure need this two files to complete bilingwation.

I tryed to make xx-test locale, but kdenlive did not saw that locale. Perhaps this is what you were talking about: qt not supporting custom locales.
I used zu locale as a donor locale, as it is standard for qt. It was working normal.

I still did not find out which else files are needed to be installed for kdenlive to detect new locale. It just do not display my fake-zu locale if I only place kxmlgui5.mo, kconfigwidgets5.mo and kdenlive.mo in /usr/share/locale/zu/LC_MESSAGES/

Need further exploration...

Last edited by Ashark on Fri Apr 07, 2017 11:23 pm, edited 1 time in total.
User avatar
Ashark
Registered Member
Posts
19
Karma
0
lueck, maybe you know, is there a way to automatically restart application (kdenlive) after change language event happened? I saw such button when application crashes. I just can press Restart application.
Problem is that when I am experimenting with language package installations, I am additionally annoyed by the fact that I need to manually restart application every time I change languale for application in settings. And there is no (at least I cannot find) possibility to set hotkey for restart.
Thanks in advance.
User avatar
Ashark
Registered Member
Posts
19
Karma
0
I have made a PKGBUILD and published it in l10n-bilingual repository.
For now, all menu items are translated. But another strange things are arised.
That strings: File, Edit, Help... are bilingwised normally: Файл (File), Правка (Edit)... but they suddenly show ampersands: Файл (&File), Правка (E&dit)...
I noticed, that sometimes, when you start kdenlive, there are not ampersands there. They appears only after making kdenlive fullscreen of when stick to the side of screen.
Another problem is that some items began doubling themselves, for example: Создать (New)(Создать (New)).
Here is how it looks (alt):

Can anybody advise me how to fix it?
User avatar
Ashark
Registered Member
Posts
19
Karma
0
Ok, there are remaining some minor issues, but the main problem of this thread (untranslatable menus) is solved now. So, I am closing this thread.
lueck, once again, thank you for your mentoring ^-^
User avatar
Ashark
Registered Member
Posts
19
Karma
0
Interesting thing! I thought that nobody besides me need bilingual interface.
Glad to provide sources. Feel free to contribute to my repository.
User avatar
Ashark
Registered Member
Posts
19
Karma
0
Erickem wrote:Do you know where they actually are?

What are you talking about?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]