TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 247
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 199
  • Total: 199

Howto translate date

Started by fak3, May 03, 2009, 01:25:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ianedres

I was looking at this also and thought it may be a regional setting for your server's php configuration...

See this: http://www.php.net/manual/en/function.setlocale.php

Follow a few of the examples (under the changelog) to check what your server is returning...

fak3

Hey Ianedres. :)

Example 1:
<?php
/* Set locale to Dutch */
setlocale(LC_ALL'nl_NL');

/* Output: vrijdag 22 december 1978 */
echo strftime("%A %e %B %Y"mktime(00012221978));

/* try different possible locale names for german as of PHP 4.3.0 */
$loc_de setlocale(LC_ALL'de_DE@euro''de_DE''de''ge');
echo 
"Preferred locale for german on this system is '$loc_de'";
?>


Returned:
vrijdag 22 december 1978Preferred locale for german on this system is 'de_DE@euro'

Example 2:
<?php
/* Set locale to Dutch */
setlocale(LC_ALL'nld_nld');

/* Output: vrijdag 22 december 1978 */
echo strftime("%A %d %B %Y"mktime(00012221978));

/* try different possible locale names for german as of PHP 4.3.0 */
$loc_de setlocale(LC_ALL'de_DE@euro''de_DE''deu_deu');
echo 
"Preferred locale for german on this system is '$loc_de'";
?>


Returned:
Friday 22 December 1978Preferred locale for german on this system is 'de_DE@euro'

I don't know what they mean. :buck2:

Ianedres

This sets the language to Italian on my United States server.
setlocale(LC_ALL, 'it_IT.ISO8859-1', 'it_IT.UTF-8');

By combining it with this next line, it outputs the date in Italian properly.
echo strftime("%A, %d %B %Y") . "\n";


Not sure where to place the setlocale in the TP scripts...  Bloc? 

ZarPrime

fak3,

OK, per Bloc's request, and so that I don't have to keep watching this topic, I have posted this issue on the bugtracker.  The link to the bug is here --> http://www.tinyportal.net/index.php?action=bugtracker;sa=bug498

If you are interested, I suggest you check the bugtracker once in a while to check on the status of this.  Bloc will get to it and sort it out as soon as he can.

ZarPrime

fak3

Ok, I'll keep checking the bugtracker. ;) Thank you for the help.

G6Cad


Dark-Wolf

#26
@G6: thanks for your fix.
Edit:
but is TPortal.template.php and not TPBlocks.template.php ;)

G6Cad

Wasent me that fixed it, was our Bloc :)

And it's not always the obvious file the fixes are, this is one of those times  ;)

This website is proudly hosted on Crocweb Cloud Website Hosting.