# \#i18n

**URL:** https://discourse.cakephp.org/tag/i18n/5.md

[Latest](https://discourse.cakephp.org/latest.md) · [Categories](https://discourse.cakephp.org/categories.md) · [Tags](https://discourse.cakephp.org/tags.md)

---

## [Assistance Needed with Localization Issue: Translations Not Applied as Expected (CakePHP 5.1.1)](https://discourse.cakephp.org/t/assistance-needed-with-localization-issue-translations-not-applied-as-expected-cakephp-5-1-1/12293)

<div class="topic-metadata">

**Author:** [@apricotpoodle](https://discourse.cakephp.org/u/apricotpoodle)\
**Replies:** 9\
**Last updated:** [November 14, 2024, 1:31pm UTC](https://discourse.cakephp.org/t/assistance-needed-with-localization-issue-translations-not-applied-as-expected-cakephp-5-1-1/12293 "2024-11-14T13:31:21Z")

</div>

Hello CakePHP community, I’m encountering a challenging issue with translations and localization in CakePHP 5.1.1, and I’d greatly appreciate any guidance. Normally, clearing the cache resolves any minor issues I’ve had…

---

## [Entity saving only works the second time cakePHP4](https://discourse.cakephp.org/t/entity-saving-only-works-the-second-time-cakephp4/11879)

<div class="topic-metadata">

**Author:** [@Amoe](https://discourse.cakephp.org/u/Amoe)\
**Replies:** 2\
**Last updated:** [February 22, 2024, 7:39am UTC](https://discourse.cakephp.org/t/entity-saving-only-works-the-second-time-cakephp4/11879 "2024-02-22T07:39:48Z")

</div>

I have 18n localization, if that matters. I’ve tried everything, but I just don’t understand what the problem is. CoursesCategoriesController.php public function add() { $model = 'CoursesCategories'; …

---

## [TranslateBehavior in CakePHP 5 with EavStrategy does not read the translated content from i18n](https://discourse.cakephp.org/t/translatebehavior-in-cakephp-5-with-eavstrategy-does-not-read-the-translated-content-from-i18n/11872)

<div class="topic-metadata">

**Author:** [@hasentopf](https://discourse.cakephp.org/u/hasentopf)\
**Replies:** 1\
**Last updated:** [February 19, 2024, 6:47pm UTC](https://discourse.cakephp.org/t/translatebehavior-in-cakephp-5-with-eavstrategy-does-not-read-the-translated-content-from-i18n/11872 "2024-02-19T18:47:17Z")

</div>

Hi, I try to migrate a v3.x cake project to v5.x. My categories table has content in different languages in the i18n table (default schema from config/schema/i18n.sql). When I enable the TranslateBehavior in the Catego…

---

## [Error extracting POT file](https://discourse.cakephp.org/t/error-extracting-pot-file/11797)

<div class="topic-metadata">

**Author:** [@Acolombo](https://discourse.cakephp.org/u/Acolombo)\
**Replies:** 11\
**Last updated:** [January 16, 2024, 10:37am UTC](https://discourse.cakephp.org/t/error-extracting-pot-file/11797 "2024-01-16T10:37:33Z")

</div>

0 Good morning, I’m using CakePHP 4, I just tried to extract a POT file in order to translate my project using the command “bin/cake i18n extract” and I got the following error: Exception: Cannot use 'DebugKit\\Command\\…

---

## [Overloading plugin .po files has changed](https://discourse.cakephp.org/t/overloading-plugin-po-files-has-changed/11657)

<div class="topic-metadata">

**Author:** [@jmischer](https://discourse.cakephp.org/u/jmischer)\
**Replies:** 0\
**Last updated:** [November 10, 2023, 3:17pm UTC](https://discourse.cakephp.org/t/overloading-plugin-po-files-has-changed/11657 "2023-11-10T15:17:45Z")

</div>

Hi everyone, I am not sure if this is a bug or if I used to not do it the cake way. For example I have a plugin with a templates where I use \_\_d('plugin\_name', 'Some text to be transalted') In my plugin I do have a p…

---

## [I18n nice function does not work as it is described in the docs](https://discourse.cakephp.org/t/i18n-nice-function-does-not-work-as-it-is-described-in-the-docs/11604)

<div class="topic-metadata">

**Author:** [@Tri4ngel](https://discourse.cakephp.org/u/Tri4ngel)\
**Replies:** 7\
**Last updated:** [October 30, 2023, 10:12pm UTC](https://discourse.cakephp.org/t/i18n-nice-function-does-not-work-as-it-is-described-in-the-docs/11604 "2023-10-30T22:12:39Z")

</div>

Hello, i have a problem with formatting FrozenTime values. I want to use the following code snippet $startTime = $this-\>start-\>nice($timezoneString, $localeString); The start atrribute is from type FrozenTime. nice is…

---

## [Translate Behavior in Cakephp 5.x](https://discourse.cakephp.org/t/translate-behavior-in-cakephp-5-x/11530)

<div class="topic-metadata">

**Author:** [@harikt](https://discourse.cakephp.org/u/harikt)\
**Replies:** 2\
**Last updated:** [October 1, 2023, 4:04pm UTC](https://discourse.cakephp.org/t/translate-behavior-in-cakephp-5-x/11530 "2023-10-01T16:04:35Z")

</div>

Hi all, I have been experimenting with the cakephp Translate Behaviour. Reading the docs, I liked the concept, but trying out I felt some discomforts. So I would like to share so that it can be improved. The current vi…

---

## [Displayed datetime format doesn't match with the APP\_DEFAULT\_LOCALE](https://discourse.cakephp.org/t/displayed-datetime-format-doesnt-match-with-the-app-default-locale/11246)

<div class="topic-metadata">

**Author:** [@webdeveloper](https://discourse.cakephp.org/u/webdeveloper)\
**Replies:** 2\
**Last updated:** [June 1, 2023, 2:28pm UTC](https://discourse.cakephp.org/t/displayed-datetime-format-doesnt-match-with-the-app-default-locale/11246 "2023-06-01T14:28:20Z")

</div>

I am using CakePHP 4.4.14. The APP\_DEFAULT\_LOCALE is set to en\_CA and APP\_DEFAULT\_TIMEZONE is America/Toronto. Though the datetime displayed on my website is in the en\_US format. i.e., 3/15/12, 3:19 p.m.. How can I chang…

---

## [Strtotime function returns false when passing a FrozenTime object](https://discourse.cakephp.org/t/strtotime-function-returns-false-when-passing-a-frozentime-object/11242)

<div class="topic-metadata">

**Author:** [@webdeveloper](https://discourse.cakephp.org/u/webdeveloper)\
**Replies:** 7\
**Last updated:** [May 30, 2023, 5:02pm UTC](https://discourse.cakephp.org/t/strtotime-function-returns-false-when-passing-a-frozentime-object/11242 "2023-05-30T17:02:51Z")

</div>

I am using CakePHP 4 and PHP 8. I get the correct result when I pass a FrozenTime object to strtotime function on a Windows server. but on a Linux server, I get False for the below code: print\_r(strtotime(new FrozenTime…

---

## [Help in completing multilingualism](https://discourse.cakephp.org/t/help-in-completing-multilingualism/10298)

<div class="topic-metadata">

**Author:** [@IvarsZ](https://discourse.cakephp.org/u/IvarsZ)\
**Replies:** 2\
**Last updated:** [April 12, 2022, 7:23pm UTC](https://discourse.cakephp.org/t/help-in-completing-multilingualism/10298 "2022-04-12T19:23:55Z")

</div>

Hello, we need a person who can complete the multilingualism on our website in Cake PHP. Part of the work has already been done, it remains to complete the structure of the database and a few more minor improvements. If …

---

## [CakePHP 4.x: Change defaultLocale but the date format not change](https://discourse.cakephp.org/t/cakephp-4-x-change-defaultlocale-but-the-date-format-not-change/10225)

<div class="topic-metadata">

**Author:** [@tonynguyen](https://discourse.cakephp.org/u/tonynguyen)\
**Replies:** 5\
**Last updated:** [March 16, 2022, 9:31pm UTC](https://discourse.cakephp.org/t/cakephp-4-x-change-defaultlocale-but-the-date-format-not-change/10225 "2022-03-16T21:31:12Z")

</div>

Hi everyone, I would like to change the date format in in form from mm/dd/yyyy to dd/mm/yyyy. I changed my defaultLocate from en\_US to vi\_VN in app.php (i read the document in link: Internationalization & Localization -…

---

## [Translating variables](https://discourse.cakephp.org/t/translating-variables/10182)

<div class="topic-metadata">

**Author:** [@Mentis](https://discourse.cakephp.org/u/Mentis)\
**Replies:** 1\
**Last updated:** [February 23, 2022, 11:52pm UTC](https://discourse.cakephp.org/t/translating-variables/10182 "2022-02-23T23:52:01Z")

</div>

I have a Report entity that contains a field named priority with integer as the type. This integer maps to different priorities based on the priority value. These are represented through a class array constant inside the…

---

## [How to manage routes with Internationalization in CakePHP?](https://discourse.cakephp.org/t/how-to-manage-routes-with-internationalization-in-cakephp/10034)

<div class="topic-metadata">

**Author:** [@20cents](https://discourse.cakephp.org/u/20cents)\
**Replies:** 0\
**Last updated:** [December 28, 2021, 9:11am UTC](https://discourse.cakephp.org/t/how-to-manage-routes-with-internationalization-in-cakephp/10034 "2021-12-28T09:11:28Z")

</div>

My website will manage two languages, French (default language) and Dutch. For the default language (French), I don’t need to show the language parameter in the URL, so I only want to display it for Dutch (eg. myapp.com/…

---

## [TranslatorRegistry Cake 3](https://discourse.cakephp.org/t/translatorregistry-cake-3/9998)

<div class="topic-metadata">

**Author:** [@Hiep](https://discourse.cakephp.org/u/Hiep)\
**Replies:** 0\
**Last updated:** [December 16, 2021, 8:56am UTC](https://discourse.cakephp.org/t/translatorregistry-cake-3/9998 "2021-12-16T08:56:49Z")

</div>

Follow document Cake\\I18n\\TranslatorRegistry at method get() The return value is object (Aura\\Intl\\TranslatorInterface) In my local it working as well, but in staging some time it working well and some time it got e…

---

## [CakePHP v4.2 - Language Issue - again, displaying different static text translation than language locale set](https://discourse.cakephp.org/t/cakephp-v4-2-language-issue-again-displaying-different-static-text-translation-than-language-locale-set/9924)

<div class="topic-metadata">

**Author:** [@MarekDM](https://discourse.cakephp.org/u/MarekDM)\
**Replies:** 6\
**Last updated:** [November 25, 2021, 8:55am UTC](https://discourse.cakephp.org/t/cakephp-v4-2-language-issue-again-displaying-different-static-text-translation-than-language-locale-set/9924 "2021-11-25T08:55:08Z")

</div>

Hello I have project which based on user that logged in has option to put content in one or more languages and have different default language. What I want to do is to be able to switch which static text translations …

---

## [Translate behavior behaves unexpectedly](https://discourse.cakephp.org/t/translate-behavior-behaves-unexpectedly/9620)

<div class="topic-metadata">

**Author:** [@Tobse](https://discourse.cakephp.org/u/Tobse)\
**Replies:** 0\
**Last updated:** [August 12, 2021, 3:53am UTC](https://discourse.cakephp.org/t/translate-behavior-behaves-unexpectedly/9620 "2021-08-12T03:53:16Z")

</div>

Hi all, I am having a problem with translation-behavior on CakePHP 3.10. My view: \<?php echo $this-\>Form-\>control('name'); echo $this-\>Form-\>control('\_translations.en.name')\]); ?\> If I add a new entity, the “name”…

---

## [Unable to run query based on value of translated field - need help please](https://discourse.cakephp.org/t/unable-to-run-query-based-on-value-of-translated-field-need-help-please/9563)

<div class="topic-metadata">

**Author:** [@mds2018](https://discourse.cakephp.org/u/mds2018)\
**Replies:** 2\
**Last updated:** [July 31, 2021, 11:59am UTC](https://discourse.cakephp.org/t/unable-to-run-query-based-on-value-of-translated-field-need-help-please/9563 "2021-07-31T11:59:34Z")

</div>

Hi guys, I have a UsersTable and a TagsTable associated via a BelongsToMany and it works fine - association is correct etc. The Tags table is using the Translate Behavior, it all works too. But, there is a but. When …

---

## [\[Solved\] Translate Configure messages](https://discourse.cakephp.org/t/solved-translate-configure-messages/9553)

<div class="topic-metadata">

**Author:** [@Il\_Milo](https://discourse.cakephp.org/u/Il_Milo)\
**Replies:** 5\
**Last updated:** [July 27, 2021, 10:37am UTC](https://discourse.cakephp.org/t/solved-translate-configure-messages/9553 "2021-07-27T10:37:27Z")

</div>

Hi everyone, There are a few aspects of i18n that I haven’t been able to understand. I was trying to figure out if it was possible to translate the strings defined in settings.php and loaded via Configure. Consider th…

---

## [CakePHP 4 - Admin prefix routing with i18n language parameter](https://discourse.cakephp.org/t/cakephp-4-admin-prefix-routing-with-i18n-language-parameter/9431)

<div class="topic-metadata">

**Author:** [@alamnaryab](https://discourse.cakephp.org/u/alamnaryab)\
**Replies:** 3\
**Last updated:** [June 14, 2021, 5:59am UTC](https://discourse.cakephp.org/t/cakephp-4-admin-prefix-routing-with-i18n-language-parameter/9431 "2021-06-14T05:59:15Z")

</div>

I have cakephp4 project implemented i18n internationalization, it is working with session. but I want the language parameter in URL as below mydomain/en/controllers/action mydomain/ar/controllers/action and also for…

---

## [FronzenTime Example Not Working](https://discourse.cakephp.org/t/fronzentime-example-not-working/9415)

<div class="topic-metadata">

**Author:** [@yousuo](https://discourse.cakephp.org/u/yousuo)\
**Replies:** 3\
**Last updated:** [June 6, 2021, 2:18pm UTC](https://discourse.cakephp.org/t/fronzentime-example-not-working/9415 "2021-06-06T14:18:29Z")

</div>

hi, I was messing around with FrozenTime, and notice this. Referring to cake 4 time-docs In Manipulation, it gives an example of FrozenTime. The example doesn’t work. Only setDate works. Am I missing something ? $now…

---

## [Best approach when dealing with custom translation per installation](https://discourse.cakephp.org/t/best-approach-when-dealing-with-custom-translation-per-installation/9198)

<div class="topic-metadata">

**Author:** [@Hache\_raw](https://discourse.cakephp.org/u/Hache_raw)\
**Replies:** 0\
**Last updated:** [April 1, 2021, 10:05pm UTC](https://discourse.cakephp.org/t/best-approach-when-dealing-with-custom-translation-per-installation/9198 "2021-04-01T22:05:11Z")

</div>

Hello. I’m building an App and I use i18n extract shell. All is working fine but I need to do something and do not know what would be the best approach. Imagine having 3 named columns. The usual approach is to hardcod…

---

## [Complex language/translations issues](https://discourse.cakephp.org/t/complex-language-translations-issues/9108)

<div class="topic-metadata">

**Author:** [@MarekDM](https://discourse.cakephp.org/u/MarekDM)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 8:57am UTC](https://discourse.cakephp.org/t/complex-language-translations-issues/9108 "2021-03-11T08:57:43Z")

</div>

Hello Here’s my problem. I have website, where are users connected to accounts. Each account can have 1-3 languages, and their users can use as default language offered by the account. So here’s what I want to achieve …

---

## [Localization of Blog plugin urls with admad/cakephp-i18n](https://discourse.cakephp.org/t/localization-of-blog-plugin-urls-with-admad-cakephp-i18n/8333)

<div class="topic-metadata">

**Author:** [@maleointeractive](https://discourse.cakephp.org/u/maleointeractive)\
**Replies:** 2\
**Last updated:** [September 7, 2020, 12:08pm UTC](https://discourse.cakephp.org/t/localization-of-blog-plugin-urls-with-admad-cakephp-i18n/8333 "2020-09-07T12:08:44Z")

</div>

Hi, I working on a website wich use the admad/cakephp-i18n for translations, no problem with the regular controllers but impossible to get localized urls for a “Blog” plugin. I’m not the creator of this website, I just …

---

## [Translations with YAML instead of PO/MO?](https://discourse.cakephp.org/t/translations-with-yaml-instead-of-po-mo/7084)

<div class="topic-metadata">

**Author:** [@mario](https://discourse.cakephp.org/u/mario)\
**Replies:** 0\
**Last updated:** [January 9, 2020, 8:20am UTC](https://discourse.cakephp.org/t/translations-with-yaml-instead-of-po-mo/7084 "2020-01-09T08:20:04Z")

</div>

Has anyone experience with changing the po/mo translations to more readable and easier to modify .yaml files? The documentation provides an example of parsing existing yaml files (https://book.cakephp.org/4/en/core-libr…

---

## [Change the default i18n date formats](https://discourse.cakephp.org/t/change-the-default-i18n-date-formats/6083)

<div class="topic-metadata">

**Author:** [@efanzini](https://discourse.cakephp.org/u/efanzini)\
**Replies:** 7\
**Last updated:** [May 17, 2019, 12:29pm UTC](https://discourse.cakephp.org/t/change-the-default-i18n-date-formats/6083 "2019-05-17T12:29:56Z")

</div>

Hi all. I need to change the default date formats for italian, french and german languages. Is there any way to set it in bootstrap.php / application.php? I wish to avoid dozens of “ifs” in my templates. I’m on Cake …

---

## [Translating database seeds](https://discourse.cakephp.org/t/translating-database-seeds/5679)

<div class="topic-metadata">

**Author:** [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Replies:** 0\
**Last updated:** [February 19, 2019, 5:31pm UTC](https://discourse.cakephp.org/t/translating-database-seeds/5679 "2019-02-19T17:31:58Z")

</div>

I’m working on translating my application, and am wondering what the best practice might be for initializing the database. There are a few tables, for example user groups, which have pre-defined values added by a seed du…

---

## [User locale in command](https://discourse.cakephp.org/t/user-locale-in-command/5211)

<div class="topic-metadata">

**Author:** [@okelet](https://discourse.cakephp.org/u/okelet)\
**Replies:** 1\
**Last updated:** [November 6, 2018, 11:53am UTC](https://discourse.cakephp.org/t/user-locale-in-command/5211 "2018-11-06T11:53:54Z")

</div>

I have created a command that generates some reports periodically and sends them to users. I want to send the mails, from the command, in the user locale (is a user column in DB). How can I set the user locale in a comma…

---

## [Extract validation messages](https://discourse.cakephp.org/t/extract-validation-messages/5166)

<div class="topic-metadata">

**Author:** [@alvaro](https://discourse.cakephp.org/u/alvaro)\
**Replies:** 0\
**Last updated:** [October 26, 2018, 8:59am UTC](https://discourse.cakephp.org/t/extract-validation-messages/5166 "2018-10-26T08:59:36Z")

</div>

Docs for Internationalization & Localization in CakePHP/2.x clearly state that strings in 'message' keys should get extracted by cake i18n extract in the default domain but it isn’t my case. I’ve confirmed that they’re …

---

## [I18n store values in source table and i18n table](https://discourse.cakephp.org/t/i18n-store-values-in-source-table-and-i18n-table/5029)

<div class="topic-metadata">

**Author:** [@marvin.felder](https://discourse.cakephp.org/u/marvin.felder)\
**Replies:** 6\
**Last updated:** [October 16, 2018, 5:57am UTC](https://discourse.cakephp.org/t/i18n-store-values-in-source-table-and-i18n-table/5029 "2018-10-16T05:57:24Z")

</div>

Hey there We have a table called AppointmentServices were services are stored with name and description. Now we try to make these services multilingual. This works fine with i18n behavior (TranslateBehavior). After imp…

---

## [Formatting Date time in view in CakePHP 3](https://discourse.cakephp.org/t/formatting-date-time-in-view-in-cakephp-3/2630)

<div class="topic-metadata">

**Author:** [@anuj9196](https://discourse.cakephp.org/u/anuj9196)\
**Replies:** 3\
**Last updated:** [September 13, 2018, 9:37pm UTC](https://discourse.cakephp.org/t/formatting-date-time-in-view-in-cakephp-3/2630 "2018-09-13T21:37:25Z")

</div>

I'm using CakePHP 3.4. I have set my database timezone to UTC. I am from IST Timezone. To display DateTime in IST Timezone, this is what I'm doing. \<?= $this-\>Time-\>format($user-\>created, \\IntlDateFormatter::FULL, …

[Next page](https://discourse.cakephp.org/tag/i18n/5.md?match_all_tags=true&page=1&tags%5B%5D=i18n)
