Jump to content

Date – Multilanguage Output


ngrmm
 Share

Recommended Posts

i did a multilanguage-install.

english and german are needed

i set german as default (install german languagepack at default)

then add english (en) as second language

my date-output is custom: %A %d %B %Y (Details Tab)
echo $page->date

the problem is that i always get the english ouput.

Link to comment
Share on other sites

Strange behavior. I have the following settings in my Details Tab:

German: %e. %B %G

English: %e %B %G

A slightly difference - German has a dot(.) after %e - it outputs all in correct language:

German: 22. Oktober 2015

English: 22 October 2015

Try it with this date formats and see if the result are the same as in this example.

Best regards

Jürgen

  • Like 1
Link to comment
Share on other sites

it works!
 

$lang = $user->language->name;
if($lang == 'default') {
setlocale(LC_TIME, "de_DE.UTF8");
}
else {
setlocale(LC_TIME, "en_EN.UTF8");
}
 
and 
 
utf8_encode(strftime('%A <br>%d %B %Y', $page->getUnformatted('postDate')))
 
 
 
 
THANKS!
  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...