getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.32k stars 168 forks source link

Locale setting is ignored in single language website #1415

Closed manuelmoreale closed 5 years ago

manuelmoreale commented 5 years ago

Describe the bug I was trying to make this ->toDate('%B') work and print the correct german translation of the month's name.

Tried probably every possible permutation of the locale setting in the config file.

'locale' => 'de_DE.utf-8'
'locale' => 'de_DE'
'locale' => 'de_DE.UTF-8'

as well as the more explicit version using the single parameters

'locale' => [
    LC_COLLATE  => 'de_DE.utf-8',
    LC_MONETARY => 'de_DE.utf-8',
    LC_NUMERIC  => 'de_DE.utf-8',
    LC_TIME     => 'de_DE.utf-8',
    LC_MESSAGES => 'de_DE.utf-8',
    LC_CTYPE    => 'de_DE.utf-8'
]

None of these seem to work. Adding this in my file though setlocale(LC_ALL, 'de_DE'); work just fine and ->toDate('%B') then prints the correct translated name of the month.

To Reproduce Steps to reproduce the behavior:

  1. Go to in the config file
  2. Add the date handler 'date.handler' => 'strftime'
  3. Add a custom locale 'locale' => 'de_DE.utf-8'
  4. Try print a translated date somewhere in a template using ->toDate('%B')

Expected behavior The name of the month should reflect the setting of the locale value

Kirby Version 3.0.0

Additional context This is a "vanilla" installation with no languages set up in the languages folder

bastianallgeier commented 5 years ago