From e63157717dc0e655593d21af7a93cabfa53eba5e Mon Sep 17 00:00:00 2001 From: Adrian Date: Wed, 9 Oct 2024 15:43:36 -0400 Subject: [PATCH] Added more comments for create help a new namespace --- src/plugins/i18n.ts | 4 +++- src/plugins/namespacemap.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 25e56e05e1e..9f82556c7ae 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -130,7 +130,9 @@ export async function initI18n(): Promise { * Don't forget to declare new language in `supportedLngs` i18next initializer * * Q: How do I add a new namespace? - * A: To add a new namespace, create a new file in each language folder with the translations. + * A: To add a new namespace, create a new file .json in each language folder with the translations. + * The expected format for the files is kebab-case {@link https://developer.mozilla.org/en-US/docs/Glossary/Kebab_case} + * If you want the namespace name to be different from the file name, configure it in namespacemap.ts. * Then update the config file for that language in its locale directory * and the CustomTypeOptions interface in the @types/i18next.d.ts file. * diff --git a/src/plugins/namespacemap.ts b/src/plugins/namespacemap.ts index 00e9b4dcda2..cb16b0ee108 100644 --- a/src/plugins/namespacemap.ts +++ b/src/plugins/namespacemap.ts @@ -1,6 +1,9 @@ // When changing the file, the server restarts because of the namespaces-18n-plugin.ts -/** maps namespaces that deviate from the file-name */ +/** + * ### maps namespaces that deviate from the file-name + * @description expects file-name as value and custom-namespace as key + * */ export const namespaceMap = { titles: "trainer-titles", moveTriggers: "move-trigger",