Set Locale In DDEV

Locale is an OS language setting.

I encountered warnings when running drush sql-sync.

> > perl: warning: Setting locale failed.
> > perl: warning: Please check that your locale settings:
> > 	LANGUAGE = (unset),
> > 	LC_ALL = (unset),
> > 	LANG = "C.UTF-8"
> >     are supported and installed on your system.
> > perl: warning: Falling back to the standard locale ("C").
 [notice] Starting to import dump file onto target database.

DDEV uses Debian: https://wiki.debian.org/Locale

The instructions there don't work out of the box though.

sudo dpkg-reconfigure locales does not work because locales is not yet installed.

This can be fixed with sudo apt install locales.

But all you really need to do is set these environment variables in .ddev/config.yaml:

web_environment:
  - LANG=en_US.UTF-8
  - LC_ALL=en_US.UTF-8
Tags