# Best way to make configuration persistent

**URL:** <https://community.zammad.org/t/best-way-to-make-configuration-persistent/532>\
**Category:** Technical assistance\
**Created:** [April 11, 2018, 12:16pm UTC](https://community.zammad.org/t/best-way-to-make-configuration-persistent/532 "2018-04-11T12:16:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwb](https://community.zammad.org/user_avatar/community.zammad.org/mwb/32/143_2.png) [@mwb](https://community.zammad.org/u/mwb)\
**Post date:** [April 11, 2018, 12:16pm UTC](https://community.zammad.org/t/best-way-to-make-configuration-persistent/532/1 "2018-04-11T12:16:22Z")

</div>

### Setup:

- Used Zammad version: 2.4
- Used Zammad installation source: deb package
- Operating system: Ubuntu 16.04

### Problem description:

My browser is set to prefer the Dutch locale. It sends `Accept-Language: nl-NL,nl;q=0.9,en-NL;q=0.8,en;q=0.7,en-US;q=0.6,de;q=0.5`

I don’t like the Dutch translation of Zammad, and it’s incomplete. Of course I can also opt to choose to complete the translation but at this point I’d just like to use the English locale and the English locale only.  
@martini taught me this trick to delete all locales but the English one:

```
zammad run rails r "Locale.where.not(locale: 'en-us').delete_all"

```

### Expected behavior:

- If I run the command above, all locales except `en_us` should be deleted and I will only ever see this locale.

### Actual behavior:

- This works somewhat, because if I do this and then log in to the Web UI, I see the UI is in English. But transactional email still is in Dutch. And when I come back a couple of days later, all locales are back again and I have to run the rails command above again to make sure my changes are persistent. I understand the problem is probably just me misunderstanding Zammad and/or Rails; what is the best way to make this change persistent?

### Steps to reproduce the behavior:

- Run Rails command. Go to web UI. Wait a couple of days, the other locales are back. ☹

---

<div class="post-metadata">

**Author:** ![martini](https://community.zammad.org/user_avatar/community.zammad.org/martini/32/43_2.png) [@martini](https://community.zammad.org/u/martini)\
**Post date:** [April 11, 2018, 12:42pm UTC](https://community.zammad.org/t/best-way-to-make-configuration-persistent/532/2 "2018-04-11T12:42:22Z")

</div>

Hi @mwb

thanks for this topic. Now I can understand what you mean.

1. Re-creation of locals  
On every Zammad update a sync of all locals an translations is done. So in your case you need to execute `zammad run rails r "Locale.where.not(locale: 'en-us').delete_all"` after every Zammad update (sorry - I never had his use case in mind).

2. Localiced emails  
After every Zammad update you need to remove all localised email templates under `app/views/*/*/*.erb`. Just remove all but not with `/en.*`

Greetings,

-Martin

---

<div class="post-metadata">

**Author:** ![mwb](https://community.zammad.org/user_avatar/community.zammad.org/mwb/32/143_2.png) [@mwb](https://community.zammad.org/u/mwb)\
**Post date:** [April 11, 2018, 1:21pm UTC](https://community.zammad.org/t/best-way-to-make-configuration-persistent/532/3 "2018-04-11T13:21:51Z")

</div>

Is there a hook or event ‘after-update’ or ‘after-server-start’ or something like that were I can hook scripts in which run after installation or after starting the rails server?

---

<div class="post-metadata">

**Author:** ![mwb](https://community.zammad.org/user_avatar/community.zammad.org/mwb/32/143_2.png) [@mwb](https://community.zammad.org/u/mwb)\
**Post date:** [April 11, 2018, 1:25pm UTC](https://community.zammad.org/t/best-way-to-make-configuration-persistent/532/4 "2018-04-11T13:25:18Z")

</div>

And also, I understand you might not want to have something like a sysconfig with 1000s of settings in Zammad. And I think it’s very nice to have a system that more or less does the right thing without configuring it to no end. But would you think it’s reasonable to add a configuration setting to Zammad where the admin can limit available locales for the frontends? Would you be open to such a PR?

For OTRS, I’ve oftentimes configured the sysconfig for customers to only make Dutch available, or only German, or English + German, but not all 30+ languages, to make the experience smooth for users. I think a feature like this would be helpful.

---

<div class="post-metadata">

**Author:** ![mwb](https://community.zammad.org/user_avatar/community.zammad.org/mwb/32/143_2.png) [@mwb](https://community.zammad.org/u/mwb)\
**Post date:** [April 16, 2018, 1:50pm UTC](https://community.zammad.org/t/best-way-to-make-configuration-persistent/532/5 "2018-04-16T13:50:09Z")

</div>

Ping! Can anyone provide feedback?

---

<div class="post-metadata">

**Author:** ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)\
**Post date:** [June 15, 2018, 1:51pm UTC](https://community.zammad.org/t/best-way-to-make-configuration-persistent/532/6 "2018-06-15T13:51:20Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
