Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • jpalencia501307 Friend
    #162942

    I would like to change the date format to my spanish language, how can I do this?

    Thanks in advance….

    khoand Friend
    #387024

    Hi,
    Where section do you want to change? And How? A snapshot with your comment is very helpful

    jpalencia501307 Friend
    #387089

    The sections are the frontpage content, and the article…. the actually format is showed like 20 april 2010, I like to change to “20 Abril 2010”

    Thanks in advanced…

    khoand Friend
    #387189

    Hi,
    You try change these values from <joomla url>languageen-GBen-GB.ini file


    JANUARY_SHORT="Jan"
    JANUARY="January"
    FEBRUARY_SHORT="Feb"
    FEBRUARY="February"
    MARCH_SHORT="Mar"
    MARCH="March"
    APRIL_SHORT="Apr"
    APRIL="April"
    MAY_SHORT="May"
    MAY="May"
    JUNE_SHORT="Jun"
    JUNE="June"
    JULY_SHORT="Jul"
    JULY="July"
    AUGUST_SHORT="Aug"
    AUGUST="August"
    SEPTEMBER_SHORT="Sep"
    SEPTEMBER="September"
    OCTOBER_SHORT="Oct"
    OCTOBER="October"
    NOVEMBER_SHORT="Nov"
    NOVEMBER="November"
    DECEMBER_SHORT="Dec"
    DECEMBER="December"

    alakentu Friend
    #387857

    Hi everyone,

    As you said Khoand, change the English language file, but it is not.

    I’ve managed to change the date format from English to Spanish editing the template files.

    The files to edit are:

    <blockquote>joomla_route/templates/ja_events/html/com_content/article/default.php</blockquote>
    Near the line #88 to #97

    Default is:

    [PHP]<?php if ($params->get(‘show_create_date’)) : ?>
    <dd class=”create”>
    <?php
    $createDay = date(‘d’, strtotime( $this->item->created));
    $createMonth = date(‘M’, strtotime( $this->item->created));
    ?>
    <span class=”date”><?php echo $createDay; ?></span>
    <span class=”month”><?php echo $createMonth; ?></span>
    </dd>
    <?php endif; ?>[/PHP]

    Change to:

    [PHP]<?php if ($params->get(‘show_create_date’)) : ?>
    <dd class=”create”>
    <?php
    $createDay = date(‘d’, strtotime( $this->item->created));
    $createMonth = JHTML::_(‘date’, $this->item->created, JText::_(‘M’));
    ?>
    <span class=”date”><?php echo $createDay; ?></span>
    <span class=”month”><?php echo $createMonth; ?></span>
    </dd>
    <?php endif; ?>[/PHP]

    <blockquote>joomla_route/templates/ja_events/html/com_content/category/blog_item.php</blockquote>
    Near the line #53 to #62

    Default is:

    [PHP]<?php if ($params->get(‘show_create_date’)) : ?>
    <dd class=”create”>
    <?php
    $createDay = date(‘d’, strtotime( $this->item->created));
    $createMonth = date(‘M’, strtotime( $this->item->created));
    ?>
    <span class=”date”><?php echo $createDay; ?></span>
    <span class=”month”><?php echo $createMonth; ?></span>
    </dd>
    <?php endif; ?>[/PHP]

    Change to:

    And,

    <blockquote>joomla_route/templates/ja_events/html/com_content/featured/default_item.php</blockquote> Near the line #124 to #136

    Default is:

    <div class=”inner clearfix”>
    [PHP] <?php
    if ($this->params->get(‘show_create_date’)) :
    $createDay = date(‘d’, strtotime( $this->item->created));
    $createMonth = JHTML::_(‘date’, $this->item->created, JText::_(‘M’));
    $createYear = date(‘Y’, strtotime( $this->item->created));
    ?>
    <div class=”articleCreated”>
    <span class=”date”><?php echo $createDay; ?></span>
    <span class=”month”><?php echo $createMonth; ?></span>
    <span class=”year”><?php echo $createYear; ?></span>
    </div>
    <?php endif; ?>[/PHP]

    Change to:

    [PHP] <?php
    if ($this->params->get(‘show_create_date’)) :
    $createDay = date(‘d’, strtotime( $this->item->created));
    $createMonth = JHTML::_(‘date’, $this->item->created, JText::_(‘M’));
    $createYear = date(‘Y’, strtotime( $this->item->created));
    ?>
    <div class=”articleCreated”>
    <span class=”date”><?php echo $createDay; ?></span>
    <span class=”month”><?php echo $createMonth; ?></span>
    <span class=”year”><?php echo $createYear; ?></span>
    </div>
    <?php endif; ?>[/PHP]

    Best regards.

    jpalencia501307 Friend
    #387883

    Thank you both for your answers, but none has been successful.

    I’m working with a local server (wamp) for testing before getting online web site.

    Friend, alakentu

    I have taken the suggestion you gave me, but your sample code seems to have changed, and it is not exactly like your samples.

    However, when opening files which I already knew, I found this command line in common: “$createMonth = date(‘M’, strtotime( $this->article->created));”

    This line only appears in the files:

    default.php
    default_item.php

    According to what you indicate as samples that line is that I changed to this new line: “$createMonth = JHTML::_(‘date’, $this->item->created, JText::_(‘M’));” to show the month in Spanish

    I made that change in the two files that you indicated above, but only shows me the format as follows: 18 M 2010

    In the remaining file “blog_item.php” there is no line like you indicate to change. There is no code like that you mentioned to change.

    Thanks in advanced.

    PLEASE HELP ME TO SOLVE THIS, I NEED TO DELIVER THE PROJECT THIS WEEK, AND SHOW THE RIGHT WAY DATE FORMATS.

    alakentu Friend
    #387888

    That version of the template you are using? What I replied is to be applied to version 1.0.0 Beta for Joomla 1.6.

    Anyway, if you use the version for Joomla 1.5.X should be different.

    default.php and default_item.php files for the route:
    <blockquote>templatesja_eventshtmlcom_contentarticle in the line #49 and
    templatesja_eventshtmlcom_contentfrontpage in the line #120</blockquote>

    Change:

    [PHP]$createMonth = date(‘M’, strtotime( $this->article->created)); [/PHP]

    To:

    [PHP]$createMonth = JHTML::_(‘date’, $this->article->created, JText::_(‘%b’));[/PHP]

    jpalencia501307 Friend
    #388005

    Dear Friend, Alakentu

    Thanks for your help, it really has been invaluable, I could solve the problem. However, we must clarify the following:

    1 .- I’m using joomla 1.5.23

    2 .- The line to change is different in each file, to:

    File: default.php
    <blockquote> templatesja_eventshtmlcom_contentarticle in the line #49 and #168 </blockquote>
    Use this: [PHP]$createMonth = JHTML::_(‘date’, $this->article->created, JText::_(‘%b’));[/PHP]

    and

    File: default_item.php
    <blockquote>templatesja_eventshtmlcom_contentfrontpage in the line #120</blockquote>

    Use this: [PHP]$createMonth = JHTML::_(‘date’, $this->item->created, JText::_(‘%b’));[/PHP]

    I hope this is helpful to others. Success for all.:)

    alakentu Friend
    #388172

    Hello,

    Yes, exactly as in both cases the original code is: [PHP]$createMonth = date(‘M’, strtotime( $this->article->created)); [/PHP]

    Just change it by and let you see results.

    micheltorres Friend
    #398127

    Does not work! If I follow the suggestion, the site returns the default date set (in my case America / Sao Paulo).

    khoand Friend
    #398477

    <em>@micheltorres 249267 wrote:</em><blockquote>Does not work! If I follow the suggestion, the site returns the default date set (in my case America / Sao Paulo).</blockquote>
    What version of joomla do you use? Could you give me username+password of ftp?

    micheltorres Friend
    #398480

    Hello khoand,

    You’ve solved the issue in topic http://www.joomlart.com/forums/topic/change-language-in-a-data-label-in-articles/#post-398266

    Thank you again!

Viewing 12 posts - 1 through 12 (of 12 total)

This topic contains 12 replies, has 4 voices, and was last updated by  micheltorres 13 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum