Page MenuHomePhabricator

Read user's locale on provision and install it
Open, MediumPublic


For computers that aren't in the en_US locale, a vaguely annoying message appears when one vagrant sshes:

$ vagrant ssh
Last login: Sun May 24 16:18:57 2015 from
-bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)

It would be nice if, during the initial provision, we detected and installed the host's locale (e.g. sudo locale-gen de_DE.UTF-8) and got rid of that warning.
I guess one could just force the locale to be en_US, but that's the boring solution.

Event Timeline

MC8 created this task.May 24 2015, 4:42 PM
MC8 raised the priority of this task from to Needs Triage.
MC8 updated the task description. (Show Details)
MC8 added a project: MediaWiki-Vagrant.
MC8 added a subscriber: MC8.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 24 2015, 4:42 PM
bd808 triaged this task as Medium priority.Oct 14 2015, 5:28 PM

The default VM image that we use for VirtualBox guests has a pretty boring set of configured locales:

$ locale -a

We could probably attempt to get the host's locale by reading from the environment and adding it as a factor fact in our Vagrantfile. If LC_ALL wasn't present in the execution environment then we could pass en_US.UTF-8 as the default. The associated Puppet code could then check for the specified locale in locale -a output and try to install/configure it if missing. This would probably require us to figure out which language-pack-* package is needed to provide the locale.