# Set the Locale to german?

**URL:** <https://forum.getkirby.com/t/set-the-locale-to-german/25686>\
**Category:** Questions\
**Tags:** v3\
**Created:** [June 7, 2022, 8:05am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686 "2022-06-07T08:05:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lfgi](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@lfgi](https://forum.getkirby.com/u/lfgi)\
**Post date:** [June 7, 2022, 8:05am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/1 "2022-06-07T08:05:19Z")

</div>

I am currently learning Kirby so please forgive any stupid questions from me.  
I would like to change the PHP Locale to German so that the Events section (taken from the sample files) shows the dates in german. I have added the Locale settings to the config file but nothing is changing.

Here is my config file:

```auto
<?php
return [
	'panel' =>[
    	'install' => true
		]
];

return [
  'locale' => 'de_DE.utf-8'
];

```

And here the call I am making:

```auto
<h4><?= $schreibwerkstatt_single->from()->toDate('%A, j. F Y') ?></h4>

```

Two questions I have, 1. how to make the Locale set for german, and 2. what is the correct way to build the config file, should there be just one ‘return ’ or should there be more which are broken down into parts?

Thanks for any help 🙂

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [June 7, 2022, 8:19am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/2 "2022-06-07T08:19:59Z")

</div>

Your problem are the two return statements, see [Configuration | Kirby CMS](https://getkirby.com/docs/guide/configuration#the-config-php)

---

<div class="post-metadata">

**Author:** ![lfgi](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@lfgi](https://forum.getkirby.com/u/lfgi)\
**Post date:** [June 7, 2022, 8:24am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/3 "2022-06-07T08:24:30Z")

</div>

Thank you.  
Config.php now looks like this:

```auto
<?php
return [
	'panel' =>[
    	'install' => true
		],
	'locale' => 'de_DE.utf-8'
];

```

Which is not throwing an error, super.  
But it is also not changing the dates to german…

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [June 7, 2022, 10:23am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/4 "2022-06-07T10:23:33Z")

</div>

You have to set the date handler: [date | Kirby CMS](https://getkirby.com/docs/reference/system/options/date#date-handler__intl) (since strftime will get deprecated, better use intl) and the right pattern syntax for that handler.

---

<div class="post-metadata">

**Author:** ![lfgi](https://avatars.discourse-cdn.com/v4/letter/l/779978/32.png) [@lfgi](https://forum.getkirby.com/u/lfgi)\
**Post date:** [June 7, 2022, 10:41am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/5 "2022-06-07T10:41:34Z")

</div>

Ok, thanks, that is now working as expected 🙌

---

<div class="post-metadata">

**Author:** ![Kolja\_F](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/kolja_f/32/8034_2.png) [@Kolja\_F](https://forum.getkirby.com/u/Kolja_F)\
**Post date:** [January 29, 2024, 10:30am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/6 "2024-01-29T10:30:57Z")

</div>

Hm for me it is not working. My config return:

```auto
'locale' => 'de_DE.utf-8',
'date' => ['handler' => 'intl'],

```

In my template:

```auto
<?php $days = $page->children()->sortBy("datum", "asc")->pluck("datum", ",", true); ?>
<?php foreach ($days as $day): ?>
     <li><?= date('D d. M Y', strtotime($day)) ?></li>
<?php endforeach; ?>

```

My output:

```auto
Fri 14. Jun 2024
Sat 15. Jun 2024
Sun 16. Jun 2024

```

But I want:

```auto
Freitag 14. Juni 2024
Samstag 15. Juni 2024
Sonntag 16. Juni 2024

```

---

<div class="post-metadata">

**Author:** ![stffr](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@stffr](https://forum.getkirby.com/u/stffr)\
**Post date:** [January 29, 2024, 10:35am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/7 "2024-01-29T10:35:28Z")

</div>

`intl` is a php extension. Is it installed on your server?

---

<div class="post-metadata">

**Author:** ![GB\_DESIGN](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/gb_design/32/14956_2.png) [@GB\_DESIGN](https://forum.getkirby.com/u/GB_DESIGN)\
**Post date:** [January 29, 2024, 10:40am UTC](https://forum.getkirby.com/t/set-the-locale-to-german/25686/8 "2024-01-29T10:40:33Z")

</div>

`<?= $day(new IntlDateFormatter("de_DE", IntlDateFormatter::FULL, IntlDateFormatter::NONE, 'Europe/Berlin')) ?>`

should output a date like:  
**`Montag, 29. Januar 2024`**

More infos about the the IntlDateFormatter class here:  
[https://www.php.net/manual/de/class.intldateformatter.php](https://www.php.net/manual/de/class.intldateformatter.php)
