QtLinguist and Plural rules for a new translation language
-
Hello,
I am about to begin translating some of Qt into a new language, Luganda (aka 'Ganda'), whose code is 'lg' or 'lg_UG.
I am experiencing two problems; 1. When I try to open a translation (.ts) file in QtLinguist it first complains that it does not know the plural rules for the language.
There appears not to be anywhere to tell QtLinguist what they are.
2. When I run lupdate -list-languages it does not include Luganda or Ganda in the resulting list. In addition, the code 'lg_UG' is assigned to multiple other languages.
Could anyone assist me with this please?
I would like to get QtLinguist to know the plural rules for Luganda/Ganda and to have lupdate include Luganda/Ganda in the list of languages, with the code 'lg_UG' correctly assigned to just this language.Regards,
Kizito
-
@Luganda01 said in QtLinguist and Plural rules for a new translation language:
I will post to the list.
You either can create a bug report with your patch or even better directly provide a patch for it.
-
@SGaist
Hello,Thanks for the welcome.
I have ended up here having translated the Linux desktop LXQt and found that it relies on Qt for some of its translations. So, yes, my intention is to add Luganda support and translations to Qt.
I have read that wiki page, set up the necessary accounts, joined the translation and development mailing lists and followed the git cloning and build instructions.
I noticed the plurals problem whilst trying out the LXQt files on my system. The LXQt project uses Weblate to enable the translators to do their bit. This gives us .ts files to download, which I have been converting to .qm files via QtLinguist. That is where I saw it complaining and removing the plurals from the output files.
Whilst researching the cause by scouring the mailing list archives and this forum I came across the lupdate -list-languages check. Further research in the source code has lead me to https://code.qt.io/cgit/qt/qttools.git/tree/src/linguist/shared/numerus.cpp which appears to be where the lupdate command and QtLinguist get their language information from.
That file is missing an entry for Luganda (or 'Ganda' as QLocale has it, viz. 'QLocale::Ganda 194').
From reading the comments in the source code, it also appears that the way the lupdate system works is that if it only finds partial information on a language it fills the rest in with whatever the host system has set as the locale. This seems to be why I get multiple instances of other languages showing up as 'lg_UG'.
If my musings are correct would it help if I to made a suggestion on the development mailing list?
Regards,
Kizito
-
@Luganda01 said in QtLinguist and Plural rules for a new translation language:
If my musings are correct would it help if I to made a suggestion on the development mailing list?
Yes, or directly create a patch to see if something else is missing like e.g. the information about the plural forms. It must be somewhere in the code too I would guess.
-
Hello,
Luganda falls into the category of 'English style languages'. The plural rules for these appear to be in the
static const NumerusTableEntry numerusTable[] = {
..
..
{ englishStyleRules, sizeof(englishStyleRules), englishStyleForms, englishStyleLanguages, 0,
"nplurals=2; plural=(n != 1);" },
..
..
}
section of https://code.qt.io/cgit/qt/qttools.git/tree/src/linguist/shared/numerus.cpp.
Adding it to that list should fix the lack of plural rules.I will post to the list.
Thanks for the advice.
Regards,
Kizito
-
@Luganda01 said in QtLinguist and Plural rules for a new translation language:
I will post to the list.
You either can create a bug report with your patch or even better directly provide a patch for it.
-
@Christian-Ehrlicher
Hello,
Thanks, I posted to that list and also created, tested and submitted a patch.Regards,
-
-
@Luganda01 thanks for the involvement !
Can you post a link to the patch/ticket ? That way other people may find it more easily :-)