Notes |
|
|
"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 |
|
|
(0018274)
|
Zalewa
|
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.
|
|
|
(0018284)
|
WubTheCaptain
|
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).
|
|
|
|
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. |
|
|
(0019422)
|
WubTheCaptain
|
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).
|
|
|
|
Actually, I think I'll just close this for now. |
|
|
(0019430)
|
Zalewa
|
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. |
|
|
(0019458)
|
Zalewa
|
2018-08-30 15:58
|
|
|
|
|
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? |
|
|
(0019462)
|
Zalewa
|
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. |
|
|
|
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. |
|
|
|
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. |
|
|
(0019610)
|
WubTheCaptain
|
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.
|
|
|
(0019647)
|
Zalewa
|
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. |
|
|
|
It's twice "C" with first-run. Don't ask me why. Attached screenshot. |
|
|
(0019908)
|
Zalewa
|
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. |
|
|
|
Passes my code review and testing on OpenBSD 6.4-current. |
|