Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(cakephp): do not override APP_DEFAULT_LOCALE#7653

Merged
rfay merged 1 commit intoddev:mainfrom
tyler36:20250924-env-APP_DEFAULT_LOCALE
Sep 25, 2025
Merged

fix(cakephp): do not override APP_DEFAULT_LOCALE#7653
rfay merged 1 commit intoddev:mainfrom
tyler36:20250924-env-APP_DEFAULT_LOCALE

Conversation

@tyler36
Copy link
Collaborator

@tyler36 tyler36 commented Sep 24, 2025

The Issue

Today, I cloned an internal CakePHP4 project.
It appeared to work but some translation strings were not displaying correctly.

DDEV generated a config/.env based on config/.env.example.
DDEV (correctly) overrode DATABASE_URL & EMAIL_TRANSPORT_DEFAULT_URL to point to itself.
However, it overrides APP_DEFAULT_LOCALE to en_US which resulted in CakePHP looking for English translation instead of using the Japanese.

Since DDEV does NOT override APP_DEFAULT_TIMEZONE, this feels like unexpected.

How This PR Solves The Issue

The PR does not explicitly set APP_DEFAULT_LOCALE, thus falling back to config/.env.example settings.

Tested on CakePHP4 & CakePHP5

Manual Testing Instructions

  1. Check DDEV version
ddev -v
ddev version v1.24.7
  1. Create a new CakePHP project following current quickstart guide.
mkdir my-cakephp-site && cd my-cakephp-site
ddev config --project-type=cakephp --docroot=webroot
ddev start
ddev composer create-project --prefer-dist --no-interaction cakephp/app:~5.0
  1. Check config/.env
$ cat config/.env | \grep --color=auto APP_DEFAULT
export APP_DEFAULT_LOCALE="en_US"
export APP_DEFAULT_TIMEZONE="UTC"
  1. Remove config/.env
rm config/.env
  1. Manually update config/.env.example which might normally be configured in a existing project.
export APP_DEFAULT_LOCALE="ja_JP"
export APP_DEFAULT_TIMEZONE="Asia/Tokyo"
  1. Restart DDEV to regenerate config/.env
ddev restart
  1. Check config/.env contains expected values set above.
$ cat config/.env | \grep --color=auto APP_DEFAULT
export APP_DEFAULT_LOCALE="ja_JP"
export APP_DEFAULT_TIMEZONE="Asia/Tokyo"

Automated Testing Overview

Release/Deployment Notes

@tyler36 tyler36 requested a review from a team as a code owner September 24, 2025 08:06
@stasadev stasadev changed the title fix: do not override APP_DEFAULT_LOCALE for CakePHP fix(cakephp): do not override APP_DEFAULT_LOCALE Sep 25, 2025
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it with CakePHP 5, looks good to me.

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rfay rfay merged commit bd427af into ddev:main Sep 25, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments