Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#4146 closed defect (fixed)

[PATCH] Selected language setting isn't accepted if user.cfg doesn't exist

Reported by: elexis Owned by: mimo
Priority: Must Have Milestone: Alpha 22
Component: Core engine Keywords: patch
Cc: Patch:

Description

If the user.cfg file doesn't exist, changing the language doesn't work (even applying it without restarting the game doesn't use the new setting). If one changes something in the options menu, the file is created, hiding the bug.

Attachments (2)

setlanguage.patch (476 bytes ) - added by Sandarac 8 years ago.
4146_config.patch (895 bytes ) - added by Vladislav Belov 7 years ago.
Save the config file even it doesn't exist

Download all attachments as: .zip

Change History (14)

by Sandarac, 8 years ago

Attachment: setlanguage.patch added

comment:1 by Sandarac, 8 years ago

Keywords: rfc patch added
Summary: Selected language setting isn't accepted if user.cfg doesn't exist[PATCH] Selected language setting isn't accepted if user.cfg doesn't exist

comment:2 by Itms, 8 years ago

Keywords: rfc removed

Thanks for taking care of the issue :)

The bug actually comes from the engine function SaveLocale so it would be nicer to make changes there.

However, by taking a look at the code I don't see what could fail. It would be interesting to understand why g_ConfigDB.WriteValueToFile fails in the engine while all calls to this function in the gamesetup and the prelobby don't cause issues (maybe they do but we didn't notice).

comment:3 by elexis, 7 years ago

Keywords: simple added
Priority: Should HaveMust Have

comment:4 by Vladislav Belov, 7 years ago

Problem is that WriteValueToFile tries to reload the config file and gets error: 'Cannot find config file "config/user.cfg" - ignoring', so we should save file even file not found. Also we didn't notice it with other variables, because usual options call the WriteFile (which doesn't call the Reload), not WriteValueToFile.

by Vladislav Belov, 7 years ago

Attachment: 4146_config.patch added

Save the config file even it doesn't exist

comment:5 by Vladislav Belov, 7 years ago

Keywords: rfc added
Milestone: BacklogAlpha 22

comment:6 by mimo, 7 years ago

Owner: set to mimo
Resolution: fixed
Status: newclosed

In 18960:

Save the config file even it does not exist, patch by Vladislav Belov, fixes #4146

comment:7 by mimo, 7 years ago

Keywords: rfc simple removed

Thanks for the patch

comment:8 by elexis, 7 years ago

Component: UI & SimulationCore engine

(Don't forget to bump the year at the top of the file next time. That is also true for that other patch of him that was uploaded recently.)

in reply to:  8 comment:9 by Vladislav Belov, 7 years ago

Replying to elexis:

(Don't forget to bump the year at the top of the file next time. That is also true for that other patch of him that was uploaded recently.)

Yeah, thanks, I'm taking all engine in the mind to prevent bugs, but forgot about years.

Last edited 7 years ago by Vladislav Belov (previous) (diff)

comment:10 by tzium, 7 years ago

Was this problem on Windows or Linux? Because with the Alpha XXI (Ulysses) version I can change language on Windows 8.1 but not on Ubuntu 16.04 (same PC, I have a dual-boot system).

comment:11 by elexis, 7 years ago

All OS. It's not fixed for alpha 21 yet, only alpha 22. In alpha 21, open the options dialog, change a random setting, save, then it saves the language too.

in reply to:  11 comment:12 by tzium, 7 years ago

Replying to elexis:

All OS. It's not fixed for alpha 21 yet, only alpha 22. In alpha 21, open the options dialog, change a random setting, save, then it saves the language too.

Ah, ok. Thank you very much.

Note: See TracTickets for help on using tickets.