How i can generate the date into Spanish with latexpdf?

53 views
Skip to first unread message

Almudena Soblechero Garcia

unread,
Jun 5, 2014, 7:49:33 AM6/5/14
to sphinx...@googlegroups.com
Good Morning, one more time!!!

I'm trying to generate my documentation, and i have found one (or two problems).

When i generate the latexpdf (make latexpdf), evering it's in spanish... but the date no.... the date it is english format....

Looking the conf.py file i found two places where i can put the date, lines 61 and line 63, in the fisrt line, you can put the date wich you want (e.g. --> 61 today = '17 de Junio de 2014' ) and in the line 63 today_fmt = '%B %d, %Y', but these option put the date bad (5 de june de 2014) don't thranslate the month into spanish...

With the fisrt option, you can put the date, that you want, and with the second option, latexpdf generate the date, but, in English, well into spanglish.

Other solution that i've think its put the date in that format "DAY/MONTH/YEAR" (05/06/2014) but i don know how i can do that.


There is somebody, that have any suggestion, for to generate automatically the date in the spanish format.

Takayuki Shimizukawa

unread,
Jun 15, 2014, 2:33:38 AM6/15/14
to sphinx...@googlegroups.com
Hi,

Sphinx have a ES translation for 'today_fmt':
https://bitbucket.org/birkenfeld/sphinx/src/6e61d8a5/sphinx/locale/es/LC_MESSAGES/sphinx.po#cl-47

However, Sphinx has never set locale for any purpose then "%B" for
strftime always represent by English.
There is a workaround for that. You can set locale.setlocale in your
conf.py as::

#today = ''
#today_fmt = '%B %d, %Y'
import locale
locale.setlocale(locale.LC_TIME, 'es_ES.UTF-8')

Regards,
--
Takayuki SHIMIZUKAWA
http://about.me/shimizukawa
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sphinx-users...@googlegroups.com.
> To post to this group, send email to sphinx...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages