Date translation to Spanish

Author Message

Alejandro Dominguez

Wednesday 23 February 2011 9:24:37 am

Hello guys,

I'm working with an eZpublish site with the frontend in Spanish and the backend in English. When an article outputs a date in large format is in English. Do you know how could I change it?

Cheers,

Alejandro

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!!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 04:25:16
Script start
Timing: Jan 18 2025 04:25:16
Module start 'layout'
Timing: Jan 18 2025 04:25:16
Module start 'content'
Timing: Jan 18 2025 04:25:17
Module end 'content'
Timing: Jan 18 2025 04:25:17
Script end

Main resources:

Total runtime0.8006 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 587.9141152.6250
Module start 'layout' 0.00930.0059 740.539139.4531
Module start 'content' 0.01520.7842 779.9922662.3906
Module end 'content' 0.79940.0012 1,442.382816.1641
Script end 0.8005  1,458.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4259160.0002
Check MTime0.00140.1711160.0001
Mysql Total
Database connection0.00090.114410.0009
Mysqli_queries0.730091.1777700.0104
Looping result0.00090.1069680.0000
Template Total0.752294.020.3761
Template load0.00220.274620.0011
Template processing0.750093.681220.3750
Template load and register function0.00010.014710.0001
states
state_id_array0.00270.334510.0027
state_identifier_array0.00110.135920.0005
Override
Cache load0.00190.2422400.0000
Sytem overhead
Fetch class attribute can translate value0.00080.099840.0002
Fetch class attribute name0.00180.227290.0002
XML
Image XML parsing0.00220.273940.0005
class_abstraction
Instantiating content class attribute0.00000.0028110.0000
General
dbfile0.00120.1499290.0000
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs