Date format

Having trouble installing serendipity?
Post Reply
pi4nym
Posts: 4
Joined: Tue Mar 31, 2020 9:09 pm

Date format

Post by pi4nym »

Hai,

I installed version 2.3.4 for our club station https://pi4nym.nl all seems well with the plugins however I still get dates and months always in English and not in Dutch as I would expect. What do I mis here any hints or tips are welcome... (running on ubunti 16.x)

Rgds...
thh
Regular
Posts: 419
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Date format

Post by thh »

pi4nym wrote: Sat Apr 11, 2020 12:38 am however I still get dates and months always in English and not in Dutch as I would expect. What do I mis here any hints or tips are welcome... (running on ubunti 16.x)
I'm not sure if I remember correctly, but I think dates and times are presented using built-in functions that need the correct "locale" (i.e. the set of charsets, dates, currencies, ...) installed. On a hosted webspace or server that should be configured correctly by your provider. If you host yourself (as I do), you have to install the right locale for NL. (You don't have to set it four your user, it just needs to be present.)

I had to run dpkg-reconfigure locales on Debian to install a DE locale.

Google says on Ubuntu, you can check your installed locales with locale -a on a shell prompt, and if you don't have something like nl_NL.UTF-8, you'll need to (re-)generate that locale with sudo locale-gen nl_NL.UTF-8.
pi4nym
Posts: 4
Joined: Tue Mar 31, 2020 9:09 pm

Re: Date format

Post by pi4nym »

Hai thh,

Sorry for the late reply but thnxs for your messages. It looked good as with locale -a it showed only:
C
C.UTF-8
POSIX
en_US.utf8

after running sudo locale-gen nl_NL.UTF-8 I got this :
C
C.UTF-8
POSIX
en_US.utf8
nl_NL.utf8

So NL was added great jumping back to the site unfortunately all was Dutch except the dates still...(also restarted apache2)

dpkg-reconfigure locales I can also run and shows now EN & NL to be available.

Also at the end of each artikle it still tels me Read More and not "Lees Verder" <- Dutch hi..

The site is at http://pi4nym.nl

If you have more tips that would be great hi... At the same time I keep trying..

Kind regards Paul de pa3fua
pi4nym
Posts: 4
Joined: Tue Mar 31, 2020 9:09 pm

Re: Date format

Post by pi4nym »

I found the isseu Eureka....

In lang/UTF-8/serendipity_lang_nl.inc.php its an error for NL its originaly:
@define('DATE_LOCALES', 'nl_BE.UTF-8, nl_BE.UTF-8, dutch, nl_BE, nl');

But should be:
@define('DATE_LOCALES', 'nl_NL.UTF-8, nl_NL.UTF-8, dutch, nl_NL, nl');

That made the dates in NL so due to your messages I started digging in the right way..

Thnxs...

Chrs Paul
thh
Regular
Posts: 419
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: Date format

Post by thh »

pi4nym wrote: Sat May 02, 2020 4:17 pm In lang/UTF-8/serendipity_lang_nl.inc.php its an error for NL its originaly:
@define('DATE_LOCALES', 'nl_BE.UTF-8, nl_BE.UTF-8, dutch, nl_BE, nl');

But should be:
@define('DATE_LOCALES', 'nl_NL.UTF-8, nl_NL.UTF-8, dutch, nl_NL, nl');
That may be due to the credited author being from Belgium ... :D
erAck
Regular
Posts: 235
Joined: Mon Feb 16, 2015 1:20 am

Re: Date format

Post by erAck »

In serendipity_config.inc.php there is
$locales = explode(',', DATE_LOCALES);
which then is iterated for setlocale() so it should be possible to have

@define('DATE_LOCALES', 'nl_NL.UTF-8, nl_NL.UTF8, nl_BE.UTF-8, nl_BE.UTF8, dutch, nl_NL, nl_BE, nl');

to try all. (I don't get why there is 'nl_BE.UTF-8, nl_BE.UTF-8' duplicated, likely copy-pasta and the second should had been nl_BE.UTF8, otherwise it doesn't make sense).
Post Reply