Subject: .ts Files Name Mismatch Problem

From: Orkun BALCI <[email-masked]>
Date: Wed, 27 Jan 2016 10:03:44 +0200

Package: x2goclient (Debian)
Version: 4.0.5.0-1

In Qt Resources, translation files (.ts) filenames ends with a preceeding
underscore and two character (like _tr, _en, etc.) However, locale names
are in the form tr_TR or en_US. Because x2goclient reads from
:/i18n/[filename] Qt Resource file, it cannot find a file named
x2goclient_tr_TR, x2goclient_en_US, qt_tr_TR, or qt_en_US. .ts file names
should be changed from trailing two character to four character full locale
name.

---

From: Mihai Moldovan <[email-masked]>
Date: Wed, 27 Jan 2016 15:44:45 +0100

On 27.01.2016 09:03 AM, Orkun BALCI wrote:
> Package: x2goclient (Debian) Version: 4.0.5.0-1
> 
> In Qt Resources, translation files (.ts) filenames ends with a
> preceeding underscore and two character (like _tr, _en, etc.)
> However, locale names are in the form tr_TR or en_US. Because
> x2goclient reads from :/i18n/[filename] Qt Resource file, it cannot
> find a file named x2goclient_tr_TR, x2goclient_en_US, qt_tr_TR, or
> qt_en_US. .ts file names should be changed from trailing two
> character to four character full locale name.

I disagree, let me explain why.

We're using QTranslator::load(), which, according to the documentation, should try to load stripped file names, too, c.f.: https://doc.qt.io/qt-4.8/qtranslator.html#load

The important part is the fallback list for fr_ca. Eventually, it should be able to load :/i18n/x2goclient_tr.qm (and thus also :/i18n/qt_tr.qm.)

Are you seeing different, wrong behavior?

Mihai

---

From: Orkun BALCI <[email-masked]>
Date: Thu, 28 Jan 2016 00:26:55 +0200

Thank you Mihai,

In the code and in the error it exactly seeks for x2goclient_tr_tr (or
x2goclient_tr_TR depending on version) file. However, when I read the link
you sent, I got that there can be another wrong character in the name. In
this link it says x2goclient.tr_TR or x2goclient.tr are the correct front
names of it. So, there can be an underscore or dot character problem.

Well, I have forked the code to my github repository today, and I will have
a look at it when I find some free time. So, I will inform you back about
the further work.

Best Regards,
Orkun BALCI

On Wed, Jan 27, 2016 at 4:44 PM, Mihai Moldovan <[email-masked]> wrote:

> We're using QTranslator::load(), which, according to the documentation,
> should try to load stripped file names, too, c.f.:
> https://doc.qt.io/qt-4.8/qtranslator.html#load
>
> The important part is the fallback list for fr_ca. Eventually, it should
> be able to load :/i18n/x2goclient_tr.qm (and thus also :/i18n/qt_tr.qm.)
>

---

From: Mihai Moldovan <[email-masked]>
Date: Wed, 27 Jan 2016 23:42:05 +0100

On 27.01.2016 11:26 PM, Orkun BALCI wrote:
> In the code and in the error it exactly seeks for x2goclient_tr_tr (or x2goclient_tr_TR depending on version) file. However, when I read the link you sent, I got that there can be another wrong character in the name. In this link it says x2goclient.tr_TR or x2goclient.tr <http://x2goclient.tr> are the correct front names of it. So, there can be an underscore or dot character problem.

If you use

LC_ALL=de_DE.utf8 LANG=de_DE.utf8 LANGUAGE=de_DE.utf8 x2goclient --debug

you'll see that the client starts up in German. So the algorithm in x2goclient is working as intended - at least for some translations.

Now, there is another bug report with #953 and your report is actually a duplicate of this.

LC_ALL=nb_NO.utf8 LANG=nb_NO.utf8 LANGUAGE=nb_NO.utf8:da_DK.utf8 x2goclient --debug

will exactly replicate the behavior described in the other bug report - loading the fallback Danish translation instead of the (equally existing) Norwegian one.

Just like for the Norwegian translation, the Turkish translation fails to load. I suspect it's not a code problem, but something else. The issue is reproducible on OS X, too.

Try

LC_ALL=tr_TR.utf8 LANG=tr_TR.utf8 LANGUAGE=tr_TR:nb_NO.utf8:da_DK.utf8 x2goclient --debug

and guess what language will be loaded...

I have to investigate this.

Mihai

---

From: Mihai Moldovan <[email-masked]>
Date: Wed, 27 Jan 2016 23:57:10 +0100

On 27.01.2016 11:42 PM, Mihai Moldovan wrote:
> [...]

Found it. The Turkish translation is not added as a resource and thus not baked into the binary.

That's all. Commit coming up.

Mihai

---

From: Orkun BALCI <[email-masked]>
Date: Thu, 28 Jan 2016 01:08:14 +0200

Hello Again Mihai,

It says, it exist :/i18n/x2goclient_de_DE, however, it doesnt exist
:/i18n/x2goclient_tr_TR.UTF_8 (and same for qt_de_DE and qt_tr_TR).

When I run

LC_ALL=tr_TR.utf8 LANG=tr_TR.utf8 LANGUAGE=tr_TR:nb_NO.utf8:da_DK.utf8
x2goclient --debug

it is translated into a Danish or Nordish language.

When I look at the source, I cannot see qt_tr.qm file, however I can see
qt_de, qt_da files. Maybe it is not compiled with "lrelease" during "make"
process.

Best Regards,
Orkun BALCI

On Thu, Jan 28, 2016 at 12:42 AM, Mihai Moldovan <[email-masked]> wrote:

> this link it says x2goclient.tr_TR or x2goclient.tr <http://x2goclient.tr>
> are the correct front names of it. So, there can be an underscore or dot
> character problem.
>
> If you use
>
> you'll see that the client starts up in German. So the algorithm in
> x2goclient is working as intended - at least for some translations.
>
> will exactly replicate the behavior described in the other bug report -
> loading the fallback Danish translation instead of the (equally existing)
> Norwegian one.
>
> Just like for the Norwegian translation, the Turkish translation fails to
> load. I suspect it's not a code problem, but something else. The issue is
> reproducible on OS X, too.
>
> Try
>

---

From: Mihai Moldovan <[email-masked]>
Date: Thu, 28 Jan 2016 00:17:08 +0100

On 28.01.2016 12:08 AM, Orkun BALCI wrote:
> It says, it exist :/i18n/x2goclient_de_DE, however, it doesnt exist :/i18n/x2goclient_tr_TR.UTF_8 (and same for qt_de_DE and qt_tr_TR).

Yep, it really didn't exist in the binary. My fault, I've added it now.

> it is translated into a Danish or Nordish language.

Yep, it's translated into Danish, because there is no Turkish translation baked into the binary. The Norwegian issue is different from yours.

> When I look at the source, I cannot see qt_tr.qm file, however I can see qt_de, qt_da files. Maybe it is not compiled with "lrelease" during "make" process.

Qt itself sadly has no Turkish translation, so that's normal.

I have pushed a fix already. The Debian builds will hopefully run shortly, so if you use the nightly/heuler repository, try to update and upgrade in an hour.

Mihai

---

From: Orkun BALCI <[email-masked]>
Date: Thu, 28 Jan 2016 01:42:46 +0200

Thank You Mihai.

I will check it and return soon. For the #953 topic, I cannot see the nb_NO
compiled qm file too. But I think the main issue there is falling to Danish
but not Norwegian. I search and I cannot find but I guess Norwegian's
translation fallback translation is Danish. I think thats why it is falling
back to Danish. I have seen it in the debug window and guess it.

Best Regards,
Orkun BALCI

On Thu, Jan 28, 2016 at 1:17 AM, Mihai Moldovan <[email-masked]> wrote:

> Yep, it's translated into Danish, because there is no Turkish translation
> baked into the binary. The Norwegian issue is different from yours.
>
>
> I have pushed a fix already. The Debian builds will hopefully run shortly,
> so if you use the nightly/heuler repository, try to update and upgrade in
> an hour.
>
>
>
> Mihai
>
>
>