Zandronum Chat on our Discord Server Get the latest version: 3.1
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003260Doomseeker[All Projects] Bugpublic2017-09-10 21:342018-10-27 22:54
ReporterWubTheCaptain 
Assigned ToZalewa 
PrioritynormalSeveritytrivialReproducibilityhave not tried
StatusclosedResolutionfixed 
Platformx86_64OSDebian GNU/LinuxOS Versionbuster/sid
Product Version1.1 
Target Version1.2Fixed in Version1.2 
Summary0003260: Translation "en_US" cannot be found, unknown language definition
Description
[21:23:13] Loading translation "en_US".
[21:23:13] Translation 'qtbase_en_US' not found.
[21:23:13] Translation 'qtmultimedia_en_US' not found.
[21:23:13] Translation 'en_US' not found.
[21:23:13] Failed to load translation.
Steps To ReproduceStarting Doomseeker, going to configuration → Appearance shows three languages: "English", "Polski" and "Unknown language definition "en_US"" with a question mark flag.

The above error in description is printed to stdout and log.
Additional InformationThe missing translation seems to have no effect on functionality. Switching between all three available languages works fine.

$ cat /etc/default/locale
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
LC_PAPER="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_MONETARY="fi_FI.UTF-8"
LC_COLLATE="C"
LC_NUMERIC="C"

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=C
LC_TIME=en_GB.UTF-8
LC_COLLATE=C
LC_MONETARY=fi_FI.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

$ locale -a
C
C.UTF-8
POSIX
en_GB.utf8
en_US.utf8
fi_FI.utf8
Attached Fileslog file icon dpkg.log [^] (3,173 bytes) 2017-09-10 21:34
log file icon dpkg.1.log [^] (5,360 bytes) 2017-09-10 21:39
log file icon usr-share-qt5-translations.log [^] (16,626 bytes) 2017-09-10 21:43
png file icon 2018-09-23-005815_554x162_scrot.png [^] (16,502 bytes) 2018-09-23 00:59

- Relationships
related to 0003481closedZalewa Add "system default" locale to Appearance configuration 
related to 0003482closedZalewa Add visual text indication to Appearance configuration if/when the program needs to be restarted for changes to apply (locales) 
child of 0003279acknowledged List of Debian issues (misc/non-policy) 

-  Notes
User avatar (0018264)
WubTheCaptain (reporter)
2017-09-10 21:43

"English" loads en_EN and "Polski" loads many:

[21:41:32] Loading translation "pl_PL"
[21:41:32] Found translation 'qtbase_pl_PL' in dir '/usr/share/qt5/translations'.
[21:41:32] Found translation 'qtmultimedia_pl_PL' in dir '/usr/share/qt5/translations'.
[21:41:32] Found translation 'pl_PL' in dir '/home/wub/.local/src/doomseeker/doomseeker-hg/doomseeker/build/translations'.

[21:41:32] Found translation 'odamex_pl_PL' in dir '/home/wub/.local/src/doomseeker/doomseeker-hg/doomseeker/build/translations'.

[21:41:32] Loaded translation for plugin odamex
[21:41:32] Found translation 'zandronum_pl_PL' in dir '/home/wub/.local/src/doomseeker/doomseeker-hg/doomseeker/build/translations'.

[21:41:32] Loaded translation for plugin zandronum
User avatar (0018274)
Zalewa (developer)
2017-09-11 17:34
edited on: 2017-09-11 18:52

I think it should not be showing "Unknown translation" in the configuration dialog, especially since English fits your locale. Upon first run, Doomseeker tries to detect the translation basing on your locale and when it didn't find the exact match with the available translations, it probably added it to the combo box. I don't remember if this was intentional to make it obvious to the user that there is a case where translation definitions were for some reason removed from disk. I'll think of a reasonable fallback.

As for the discrepancies between Polish and English translations:

1. English translation doesn't need translation files because it's hardcoded directly in the source code. One of the brilliant Qt features is that you can hardcode your text in the .cpp (and .h and .ui) files and, provided you wrap the literals in tr() function calls, Qt tools will detect them properly, automatically build a translations source file and allow you to translate each string. The translation is then built into a binary .qm file that you need to load at runtime, preferably very early during the start of the program.

2. Plugins are separate shared libraries and Doomseeker will run without them (albeit it will be mostly useless). Text contained in them is not present anywhere in Doomseeker code. Translations for plugins are distributed in packages with plugins - this should be true both for Windows and Mac update packages and Linux .debs. Hence, if plugin contains additional, translatable strings, then this plugin will also come with translations. Qt allows to load many translation files that will supplement each other. The native language doesn't need translation files because it's directly there - in the source code. The only case where Qt translation files would be useful for English is adding 's' to plurals where an amount of something is displayed (0 players, 1 player, 2 players, etc.)


One thing to note is that so far we only had one case where a user offerred to create additional translation to Spanish, but unfortunately we've run into some problems with project setup on their Windows and I think they lost steam.

User avatar (0018284)
WubTheCaptain (reporter)
2017-09-12 02:15
edited on: 2017-09-12 02:20

Would a reasonable fallback be to add an option "default system locale" to the list of languages? If I recall correctly, Mumble (VoIP software based on Qt) does this. If it's a supported or unsupported language, it would not appear in the list at all except as one "default system locale" option (which is catch-all). Translations supported by Doomseeker would of course be listed to allow switching easily.

The "default system locale" would also be the default option for new configurations. In future if Doomseeker supports the system locale, it will automatically display that translated language to the user (unless the user chose a language like English explicitly).

User avatar (0018285)
WubTheCaptain (reporter)
2017-09-12 02:33

I'm not entirely sure what's going on, but I've been mixing my configurations lately with Doomseeker 1.1 and Mercurial builds and done one apt full-upgrade in between I think.

My locale configuration remains the same. en_US is no longer in the configuration (Mercurial build d00d1352a20b) and by default loads en_EN. Polish language is available. Same with building 1.1 from source.

I tested with debian.drdteam.org build of 1.1 and the only language option available there is "unrecognized language definition en_EN". (Previously it was en_US giving that error.)

I think the underlying issue is still the same how unrecognized languages are displayed, for that see my fallback proposal.
User avatar (0019422)
WubTheCaptain (reporter)
2018-08-27 03:08
edited on: 2018-08-27 03:09

I hardly experience this problem anymore with Doomseeker 1.2, but the "default system locale" proposal might be good to implement (in a seperate ticket).

User avatar (0019423)
WubTheCaptain (reporter)
2018-08-27 03:18

Actually, I think I'll just close this for now.
User avatar (0019430)
Zalewa (developer)
2018-08-27 07:20

I forgot to make a special note here, but I actually experienced this a week ago when trying out Pol M's Arch Linux installation in Manjaro. I think I know how to reproduce at least one of the causes of this error.
User avatar (0019458)
Zalewa (developer)
2018-08-30 15:58

Unexpected states resistance added here:
'https://bitbucket.org/Doomseeker/doomseeker/commits/acb43c63c19086f8d592380b66cbb43d77f76366 [^]'

Note that if you have a completely wrong language ("hu", "cz", etc.) loaded from the config then the appearance box will *properly* display that the translation is unknown.
User avatar (0019460)
WubTheCaptain (reporter)
2018-09-01 06:50

Quote from Zalewa
I think I know how to reproduce at least one of the causes of this error.


Can you post at least one way of reproduction, so that the results can be compared?
User avatar (0019462)
Zalewa (developer)
2018-09-01 07:10

Quote from "WubTheCaptain"

Can you post at least one way of reproduction, so that the results can be compared?

Surely.

1. Delete the translations.def file - pre-fix Doomseeker won't be able to fill in the Appearances config box. In post-fix Doomseeker English translation is hardcoded and should appear regardless.

2. Also in pre-fix Doomseeker, keep the translations.def file but edit doomseeker.ini and set Localization setting to a known language but unknown country, like "en_US" or "en_GB". Post-fix Doomseeker will try to match the localization just by the "language" part and should properly default to "en" translation. You can test the same with "pl" by specifying something arbitrary as country like "pl_NO". All comparisons here should also be case-insensitive.

3. Set Localization setting in doomseeker.ini to something completely unknown to Doomseeker, like "hu_HU" and any Doomseeker version should properly state that the localization is unknown.
User avatar (0019469)
WubTheCaptain (reporter)
2018-09-01 11:24

Related tickets added for suggestions for improvement. I've not yet tested this in depth with Zalewa's steps to reproduce, but I would at least assume good faith that the issue has been resolved.
User avatar (0019472)
WubTheCaptain (reporter)
2018-09-01 11:55

Quote from Zalewa
Also in pre-fix Doomseeker, keep the translations.def file but edit doomseeker.ini and set Localization setting to a known language but unknown country, like "en_US" or "en_GB".


I'm not going to compile Doomseeker 1.1 from source, because it requires glibc < 2.26 or a patch (0003385). But the binary Doomseeker 1.1 from DRDTeam's apt repositories experiences an unknown language definition regardless if Localization setting in doomseeker.in is en, en_EN or en_US respectively (out of these, at least "en" should have worked). In other words, my language selection is broken in Doomseeker 1.1 (binary package) anyway with a new config.

This is not experienced in 1.2.

Quote from Zalewa
Set Localization setting in doomseeker.ini to something completely unknown to Doomseeker, like "hu_HU" and any Doomseeker version should properly state that the localization is unknown.


In lieu of system default locale (0003481), this works in 1.2 as you've described.
User avatar (0019610)
WubTheCaptain (reporter)
2018-09-22 01:50
edited on: 2018-09-22 01:51

What shall we do with "Unknown language definition "C"" on OpenBSD? In latest 1.2~beta. This is the default locale/behavior.

User avatar (0019647)
Zalewa (developer)
2018-09-22 18:54

Quote from "WubTheCaptain"
What shall we do with "Unknown language definition "C"" on OpenBSD?

There's a chance that something is still being mishandled as this should not happen, regardless of the platform. I'll look into this.
User avatar (0019683)
WubTheCaptain (reporter)
2018-09-23 01:00

It's twice "C" with first-run. Don't ask me why. Attached screenshot.
User avatar (0019908)
Zalewa (developer)
2018-10-04 21:13

As mentioned in 0003481, commit 6b23e7db changes the value that the config gets initialized with. Instead of bluntly using the plain locale value as reported by Qt, we save a magic "system" value that should get retranslated dynamically upon each program load. If Doomseeker doesn't have the definition for the language that your OS reports, it should just "load" English silently.

Thanks to this change, the "Unknown language definition" should not appear anymore in the combo box just after config initialization. However, it doesn't mean that it is impossible for this item to appear at all as there are valid reasons when such item should be displayed:

1) If user modifies the .ini file by hand and changes the language to a completely unknown, non-magical value (try "hu")

2) If user sets a specific translation and then deletes that translation from the .def file.

When Doomseeker has problems with identifying the meaning of the "Localization" .ini var, it is properly displaying that bad var in the appearance box.
User avatar (0019924)
WubTheCaptain (reporter)
2018-10-06 09:48

Passes my code review and testing on OpenBSD 6.4-current.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2017-09-10 21:34 WubTheCaptain New Issue
2017-09-10 21:34 WubTheCaptain File Added: dpkg.log
2017-09-10 21:39 WubTheCaptain File Added: dpkg.1.log
2017-09-10 21:43 WubTheCaptain Note Added: 0018264
2017-09-10 21:43 WubTheCaptain File Added: usr-share-qt5-translations.log
2017-09-11 17:34 Zalewa Note Added: 0018274
2017-09-11 18:52 Zalewa Note Edited: 0018274 View Revisions
2017-09-12 02:15 WubTheCaptain Note Added: 0018284
2017-09-12 02:18 WubTheCaptain Note Edited: 0018284 View Revisions
2017-09-12 02:20 WubTheCaptain Note Edited: 0018284 View Revisions
2017-09-12 02:33 WubTheCaptain Note Added: 0018285
2017-09-27 18:30 Zalewa Relationship added child of 0003246
2017-09-27 21:53 WubTheCaptain Relationship added related to 0003279
2017-09-27 21:54 WubTheCaptain Relationship deleted child of 0003246
2017-09-27 21:54 WubTheCaptain Relationship deleted related to 0003279
2017-09-27 21:54 WubTheCaptain Relationship added child of 0003279
2017-10-05 02:45 WubTheCaptain Status new => acknowledged
2017-10-05 02:46 WubTheCaptain Status acknowledged => feedback
2018-08-27 03:08 WubTheCaptain Note Added: 0019422
2018-08-27 03:08 WubTheCaptain Status feedback => new
2018-08-27 03:09 WubTheCaptain Status new => needs testing
2018-08-27 03:09 WubTheCaptain Note Edited: 0019422 View Revisions
2018-08-27 03:18 WubTheCaptain Note Added: 0019423
2018-08-27 03:18 WubTheCaptain Status needs testing => closed
2018-08-27 03:18 WubTheCaptain Resolution open => unable to reproduce
2018-08-27 03:19 WubTheCaptain Fixed in Version => 1.2
2018-08-27 03:19 WubTheCaptain Target Version => 1.2
2018-08-27 07:19 Zalewa Assigned To => Zalewa
2018-08-27 07:19 Zalewa Status closed => assigned
2018-08-27 07:20 Zalewa Note Added: 0019430
2018-08-28 04:16 WubTheCaptain Resolution unable to reproduce => open
2018-08-28 04:16 WubTheCaptain Resolution open => reopened
2018-08-28 04:17 WubTheCaptain Fixed in Version 1.2 =>
2018-08-30 15:58 Zalewa Note Added: 0019458
2018-08-30 15:58 Zalewa Status assigned => needs testing
2018-09-01 06:50 WubTheCaptain Note Added: 0019460
2018-09-01 07:10 Zalewa Note Added: 0019462
2018-09-01 10:50 WubTheCaptain Note Added: 0019466
2018-09-01 10:50 WubTheCaptain Status needs testing => needs review
2018-09-01 10:57 WubTheCaptain Note Deleted: 0019466
2018-09-01 10:57 WubTheCaptain Status needs review => needs testing
2018-09-01 11:06 WubTheCaptain Relationship added related to 0003481
2018-09-01 11:23 WubTheCaptain Relationship added related to 0003482
2018-09-01 11:24 WubTheCaptain Note Added: 0019469
2018-09-01 11:35 WubTheCaptain Fixed in Version => 1.2
2018-09-01 11:44 WubTheCaptain Relationship deleted child of 0003279
2018-09-01 11:45 WubTheCaptain Relationship added child of 0003279
2018-09-01 11:55 WubTheCaptain Note Added: 0019472
2018-09-01 11:55 WubTheCaptain Status needs testing => resolved
2018-09-01 11:55 WubTheCaptain Resolution reopened => fixed
2018-09-22 01:50 WubTheCaptain Note Added: 0019610
2018-09-22 01:50 WubTheCaptain Status resolved => feedback
2018-09-22 01:50 WubTheCaptain Resolution fixed => reopened
2018-09-22 01:51 WubTheCaptain Note Edited: 0019610 View Revisions
2018-09-22 17:56 WubTheCaptain Status feedback => needs review
2018-09-22 18:54 Zalewa Note Added: 0019647
2018-09-22 18:55 Zalewa Status needs review => assigned
2018-09-23 00:59 WubTheCaptain File Added: 2018-09-23-005815_554x162_scrot.png
2018-09-23 01:00 WubTheCaptain Note Added: 0019683
2018-10-04 21:13 Zalewa Note Added: 0019908
2018-10-04 21:13 Zalewa Status assigned => needs testing
2018-10-06 09:48 WubTheCaptain Note Added: 0019924
2018-10-06 09:48 WubTheCaptain Status needs testing => resolved
2018-10-06 09:48 WubTheCaptain Resolution reopened => fixed
2018-10-27 22:54 WubTheCaptain Status resolved => closed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker