Skip to content

Commit 0f8bf9a

Browse files
fix: name UI translation files by BCP-47 lang tag (#746)
1 parent 5cca087 commit 0f8bf9a

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

src/content/crowdin.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ files:
3333
- source: /i18n/en.json
3434
translation: /i18n/%locale%.json
3535
languages_mapping:
36-
locale: *locale_mapping
36+
# Starlight keys UI translations by each locale's BCP-47 `lang` tag
37+
locale:
38+
de: de
39+
da: da
40+
fr: fr
41+
pt-PT: pt-PT
42+
es-ES: es-ES
43+
tr: tr-TR
3744

3845
- source: /includes/*.mdx
3946
translation: /includes/%locale%/%original_file_name%

src/utils/i18n.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import en from '../content/i18n/en.json';
22
import de from '../content/i18n/de.json';
33
import da from '../content/i18n/da.json';
44
import fr from '../content/i18n/fr.json';
5-
import pt from '../content/i18n/pt.json';
6-
import es from '../content/i18n/es.json';
7-
import tr from '../content/i18n/tr.json';
5+
import pt from '../content/i18n/pt-PT.json';
6+
import es from '../content/i18n/es-ES.json';
7+
import tr from '../content/i18n/tr-TR.json';
88

99
export const starlightLocales = {
1010
root: { label: 'English', lang: 'en' },
@@ -25,9 +25,9 @@ export function sidebarLabel(key: SidebarTranslationKey) {
2525
'de': de.sidebar[key],
2626
'da': da.sidebar[key],
2727
'fr': fr.sidebar[key],
28-
'pt': pt.sidebar[key],
29-
'es': es.sidebar[key],
30-
'tr': tr.sidebar[key],
28+
'pt-PT': pt.sidebar[key],
29+
'es-ES': es.sidebar[key],
30+
'tr-TR': tr.sidebar[key],
3131
},
3232
};
3333
}

0 commit comments

Comments
 (0)