PDA

View Full Version : Change date lang


reputer
05-06-2006, 09:07 PM
Hi just bought the script everythings working great!
On thing I would love to change the date language from English to Dutch:

6 May, 2006 to 6 Mei, 2006

how can I change this?

Sergey Ten
05-07-2006, 05:24 PM
reputer, welcome to our support forum

Please follow this directives:

*** Open your index.php file and find 64 line ***

$gDirSmarty->assign_by_ref('links', $links);

*** After add this code ***

$dutch_date = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'Mei', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
foreach($links as $key => $values)
{
preg_match("/(\d{4})-(\d{2})-(\d{2})/", $values['date'], $matches);

$new_date = $dutch_date[$matches['2']];
$new_date .= " {$matches['3']}, ";
$new_date .= "{$matches['1']}";

$links[$key]['date'] = $new_date;
}

*** Save change ***

You could change mouth to Dutch

*** Open your link-display.tpl and find 28 line ***

{$lang.link_added}: {$link.date|date_format:$config.date_format}) ::

*** Change that code ***

{$lang.link_added}: {$link.date}) ::

*** Save change ***

If you have any other question please let me know

reputer
05-07-2006, 06:06 PM
Thanx for your clear and quick awnser!

Months are translated now but date format is wrong:

Mei 07, 2006 has to be 07 Mei, 2006

And in the link datail page the date is still english...

See: http://www.vakantiemarkt.com/links/campings/campings-overige/

Sergey Ten
05-07-2006, 06:55 PM
Ok, reputer

*** Open your index.php and find this code ***

$new_date = $dutch_date[$matches['2']];
$new_date .= " {$matches['3']}, ";
$new_date .= "{$matches['1']}";

*** Change to ***

$new_date = "{$matches['3']} ";
$new_date .= $dutch_date[$matches['2']];
$new_date .= ", {$matches['1']}";

*** Save change ***

reputer
05-07-2006, 07:00 PM
Almost there still de link details page is in english format:

http://www.vakantiemarkt.com/links/campings/campings-overige/campings-nl-l5.html

Sergey Ten
05-07-2006, 07:39 PM
*** Open your view-link.php and find 95 line ***

$link =& $gDirDb->getLinkById($_GET['id']);

*** After add this code ***

$dutch_date = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'Mei', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
preg_match("/(\d{4})-(\d{2})-(\d{2})/", $link['date'], $matches);
$new_date = "{$matches['3']} ";
$new_date .= $dutch_date[$matches['2']];
$new_date .= ", {$matches['1']}";

$link['date'] = $new_date;

*** Save change ***

*** Open your search.php and find 39 line ***


$links = $gDirDb->getSearchLinks($what, $type, $start, $gDirConfig['num_index_links']);

*** After add this code ***

$dutch_date = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'Mei', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
foreach($links as $key => $values)
{
preg_match("/(\d{4})-(\d{2})-(\d{2})/", $values['date'], $matches);
$new_date = "{$matches['3']} ";
$new_date .= $dutch_date[$matches['2']];
$new_date .= ", {$matches['1']}";

$links[$key]['date'] = $new_date;
}


*** Save change ***

P.S.
Nice site :good:

reputer
05-07-2006, 07:50 PM
FIXED! Thanks for your great help!
And thanx for the :good: about my site!

Sergey Ten
05-07-2006, 07:52 PM
You are welcome.

If you have any other question please let me know

Simon Gooffin
05-08-2006, 10:01 AM
2 Sergey Ten:
Well done, :good:
'eSyndiCat expert' rank for you then :D