Page 1 of 1

Locale setup

Posted: Tue 12 Oct 2021 6:14 pm
by vpokroglo
I suggest to implement in some future version, complete user side settings for date format.

I have many problems with website third party tools, because of stupid Slovenian locale date records in mono 5.x.x and up versions, which is 12. 10. 2021 (space after dot).
I have tried to change locale in an similar one, but now there is a problem with slightly different month names, resulting in different CumulusMX log files.

Marko

www.okroglovreme.com

Re: Locale setup

Posted: Wed 13 Oct 2021 8:46 am
by mcrossley
That is a good idea, I'll look at implementing it...

Re: Locale setup

Posted: Wed 13 Oct 2021 9:08 am
by HansR
mcrossley wrote: Wed 13 Oct 2021 8:46 am That is a good idea, I'll look at implementing it...
I remember some discussion roughly two years ago on this subject.

I am not sure complete user side setting of date format will solve the issue. This is about name format of files and internal date format in the logfiles. I think it is a bad idea to have the user choose that. I would suggest to fix every internal use of date format (call it the CMX format), and have fixed filenames.

Where the output is concerned user configuration is already there afaik.

Re: Locale setup

Posted: Wed 13 Oct 2021 9:40 am
by mcrossley
Hi Hans

A schema for storing data would not solve this problem which if I am understanding it correctly is about output from CMX.

The change in month name mentioned has come about due to efforts by the user changing the locale to try and find one that fixes the data format issue.

Yes, the user could go and customise every web tag that is used to output, but that means editing standard files every update they change. But it would not help with things like the Admin interface editors for example which use the local API.

It is much simpler to have one setting to over-ride the default date separator for ALL user output. I see this as primarily used in those locales where under Mono they have had the extra space added to the date separator string in recent releases as this user has.

Don't get me wrong, We've talked about a standardised data storage schema for CMX before, I still think it is a great idea, but it is a big job. Not so much implementing it CMX, but providing the update tools for existing user, migration implications from C1, additional checks in the code etc. And it would not be a total fix for this issue.

Re: Locale setup

Posted: Wed 13 Oct 2021 10:10 am
by HansR
@mcrossley: OK :|

Re: Locale setup

Posted: Wed 13 Oct 2021 10:17 am
by mcrossley
As an aside, I had already changed the next release so it did not care about changes in date separator in the log files.

Playing with this change allowed me to try different separators on the fly, my test system month file now looks like this...

Code: Select all

12/10/21,23:25,10.4, ..
12/   10/   21,23:30,10.5, ...

13/ 10/ 21,09:20,12.4, ...

13-10-21,09:40,12.6, ...

13/10/21,10:05,13.0, ...
and CMX parses it without error :lol:

Re: Locale setup

Posted: Wed 13 Oct 2021 10:31 am
by HansR
Does that mean you are going to allow for the space in the datafile dates?
Will this lead to change of date formats in data files?

Or are you just playing around :?

CUtils is a bit more rigid than CMX

Re: Locale setup

Posted: Wed 13 Oct 2021 11:04 am
by mcrossley
There is no change in what is allowed, if the locale uses ". " as the date separator, then that is what is currently used.

CMX just uses .ToString("dd/MM/yy") so the "/" will be replaced with the locale value.

Re: Locale setup

Posted: Wed 13 Oct 2021 11:17 am
by HansR
OK.
And does CMX read that flawlessly when mixed in the logfile?

Re: Locale setup

Posted: Wed 13 Oct 2021 11:29 am
by mcrossley
The current release uses the date separator, so the whole file must use the same format. The next release allows any date separators (single or multi-byte) and they can be mixed in the same file.