# Initial locale setting now available

**URL:** https://meta.discourse.org/t/initial-locale-setting-now-available/25034
**Category:** Feature
**Tags:** translation
**Created:** [9 februari 2015 om 19:26 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034 "2015-02-09T19:26:56Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [9 februari 2015 om 19:26 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/1 "2015-02-09T19:26:56Z")

</div>

In a sentence: **New Docker installs will now have the option to set the language at bootstrap time**.

This has been a pain point for a while: the FAQ, Terms of Service, and Privacy policy would get set up with the wrong language. See this topic from July of last year:

[https://meta.discourse.org/t/new-non-english-installs/18077](https://meta.discourse.org/t/new-non-english-installs/18077)

Here’s one of the support topics that came up: [https://meta.discourse.org/t/setting-lang-ru-ru-utf-8-in-app-yml-does-not-work-when-bootstrapping-docker-container/22726](https://meta.discourse.org/t/setting-lang-ru-ru-utf-8-in-app-yml-does-not-work-when-bootstrapping-docker-container/22726)

* * *

You can do this by setting the `DISCOURSE_DEFAULT_LOCALE` environment variable in `app.yml`. **Note that this will make it impossible to change the locale from the web UI.**

Here’s an example of an `app.yml` with language settings set.

```yml
params:
  db_default_text_search_config: "pg_catalog.french"
  ## Set db_shared_buffers to 1/3 of the memory you wish to allocate to postgres
  ## on 1GB install set to 128MB on a 4GB instance you may raise to 1GB
  #db_shared_buffers: "256MB"
  #
  ## Which Git revision should this container use? (default: tests-passed)
  # version: tests-passed
 env:
  LANG: fr_FR.UTF-8
  DISCOURSE_DEFAULT_LOCALE: fr

```

This will be available in latest right now, beta **v1.2.0.beta7** , stable **v1.2.0**.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9 februari 2015 om 23:53 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/2 "2015-02-09T23:53:59Z")

</div>

What happens if you change the locale in `app.yml` and rebuild the container?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [10 februari 2015 om 00:32 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/3 "2015-02-10T00:32:12Z")

</div>

It should be the same as if you changed the site setting and rebuilt it - i.e. it _should_ only matter for the first run.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [10 februari 2015 om 00:33 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/4 "2015-02-10T00:33:35Z")

</div>

So once language is set this way, it can never be changed, ever? Not without destroying the whole site? Even recreating from backup would recreate the old language topics yes?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [10 februari 2015 om 01:01 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/5 "2015-02-10T01:01:30Z")

</div>

I.. think so, because stuff like the Lounge and the FAQ topics are not re-created when you rebuild.

I think I’ll test it…

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [13 februari 2015 om 16:15 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/6 "2015-02-13T16:15:03Z")

</div>

We prefer global setting to site setting in `app/model/global_setting.rb`. Am I right here? @riking

We seed the db based on locale only at the first time. The next seed won’t create or update seed topics. But if you recreate from backup, the topic won’t change because it’s already seeded.

Default categories name doesn’t respect the locale setting. `db:migrate` migrates the db before invoking the block so `I18n.t` takes no effect when creating the categories. @neil

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [13 februari 2015 om 20:21 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/7 "2015-02-13T20:21:15Z")

</div>

> [@fantasticfears](#):
>
> We prefer global setting to site setting in app/model/global\_setting.rb. Am I right here? @riking

Yes, this environment variable sets a GlobalSetting.

---

<div class="post-metadata">

### Author: ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)
#### Post date: [19 maart 2015 om 17:54 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/8 "2015-03-19T17:54:49Z")

</div>

This is also done by the latest pr.

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [4 december 2025 om 11:33 UTC](https://meta.discourse.org/t/initial-locale-setting-now-available/25034/9 "2025-12-04T11:33:32Z")

</div>


