Open vilardellsalles opened 3 years ago
As explained in the documentation, Babel implements its own syntax for date and time, independent of datetime.strftime
. sphinx.util.i18n.format_date
basically translates datetime.strftime
syntax to babel.dates
syntax.
According to Softcatalà and the C standard library specification (used in Python), the syntax datetime.strftime("%-d %B")
could be used to produce the desired output, but this does not seem to work with Python 3.12.1 and Clang 13.0.0 on darwin. However, it does work with Python 3.6.9 and GCC 8.4.0 on linux.
When representing dates in Catalan, the format
datetime.strftime("%d %B")
method produces output like23 octubre
, but it should be23 d'octubre
. This cannot be replaced by"%d d'%B"
format because the proper format for months starting with a consonant is different (e.g.,23 de novembre
). Therefore, it should be investigated how to solve this issue. So far, this has been solved by using thesphinx.util.i18n.format_date
method that basically uses thebabel.dates
module to format dates, but it is unclear how Babel implements this and how this could be ported to the standard library (i.e., todatetime
). There is a possible solution at Softcatalà.