Re: Time formats / LC_TIME challenge for 4-digit year support

2018-12-04 Thread Thiago Macieira
On Tuesday, 4 December 2018 11:42:41 PST Jaroslaw Staniek wrote:
> I did not know there are such differences for the locale system. But by no
> means my email is a call to "patch" the Qt-level problem by having a KF5
> solution. And I am skeptical if Qt can be patched in version 5 with such
> incompatible change. Hopefully these poor man analysis help some other app
> developers 

If you want that, please submit your patch to unicode.org. They need to update 
the CLDR to have 4-digit years for the locale of your choice.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center





Re: Time formats / LC_TIME challenge for 4-digit year support

2018-12-04 Thread Jaroslaw Staniek
On Tue, 4 Dec 2018 at 20:10, Albert Astals Cid  wrote:

> El dilluns, 3 de desembre de 2018, a les 14:47:56 CET, Jaroslaw Staniek va
> escriure:
> > Hello,
> > The need: 4-digit year support for short date formats to avoid issues
> like
> > "10/11/12" dates.
>
> What's wrong with 10/11/12 ?
>

It's a problem. Year 2000 problem.

>
> > This is just my initial conclusion from for the Qt date format issue:
> >
> >
> https://bugreports.qt.io/browse/QTBUG-59382?focusedCommentId=436861=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-436861
> > lt;dr: KF5 context: KCallendarSystem is part of the old APIs and the only
> > code I found related to LC_TIME.
> >
> > So I've not found any common code KDE app can use instead of hard coding
> > some internal logic in order to support non-Plasma environments and/or
> > non-global settings. Basically even if an app implements locale name
> > selection in its private settings, "pure" Qt code is not enough to
> support
> > it in the discussed cases. Users may need alter date format globally (for
> > all apps) by hand using environment's settings, setting e.g. -mm-dd.
> Or
> > app developers may add private setting for that, one per app.
> >
> > Opinions welcome.
>
> I am not sure i understand your email/problem.
>
> As far as i read this email your concern is:
>  * localized dates use the locale date format
>  * locale date format is "wrong".


Yes. "Opinions welcome" mostly meant sending "do you have this kind of
issues in your apps" question to app developers who happen to use KF5+Qt.


>
> So the two options are:
>  a) User changes their locale
>
 b) Apps don't use localized dates and use a custom format.
>
> Am I understanding your email correctly?
>

Yes, I discussed pros and cons of a) and b).

Doing a) means the user changing global locale is responsible for finding
locale that matches format which Qt implements as expected (if not, that's
rare problem but unfortunately happened for the ISO format explained in the
Qt ticket). And possibly, finding format that won't break non-Qt apps that
may use different locale infra.
Or if the user changes the format by hand, but still does so in the system
locale settings, she's more in control as this is a global setting, not
per-app.

b) Has pros and cons but cons can be reduced by this option being opt-in
and default coming from the locale.

I did not know there are such differences for the locale system. But by no
means my email is a call to "patch" the Qt-level problem by having a KF5
solution. And I am skeptical if Qt can be patched in version 5 with such
incompatible change. Hopefully these poor man analysis help some other app
developers :)

-- 
regards, Jaroslaw Staniek

KDE:
: A world-wide network of software engineers, artists, writers, translators
: and facilitators committed to Free Software development - kde.org
KEXI:
: A visual database apps builder - kexi-project.org calligra.org/kexi
  twitter.com/kexi_project facebook.com/kexi.project t.me/kexi_project
Qt Certified Specialist:
: linkedin.com/in/jstaniek 


Re: Time formats / LC_TIME challenge for 4-digit year support

2018-12-04 Thread Albert Astals Cid
El dilluns, 3 de desembre de 2018, a les 14:47:56 CET, Jaroslaw Staniek va 
escriure:
> Hello,
> The need: 4-digit year support for short date formats to avoid issues like
> "10/11/12" dates.

What's wrong with 10/11/12 ?

> 
> This is just my initial conclusion from for the Qt date format issue:
> 
> https://bugreports.qt.io/browse/QTBUG-59382?focusedCommentId=436861=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-436861
> lt;dr: KF5 context: KCallendarSystem is part of the old APIs and the only
> code I found related to LC_TIME.
> 
> So I've not found any common code KDE app can use instead of hard coding
> some internal logic in order to support non-Plasma environments and/or
> non-global settings. Basically even if an app implements locale name
> selection in its private settings, "pure" Qt code is not enough to support
> it in the discussed cases. Users may need alter date format globally (for
> all apps) by hand using environment's settings, setting e.g. -mm-dd. Or
> app developers may add private setting for that, one per app.
> 
> Opinions welcome.

I am not sure i understand your email/problem.

As far as i read this email your concern is:
 * localized dates use the locale date format
 * locale date format is "wrong".

So the two options are:
 a) User changes their locale
 b) Apps don't use localized dates and use a custom format.

Am I understanding your email correctly?

Cheers,
  Albert