Posts: 36
Threads: 13
Joined: Jul 2012
The format of the dates is strangely different in the comment and the response:
In the comment: Sat 22 June, 2013 (I need it to be Zat 22 Juni, 2013)
In the respone: Gisteren 12:49 (Dutch as needed)
Where to look to solve this?
Thanks
John
Posts: 2,905
Threads: 59
Joined: Jun 2010
Have
you completed
the interview?
Posts: 36
Threads: 13
Joined: Jul 2012
Steven,
The use of 'today' and 'yesterday' are clear to me, not a problem, working great.
The language of the days and months however are the issue.
The cms where I have included Commentics in, displays dates in Dutch, so I thought
it should be possible to do the same in Commentics itself.
In comments.php the variable $dated is used:
echo $dated;
results in direct output as : 2013-06-25 12:45:06
In the Comment display it is (re)formated as : Tue 25 June, 2013
Using the strftime variable in the same page (with setlocale (LC_TIME, 'nl_NL'); )
echo strftime ("%A %e %B %Y", mktime (0, 0, 0, 6, 25, 2013));
results in output as : dinsdag 25 juni 2013 (that's what I need)
So the numeric base for the date is there in the $dated variable.
As far as my limited knowledge of php tells me, it should be possible
to format the date string into another (Dutch) language?
Posts: 2,905
Threads: 59
Joined: Jun 2010
Have
you completed
the interview?
Posts: 36
Threads: 13
Joined: Jul 2012
(27-Jun-2013, 03:38 PM)Steven Wrote: Does your CMS have a way to choose which locale to use? How did you know that 'nl_NL' would work?
The cms I use asks at install the language you want to use.
Though not always easy as far as 3rd party modules are concerned, overall the date format is flexible and completely Dutch.
The basic language config of the cms, where locale is also defined in a *.nls file. Such file is available for a great amount of different languages with each their specific locale :
Code:
#Dutch (Netherlands)
#Native language name
$nls['language']['nl_NL'] = 'Nederlands';
$nls['englishlang']['nl_NL'] = 'Dutch';
#Possible aliases for language
$nls['alias']['nl'] = 'nl_NL';
$nls['alias']['dutch'] = 'nl_NL';
$nls['alias']['nl_NL.ISO8859-1'] = 'nl_NL' ;
#Possible locale for language
$nls['locale']['nl_NL'] = 'nl_NL,nl_NL.utf8,nl_NL.UTF-8,nl_NL.utf.8,nl_NL@euro,dutch,Dutch_Netherlands.1252';
#Encoding of the language
$nls['encoding']['nl_NL'] = 'UTF-8';
#Location of the file(s)
$nls['file']['nl_NL'] = array(dirname(__FILE__).'/nl_NL/admin.inc.php');
Not sure if it matters but in my .htaccess file is also included :
Code:
SetEnv TZ Europe/Amsterdam
DefaultLanguage nl-NL