Bug 137009 - Default time format for French locales in African countries is wrong
Summary: Default time format for French locales in African countries is wrong
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:7.1.0 target:7.0.3
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-24 20:56 UTC by sommerluk
Modified: 2020-10-10 19:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sommerluk 2020-09-24 20:56:27 UTC
Actual behaviour:
In Calc, the default time format for fr_CI is 01:37:46 PM.

Expected behaviour:
In Calc, the default time format for fr_CI is 13:37:46.

Steps to reproduce:
- Open Calc with a new sheet
- Menu bar → Format ↦ Cell
- As “Language”, choose “French, Ivory Coast”.
- Click on the category “Time”.
- Observe which time format is chosen by default.

Other comments:
The French locales for Benin, Burkina Faso, Mali, Niger, Senegal and Togo have the same issue. (However, the French locales for European countries like France and Belgium have all the correct default time format.)

Info about my setup:
Version: 6.4.4.2
Build-ID: 1:6.4.4-0ubuntu0.20.04.1
CPU-Threads: 4; BS: Linux 5.4; UI-Render: Standard; VCL: kf5; 
Gebietsschema: de-DE (de_DE.UTF-8); UI-Sprache: de-DE
Calc: threaded
Comment 1 Julien Nabet 2020-09-25 19:01:34 UTC
Do you know if there's an official reference?
Comment 2 Julien Nabet 2020-09-25 19:04:43 UTC
Code pointer: 
Benin, Mali, Niger, Senegal and Togo refer to Burkina Faso file:
./i18npool/source/localedata/data/fr_BF.xml

Also, is it the same for short format (I mean without seconds), it should be 13:37 instead of 01:37 PM

In this case, I think this patch should help:
diff --git a/i18npool/source/localedata/data/fr_BF.xml b/i18npool/source/localedata/data/fr_BF.xml
index 72ccc852f0da..7f4661b8edb4 100644
--- a/i18npool/source/localedata/data/fr_BF.xml
+++ b/i18npool/source/localedata/data/fr_BF.xml
@@ -162,16 +162,16 @@
     <FormatElement msgid="DateFormatskey9" default="false" type="medium" usage="DATE" formatindex="38">
       <FormatCode>WW</FormatCode>
     </FormatElement>
-    <FormatElement msgid="TimeFormatskey1" default="false" type="short" usage="TIME" formatindex="39">
+    <FormatElement msgid="TimeFormatskey1" default="true" type="short" usage="TIME" formatindex="39">
       <FormatCode>HH:MM</FormatCode>
     </FormatElement>
-    <FormatElement msgid="TimeFormatskey2" default="false" type="medium" usage="TIME" formatindex="40">
+    <FormatElement msgid="TimeFormatskey2" default="true" type="medium" usage="TIME" formatindex="40">
       <FormatCode>HH:MM:SS</FormatCode>
     </FormatElement>
-    <FormatElement msgid="TimeFormatskey3" default="true" type="short" usage="TIME" formatindex="41">
+    <FormatElement msgid="TimeFormatskey3" default="false" type="short" usage="TIME" formatindex="41">
       <FormatCode>HH:MM AM/PM</FormatCode>
     </FormatElement>
-    <FormatElement msgid="TimeFormatskey4" default="true" type="medium" usage="TIME" formatindex="42">
+    <FormatElement msgid="TimeFormatskey4" default="false" type="medium" usage="TIME" formatindex="42">
       <FormatCode>HH:MM:SS AM/PM</FormatCode>
     </FormatElement>
     <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME" formatindex="43">
Comment 3 Julien Nabet 2020-09-26 08:11:56 UTC
Sophie: thought you might have some contacts who may help here.
Comment 4 sophie 2020-09-28 13:55:37 UTC
I've asked to our African friends for official information (didn't find any myself), looking at this article, it seems only Togo use both 12 and 24 hours representation
https://en.wikipedia.org/wiki/Date_and_time_representation_by_country
So I would go with your patch, thanks for it!
Comment 5 Julien Nabet 2020-09-28 19:41:12 UTC
(In reply to sophie from comment #4)
> I've asked to our African friends for official information (didn't find any
> myself), looking at this article, it seems only Togo use both 12 and 24
> hours representation
> https://en.wikipedia.org/wiki/Date_and_time_representation_by_country
> So I would go with your patch, thanks for it!
Thank you for your feedback.
So if I submit the patch as it is, Togo won't have 12/24 hours representation.
Indeed, i18npool/source/localedata/data/fr_TG.xml, like:
- i18npool/source/localedata/data/fr_BJ.xml (Benin)
- i18npool/source/localedata/data/fr_CI.xml (Côte d'Ivoire)
- i18npool/source/localedata/data/fr_ML.xml (Mali)
- i18npool/source/localedata/data/fr_NE.xml (Niger)
- i18npool/source/localedata/data/fr_SN.xml (Sénégal)
inheritate the calendar format from Burkina Faso.
I must change it before.
Let's put this one to NEW for the moment.
Comment 6 sommerluk 2020-09-29 06:56:25 UTC
I can confirm for Ivory Coast and Benin for sure that they use 24 h format (only) in practice. Almost all people even do not understand at all the 12 h format. (I've lived in both countries.)
Comment 7 Julien Nabet 2020-09-29 19:16:28 UTC
I gave a try with:
https://gerrit.libreoffice.org/c/core/+/103638
Comment 8 Commit Notification 2020-09-29 23:17:30 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f11dc8335c9bae837823c14d059388b8d5965dcb

tdf#137009: except Togo, all French locales in African don't use AM/PM

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Julien Nabet 2020-09-30 05:50:23 UTC
Backport for 7.0 waiting for review here:
https://gerrit.libreoffice.org/c/core/+/103654
Comment 10 sommerluk 2020-10-03 07:00:01 UTC
Thanks a lot for the quick fix!
Comment 11 Commit Notification 2020-10-10 19:59:31 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/30ac2c61eacd8d14972afb381ffd76ae37590556

tdf#137009: except Togo, all French locales in African don't use AM/PM

It will be available in 7.0.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.