# Export customized text from database into YML

**URL:** https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760
**Category:** Translations
**Created:** [December 4, 2016, 3:07am UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760 "2016-12-04T03:07:07Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![ibnesayeed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ibnesayeed/32/120427_2.png) [@ibnesayeed](https://meta.discourse.org/u/ibnesayeed)
#### Post date: [December 4, 2016, 3:07am UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/1 "2016-12-04T03:07:07Z")

</div>

Admin interface allows overwriting any stranslations which is very healful not just for utilizing community translation while updating them with custom phrases that suit a specific community, but at the same time it is also a very good way to gradually translate a new language, without the need of updating the code, hence rebuilding the cache. However, it would be great if the customized translations can be exported from the database and somehoe merged back into the corresponding YAML files to make it available in the main repository. Is there a way of doing that which I am not aware of?

> [@Customize text in Discourse](https://meta.discourse.org/t/customize-all-text-in-discourse/36092):
>
> bookmark This is a guide for customizing text in Discourse via the admin interface, enabling changes to various UI elements. person_raising_hand Required user level: Administrator In Discourse, you can customize all of the text via the admin interface. This can be useful for tailoring the user experience to better fit the particular tone or branding of your community. Summary This guide will cover: Accessing the text customization interface Editing text strings Identifying translatio…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 5, 2016, 5:43am UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/2 "2016-12-05T05:43:30Z")

</div>

I don’t think there is a job for this but 100% support these two tasks, which could help you out here

```plaintext
rake export:locale_overrides:server > server.xx.yml
rake export:locale_overrides:client > client.xx.yml

```

---

<div class="post-metadata">

### Author: ![frank.manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank.manuel/32/203348_2.png) [@frank.manuel](https://meta.discourse.org/u/frank.manuel)
#### Post date: [March 27, 2022, 9:36pm UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/3 "2022-03-27T21:36:14Z")

</div>

Does anyone know if anyone’s made this yet?

---

<div class="post-metadata">

### Author: ![attalbialami](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@attalbialami](https://meta.discourse.org/u/attalbialami)
#### Post date: [September 22, 2022, 1:36pm UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/4 "2022-09-22T13:36:41Z")

</div>

@sam I have run the task to export locals but it doesn’t work  
I have the message below

```plaintext
Don't know how to build task 'export:locale_overrides:server' (See the list of available tasks with `rake --tasks`)

```

Any idea ?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [September 23, 2022, 3:39am UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/5 "2022-09-23T03:39:30Z")

</div>

Nobody made the task yet, going to add a #pr-welcome for clarity

---

<div class="post-metadata">

### Author: ![mqmenchaca](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mqmenchaca](https://meta.discourse.org/u/mqmenchaca)
#### Post date: [October 5, 2022, 8:41pm UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/6 "2022-10-05T20:41:35Z")

</div>

This is something I’ve been thinking about as well, and have created a PR:

[https://github.com/discourse/discourse/pull/18489](https://github.com/discourse/discourse/pull/18489)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [October 6, 2022, 5:46pm UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/7 "2022-10-06T17:46:26Z")

</div>

To close the loop here, @mqmenchaca and myself worked on this at the same time without knowledge of the other working on it. And came up with PRs just a few hours apart! I had already merged my PR to core just before seeing Max’s, so sadly we can’t merge his work in core. Very much appreciate the contribution nonetheless, @mqmenchaca!

The commit that adds this feature is this one: [DEV: Add a rake task to export/import translation overrides (#18487) · discourse/discourse@4d80110 · GitHub](https://github.com/discourse/discourse/commit/4d8011032ef21b8707ff3d3313a3420e1f0bc2f9)

To export, run `bin/rake export:translation_overrides` (it will create a JSON file with the overrides).

To import in a separate instance, copy the exported JSON file there and run `bin/rake import:file["filename"]`.

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [May 20, 2023, 10:35am UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/8 "2023-05-20T10:35:10Z")

</div>

Hi there. Please, can you describe the steps to run it?

```plaintext
./launcher enter app
bin/rake export:translation_overrides

```

Returns:

```plaintext
rake aborted!
ActiveRecord::NoDatabaseError: We could not find your database: discourse. Which can be found in the database configuration file located at config/database.yml

```

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [May 24, 2023, 1:49pm UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/9 "2023-05-24T13:49:12Z")

</div>

That seems to be an issue with your environment. When I enter the container in my own self-hosted instance, I can run rake commands just fine.

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [May 24, 2023, 9:25pm UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/10 "2023-05-24T21:25:13Z")

</div>

> [@satonotdead](#):
>
> `bin/rake export:translation_overrides`

I’m using Discourse behind Nginx, that could be related? It’s possible to use the command using a database outside the container?

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [June 13, 2023, 8:52pm UTC](https://meta.discourse.org/t/export-customized-text-from-database-into-yml/53760/11 "2023-06-13T20:52:08Z")

</div>

> _OK, I was doing some tests and I have the file exported._

If I modify that file changing `es_XX` to `es` (and not more else, taking care about the format and character encoding of the file) and importing the previous exported file, it should works?

I want to move previous overrides to default `es` language on our instance 🙂
