Share » Forums » Setup & design » Date translation to Spanish

Date translation to Spanish

Date translation to Spanish

Wednesday 23 February 2011 9:24:37 am - 5 replies

Author Message

Bertrand Dunogier

Wednesday 23 February 2011 9:56:27 am

If the date is properly displayed through l10n, it should be formatted according to the active locale.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Alejandro Dominguez

Wednesday 23 February 2011 12:13:09 pm

Hello Bertrand,

I wasn't using |l10n. I have introduced it in my code but I'm still getting the date in english.

This is the code I'm using:

{$node.object.data_map.publish_date.content.timestamp|l10n( 'date' )}

What do you mean with "active locale"? I'm working with esl, which I think is the spanish version, don't I?

Thanks :)

Carlos Revillo

Wednesday 23 February 2011 12:23:53 pm

hi Alejandro. you should have a [RegionalSettings] group in your site.ini.append.php file. it will tell you which locale is the active one.

the template code you posted should output month names, weekdays or whatever in Spanish.

Bayron Guevara

Wednesday 23 February 2011 8:32:32 pm

Well, as I understand, you want to display a date using the datetime operator an passing to it the 'large' date format.

I guess it's displaying in english because you don't have an override for the file datetime.ini for your frontend siteaccess, which would display the respectively date format in spanish. So try to make a datetime.ini override on the frontend siteaccess and add the following:

[ClassSettings]

Formats[large]=<whatever date format you want>

Web Developer & Modern Philosopher
Visit http://www.laprensa.hn, http://www.diez.hn, http://www.estilo.hn

Alejandro Dominguez

Thursday 24 February 2011 2:12:27 am

Hello guys,

@Carlos

This are the values of my [RegionalSettings] in the siteaccess esl

[RegionalSettings]

Locale=esl-ES

ContentObjectLocale=esl-ES

ShowUntranslatedObjects=disabled

SiteLanguageList[]

SiteLanguageList[]=esl-ES

TextTranslation=enabled

I think they are right, don't I?

@Bayron

I have created an override in settings/siteaccess/esl/datetime.ini.append.php with the same code of the original file:

<?php /* #?ini charset="utf-8"?

[ClassSettings]
Formats[]
Formats[all]=%a, %A, %d, %D, %F, %g, %G, %h, %H, %i, %j, %l, %m, %M, %n, %O, %s, %T, %U, %w, %W, %Y, %y, %z, %Z

*/ ?>

I have cleared the caches, but it doesn't work. :(

I have also checked that share/locale/esl-ES.ini has the spanish translation of datetime.

Thank you for your help!!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu