# Localisation not working on CakePHP 4

**URL:** <https://discourse.cakephp.org/t/localisation-not-working-on-cakephp-4/8693>\
**Category:** Uncategorized\
**Tags:** translation, help\
**Created:** [December 4, 2020, 8:59am UTC](https://discourse.cakephp.org/t/localisation-not-working-on-cakephp-4/8693 "2020-12-04T08:59:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kentosama](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@kentosama](https://discourse.cakephp.org/u/kentosama)\
**Post date:** [December 4, 2020, 8:59am UTC](https://discourse.cakephp.org/t/localisation-not-working-on-cakephp-4/8693/1 "2020-12-04T08:59:50Z")

</div>

Hello, it’s been several weeks since I got the localization to work with CakePHP 4. I followed the documentation, but it doesn’t work.

 ![Capture d’écran du 2020-12-04 09-59-14](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/2X/6/695fd824f064ca518064025603d888e75e980fff.png)

I have the src /Locale/fr\_FR folder in my app containing a simple “default.po” file with these few lines:

```
msgid "Awesome"
msgstr "Génial!"

msgid "Home"
msgstr "Accueil"

```

In my app.php:

```
defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),

```

In my AppController.php

```
I18n::setLocale('fr_FR');

```

\_\_(‘Awesome’); return always “Awesome”, same for problem for \_\_(‘Home’);

Clearing the cache have no effect.

Thanks for your help 🙂

---

<div class="post-metadata">

**Author:** ![Jawfin](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@Jawfin](https://discourse.cakephp.org/u/Jawfin)\
**Post date:** [December 4, 2020, 12:43pm UTC](https://discourse.cakephp.org/t/localisation-not-working-on-cakephp-4/8693/2 "2020-12-04T12:43:22Z")

</div>

Try putting your `locales` folder in the `/resources` folder, not the `/src` one. Also make it lowercase l - just in case!

---

<div class="post-metadata">

**Author:** ![kentosama](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@kentosama](https://discourse.cakephp.org/u/kentosama)\
**Post date:** [December 4, 2020, 7:36pm UTC](https://discourse.cakephp.org/t/localisation-not-working-on-cakephp-4/8693/3 "2020-12-04T19:36:22Z")

</div>

Thanks it work now 🙂

---

<div class="post-metadata">

**Author:** ![atlet](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/atlet/32/129_2.png) [@atlet](https://discourse.cakephp.org/u/atlet)\
**Post date:** [October 5, 2022, 11:00am UTC](https://discourse.cakephp.org/t/localisation-not-working-on-cakephp-4/8693/4 "2022-10-05T11:00:30Z")

</div>

I have the same problem. I followed the manual. The paths are all ok. If I set locale in AppController.php all numbers get properly formated according to locale. The problem is, that text don’t get translatet using \<?= \_\_("Some string") ?\>.

Is there any tutorial or hint, how can I debug or search what can be wrong?

---

<div class="post-metadata">

**Author:** ![atlet](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/atlet/32/129_2.png) [@atlet](https://discourse.cakephp.org/u/atlet)\
**Post date:** [October 6, 2022, 7:28pm UTC](https://discourse.cakephp.org/t/localisation-not-working-on-cakephp-4/8693/5 "2022-10-06T19:28:40Z")

</div>

The problem was wrong wrong permissions on folders and files.
