Forums / Setup & design / Date translation to Spanish

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

eZ debug

Timing: Jan 18 2025 01:06:51
Script start
Timing: Jan 18 2025 01:06:51
Module start 'content'
Timing: Jan 18 2025 01:06:52
Module end 'content'
Timing: Jan 18 2025 01:06:52
Script end

Main resources:

Total runtime0.8611 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.7109180.8438
Module start 'content' 0.00640.7381 768.5547667.4688
Module end 'content' 0.74450.1165 1,436.0234341.0625
Script end 0.8611  1,777.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4611210.0002
Check MTime0.00150.1684210.0001
Mysql Total
Database connection0.00070.085910.0007
Mysqli_queries0.774489.92892070.0037
Looping result0.00220.25872050.0000
Template Total0.832496.720.4162
Template load0.00220.251620.0011
Template processing0.830296.406120.4151
Template load and register function0.00010.011310.0001
states
state_id_array0.00100.119810.0010
state_identifier_array0.00190.222720.0010
Override
Cache load0.00180.2068400.0000
Sytem overhead
Fetch class attribute can translate value0.00160.190050.0003
Fetch class attribute name0.00130.146290.0001
XML
Image XML parsing0.00390.450650.0008
class_abstraction
Instantiating content class attribute0.00000.0025110.0000
General
dbfile0.00530.6157400.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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