Time, date and language

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm
Location: Italy

Time, date and language

Post by gianpiero »

Hi

in my site the Default language for the frontend it set ITALIANO (Italian)
My server is in ITALY
CMSMS is 1.9.4.3 fresh installation

In my config.php are defined:

$config['timezone'] = 'Europe/Rome';
$config['locale'] = 'it_IT ';

In my ACP "CMS Install Information" most of settings are collected BUT "locale" is empty
Why ?

Code: Select all

    default_upload_permission: 664
    url_rewriting: mod_rewrite
    page_extension: .html
    query_var: page
    image_manipulation_prog: GD
    auto_alias_content: true
    locale: 
    default_encoding:utf-8
    admin_encoding: utf-8
    set_names: true


Question: I am not able to use time and data in Italian Language on the front end
Yes, is possible, but only with numbers not with letters
I need December, November .... Sunday, Monday .... but in Italian language

I have a site on the same hosting server, where I tested a fresh 1.10.1 installation,
and time and dates works fine with Italian. I don't know : upgrading is really a solution ?
or the wrong feature will be retained... ?


thanks for any
Gianpiero
janaf
Forum Members
Forum Members
Posts: 183
Joined: Sun Jan 10, 2010 7:02 pm

Re: Time, date and language

Post by janaf »

Hi,

Try using just "it" instead of "it_IT".
I am not able to use time and data in Italian Language on the front end
Some more details needed; what do you mean by "use"?

Here is the documentation on Smarty date / time formatting: http://www.smarty.net/docsv2/en/languag ... ate.format
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm
Location: Italy

Re: Time, date and language

Post by gianpiero »

Hi, thanks for your reply

I realized that
$config['locale'] = 'it_IT ';
was commented into my config.php. :-\

So things are going better but not completely:

at the moment the date appears correctly in frontend, only about news module, eg. "03 Maggio, 2011" ( that is italian version of "03 May, 2011")

BUT when I put a tag into my pages, eg.

Code: Select all

{recently_updated dateformat='D M j G:i:s T Y'}
abbreviated month name and days are in English language

bye
gp
janaf
Forum Members
Forum Members
Posts: 183
Joined: Sun Jan 10, 2010 7:02 pm

Re: Time, date and language

Post by janaf »

Look in your template header. The locale may be set there in HTML. It is set in the default CMSMS templates I have used.

The setting in the config file is the default one but this may be changed even on a page by page basis, for example for multilanguage sites.


PS The preferred function is now cms_date_format, ie

Code: Select all

{recently_updated|cms_date_format:'<formatstring>'}
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm
Location: Italy

Re: Time, date and language

Post by gianpiero »

janaf wrote:Look in your template header. The locale may be set there in HTML.
this is my header ( a portion)

Code: Select all

{process_pagedata}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it">
{* Change lang="en" to the language of your site *}
........
I made a test with your string : no output
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm
Location: Italy

Re: Time, date and language

Post by gianpiero »

I went to a conclusion, comparing 2 CMSMS tags:
in my pages, this work (srftime) in locale language

Code: Select all

{created_date format="%A %d-%b-%y %T"}
this doesn't work (php -date- format) in locale language

Code: Select all

{recently_updated dateformat='D M j G:i:s T Y'}
If I'm wrong any comment will be appreciate
gp
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Time, date and language

Post by Dr.CSS »

First, all date formatting needs the %, second, you may want to change the dateformat to format...
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm
Location: Italy

Re: Time, date and language

Post by gianpiero »

Thank you for the reply!

I'm following, or I think to do this, the guide into Help of
CMSMS at the tag "recently_updated"
Help for the recently_updated tag
What does this do?

Outputs a list of recently updated pages.
How do I use it?

Just insert the tag into your template/page like: {recently_updated}
What parameters does it take?

(optional) number='10' - Number of updated pages to show.

Example: {recently_updated number='15'}

(optional) leadin='Last changed' - Text to show left of the modified date.

Example: {recently_updated leadin='Last Changed'}

(optional) showtitle='true' - Shows the titleattribute if it exists as well (true|false).

Example: {recently_updated showtitle='true'}

(optional) css_class='some_name' - Warp a div tag with this class around the list.

Example: {recently_updated css_class='some_name'}

(optional) dateformat='d.m.y h:m' - default is d.m.y h:m , use the format you whish (php -date- format)

Example: {recently_updated dateformat='D M j G:i:s T Y'}
anyway I think that I'have tested/sorted o lot of different string to get italian output

gp
Post Reply

Return to “The Lounge”