# Massaal wijzigen van configuratie via CLI in meerdere gebruikersprofielen/voorkeuren

**URL:** https://meta.discourse.org/t/bulk-change-of-configuration-via-cli-in-multiple-user-profiles-preferences/162947
**Category:** Support
**Created:** [3 september 2020 om 17:52 UTC](https://meta.discourse.org/t/bulk-change-of-configuration-via-cli-in-multiple-user-profiles-preferences/162947 "2020-09-03T17:52:58Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [4 september 2020 om 00:19 UTC](https://meta.discourse.org/t/bulk-change-of-configuration-via-cli-in-multiple-user-profiles-preferences/162947/2 "2020-09-04T00:19:32Z")

</div>

> [@rudy](#):
>
> Could you please tell me would it be possible to enter Discourse ( `./launcher enter app` ) and loop through list of user names / IDs (anything) and change language in specified user profiles?

Yes, this can be done from the rails console. To get to the rails console, run `./launcher enter app`, then enter `rails c` at the prompt to launch the rails console.

I’d be careful about looping through all users until you’re certain what’s going to happen. Here’s how I tested it for an individual user on my site:

First, get a list of the locales that are used by Discourse:

```plaintext
I18n.available_locales

```

That will print out a long list of symbols that Discourse uses for locales. For example ` :be, :bg, :bs_BA, :ca...`

You can use these symbols to set the locale. For example, to update a user’s locale to French:

```plaintext
u = User.find(1)
u.update(locale: :fr)

```

If you want to loop through the users, you’ll need to figure out how to get arrays of users for each locale so that you can loop through them. If you have lists of usernames for each locale, that could be used to find the users. The simple way to do that from the console is to convert a list of usernames to an array. For example:

```plaintext
fr_users = ['bob', 'sally', 'john']

fr_users.each do |username|
    u = User.find_by(username: username)
    u.update(locale: :fr)
end

```

If you try this, proceed carefully. Make sure to create a backup of your site’s database before making the changes.

---

_[View the full topic](https://meta.discourse.org/t/bulk-change-of-configuration-via-cli-in-multiple-user-profiles-preferences/162947)._
