Format %OB should be used to represent the months instead of %B

Bug #1906960 reported by Joan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rapid Photo Downloader
New
Undecided
Unassigned

Bug Description

In some locales %B (that Rapid photo downloader seems to be using) adds the article before the month. In the case of folder tagging would be more interesting having only the month. The same issue has been fixed in many other projects (for example gtk https://gitlab.gnome.org/GNOME/gtk/-/issues/9)

For example in catalan:
  $ LC_TIME=ca_ES.UTF.8 date +%B
  de desembre
  $ LC_TIME=ca_ES.UTF.8 date +%OB
  desembre

The languages not affected would show the same text in both formats.

Regads and thanks for this nice piece of software.

Revision history for this message
Damon Lynch (dlynch3) wrote :

Hi, thank you for bringing this to my attention. There are two issues:

(1) What to do about users who have been using the %B behavior, and who do not want the current behavior to change. Without introducing a new data format to supplement the existing options, this is a difficult problem to solve, because it guarantees some users are going to be unhappy.

(2) How to implement it in Python. I don't see it documented here: https://docs.python.org/3/library/datetime.html

What do you suggest regarding the second issue?

Revision history for this message
Joan (aseques) wrote :

About the first issue I created a small script to check the dimension of the problem. There are 477 locales in my system (only selecting utf and iso), of those 41 are affected by the change of %OB from %B.
On about half of those the change is to lose the article (for example in catalan an what I would intend to accomplish). So about twenty of the locales (being russian and polish the most popular) have other changes (maybe someone from that community should comment on this)

---------------------------------
#!/bin/bash
echo -n '' > /tmp/b
echo -n '' > /tmp/ob
for L in `locale -a`; do
        LC_TIME=$L date +"$L %B" >> /tmp/b
        LC_TIME=$L date +"$L %OB" >> /tmp/ob
done
diff -y /tmp/b /tmp/ob --suppress-common-lines | grep -E "(utf|iso)"
---------------------------------

About 2), there's a ticket opened by myself a few months ago commenting that missing part in the documentation, you should be able to call it even if it's undocumented on most version. See it here (https://bugs.python.org/issue38228), stating the same more or less (when there's no ab_alt_mon or alt_mon defined it will return the normal values)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.