MantisBT - Doomseeker
View Issue Details
0003481Doomseeker[All Projects] Suggestionpublic2018-09-01 11:042018-10-27 22:54
WubTheCaptain 
Zalewa 
normalfeaturealways
closedfixed 
1.1 
1.21.2 
0003481: Add "system default" locale to Appearance configuration
If the default locale of the operating system changes, and the user had chosen "system default" locale, then ideally Doomseeker should also change its locale without intervention (after program restart, at least), unless the user has chosen a specific language (locale) in the configuration menu.

This "system default" locale doesn't exist, yet. I propose it to be added.
  1. Start Doomseeker.
  2. Press the F5 key to open the configuration or find Options → Configuration from the top crate navigation.
  3. Navigate to "Appearance" settings.
  4. Under "Language" drop down menu, notice there may be specific language options but no option for "system locale".
Mumble (another Qt4 software) implements this. I'd assume the system locale should also become the default locale selected in new configurations, and this is what Mumble does too.
No tags attached.
related to 0003260closed Zalewa Translation "en_US" cannot be found, unknown language definition 
child of 0003279acknowledged  List of Debian issues (misc/non-policy) 
Issue History
2018-09-01 11:04WubTheCaptainNew Issue
2018-09-01 11:05WubTheCaptainSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11754#r11754
2018-09-01 11:05WubTheCaptainRelationship addedchild of 0003279
2018-09-01 11:06WubTheCaptainRelationship addedrelated to 0003260
2018-09-01 11:07WubTheCaptainDescription Updatedbug_revision_view_page.php?rev_id=11756#r11756
2018-09-01 11:08WubTheCaptainDescription Updatedbug_revision_view_page.php?rev_id=11757#r11757
2018-09-01 11:16ZalewaStatusnew => acknowledged
2018-09-01 11:43WubTheCaptainNote Added: 0019471
2018-09-10 05:29ZalewaRelationship addedchild of 0003483
2018-09-18 11:51WubTheCaptainNote Added: 0019539
2018-09-22 16:13WubTheCaptainStatusacknowledged => confirmed
2018-09-22 16:13WubTheCaptainTarget Version => 1.2
2018-09-22 19:01ZalewaAssigned To => Zalewa
2018-09-22 19:01ZalewaStatusconfirmed => assigned
2018-10-01 03:40WubTheCaptainRelationship replacedrelated to 0003483
2018-10-02 16:55ZalewaNote Added: 0019883
2018-10-04 21:02ZalewaNote Added: 0019907
2018-10-04 21:02ZalewaStatusassigned => needs testing
2018-10-04 21:02ZalewaNote Edited: 0019907bug_revision_view_page.php?bugnote_id=19907#r12097
2018-10-06 09:49WubTheCaptainNote Added: 0019925
2018-10-06 09:49WubTheCaptainStatusneeds testing => resolved
2018-10-06 09:49WubTheCaptainFixed in Version => 1.2
2018-10-06 09:49WubTheCaptainResolutionopen => fixed
2018-10-06 09:58WubTheCaptainNote Added: 0019927
2018-10-13 16:39WubTheCaptainRelationship deletedrelated to 0003483
2018-10-27 22:54WubTheCaptainStatusresolved => closed

Notes
(0019471)
WubTheCaptain   
2018-09-01 11:43   
I figured this is kind of the behavior that Doomseeker experiences already with new configurations (probably). But once you select a language, there's no going back as the "Localization" parameter is written to doomseeker.ini. I didn't test this theory, though.
(0019539)
WubTheCaptain   
2018-09-18 11:51   
Zalewa: Why is this ticket a "child of 0003483", which implies severity "blocking" for the Doomseeker 1.2 release?
(0019883)
Zalewa   
2018-10-02 16:55   
I have done some considerable work on this ticket today, but I'm not sure if it's ready for pushing just yet. There's a lot of difference between what the user sees on screen in the "Appearance" config box, the "retranslation restart" notifications, the loading of actual translations and with matching the locales. I'll have to glance over the code again with a clearer mind and see if I'm happy with it.

Nevertheless, commit for this is coming soon.
(0019907)
Zalewa   
2018-10-04 21:02   
Okay, so this is it:
'https://bitbucket.org/Doomseeker/doomseeker/commits/6b23e7db03762ea64d40f2f6b22deaa00ef345eb [^]'

The gist of it is that "Localization" .ini variable is now settable to a "system" value. As you may suspect, this is not a real localization but a magic value that the program dynamically translates to whatever is the current locale as reported by Qt through `QLocale::system()`. IIRC on Linux I can manipulate the retval of that method by changing the LANGUAGE env. var. Doomseekes lets you enforce a specific locale and then switch back to this system-follow value from the Appearance config tab.

The "restart to retranslate" notifications should also be aware of the fact that the currently loaded language might be the same as the system language and the same as a specific language picked from the list. In other words, the notification should not appear if no actual retranslation is going to happen even if the raw value in the .ini file differs after the config gets saved.

System-follow is now also the default for new configurations which coincidentally should also fix 0003260.

Oh, and also Localization class is now a singleton, which is a bleh and a meh.

(0019925)
WubTheCaptain   
2018-10-06 09:49   
Passes my code review and testing on OpenBSD 6.4-current.
(0019927)
WubTheCaptain   
2018-10-06 09:58   
You could've updated the copyright years Zalewa, but I won't bother in this ticket.