# Bug OP-14269 - Untranslated work package roles

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-14269

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 13.3.0 |
| Observed in versions | 13.2.0 |
| Sprint | 13.3.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 13.2.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Install OpenProject using the packager installation with a default language other than English and well supported (German, French or Spanish for instance)
2.  Ensure you are using the Enterprise edition (Work package roles are hidden if running the Community edition)
3.  Go to Administration \> Work packages \> Workflows
4.  Click the "Role" drop down

### What is the buggy behavior?

  - The work package role is not translated: it is "Work package editor" as in English
  - The same happens if visiting the "Summary" page by clicking the "Summary" button on the top right corner. The 3 work package roles in the table header are not translated.

### What is the expected behavior?

1.  Work package role names should be translated
    1.  For instance in French "Work package editor" should be ["Éditeur de lot de travaux"](https://crowdin.com/editor/openproject/11547/en-fr?view=comfortable&filter=basic&value=0#1111008)

### Analysis

The work package roles can be created by either the `AddShareWorkpackagesPermission` migration or the `BasicData::WorkPackageRoleSeeder` seeder. The migration was useful to fix some permissions in the early stages of work package sharing, and create the work package roles for system having already run the seeding a long time ago (upgrade)...

When running the installer, the migrations are run first, then the seeding. When the migration are run, there is no information about the selected language yet, so the default language English is used. 

When the seeding then runs, the language gets configured, but the work package roles are not created as they already exist. So they remain in English.

Possibilities to fix:

  - Skip creating the work package roles in migration if the seeding has not been run yet
  - Make the migration aware of the selected language

To recreate the issue on dev env:

``` shell
export OPENPROJECT_DEFAULT_LANGUAGE=fr
bundle exec rails db:drop db:create db:migrate
bundle exec rails db:seed
```

### **Logs**

Installation logs:

``` text
[...]

*** Seeding for locale: 'fr'
*** Seeding basic data for standard edition
 ↳ BuiltinUsersSeeder
 ↳ ProjectRoleSeeder
 ↳ WorkPackageRoleSeeder
   *** Skipping work package roles as there are already some configured
 ↳ GlobalRoleSeeder
 ↳ TimeEntryActivitySeeder
 ↳ ColorSeeder
 ↳ ColorSchemeSeeder
[...]
```

### Screenshots and other files

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/91085/content">

### Environment information

*Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs*

**OpenProject installation type**

- [ ] Hosted cloud edition
- [x] Packaged installation
    - What distribution? Any
- [ ] Docker All-in-one container
- [ ] Docker-compose installation
- [ ] Other (please specify)

**OpenProject version**

*13.2*

**Browser**

- [ ] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Language**

*non-English*
