apostrophecms / apostrophecms/apostrophe

Admin UI localization not working correctly for locales with country suffix

Open
#3,993 0 comments 0 reactions 1 assignee Claimed by @lindsayhi View on GitHub
bug
Dominant language
JavaScript
Stars
4.6k
Forks
650
Avg merge
19h 21m
Merged PRs (30d)
23

Description

## To Reproduce

1a. **Without Assembly** create a localization with
```js
// sites/modules/@apostrophecms/i18n/index.js
module.exports = {
options: {
locales: {
en: {
label: "English",
// The default locale since there is no prefix requirement.
},
"de-de": {
label: "German",
prefix: "/de-de",
},
de: {
label: "German",
prefix: "/de",
},
},
},
};
```

1b. **With Assembly** simply create the two "German" locales via the UI.

2. Now simply log into your apostrophe site to see the admin UI. You should see the german version for "de" but for "de-de" it seems to be English, even though the localization for the template content is working fine.

## Expected behavior
German version of the admin UI for "de" and for "de-de"

## Describe the bug
It seems that the admin UI is translated differently than the template content. That leads to the bug, that only "de" has a german admin UI and "de-de" is English.

## Details

**Version of Node.js:**
14.18.0

**Server Operating System:**
MacOS X

**Screenshots**
7a7117359d6fa74dfe86e789facfcf2e036500bb3a39275ea8042eeebb86922e

a74de784f09c47c4fb3d9b1e60ab40401cf26e660a84822c5d5b27fecfb889fb

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.