From 7d4837cf6e310af694aa0492fb56ed72bb1f90e4 Mon Sep 17 00:00:00 2001 From: Christoph Reiter <reiter.christoph@gmail.com> Date: Thu, 10 Jun 2021 16:37:48 +0200 Subject: [PATCH] auth: switch to a non-default namespace Just to test if/how this works. It now uses "dbp-auth" instead of "translation", which was the i18next default. --- packages/auth/i18next-scanner.config.js | 1 + packages/auth/src/i18n.js | 6 +++--- .../auth/src/i18n/de/{translation.json => dbp-auth.json} | 0 .../auth/src/i18n/en/{translation.json => dbp-auth.json} | 0 4 files changed, 4 insertions(+), 3 deletions(-) rename packages/auth/src/i18n/de/{translation.json => dbp-auth.json} (100%) rename packages/auth/src/i18n/en/{translation.json => dbp-auth.json} (100%) diff --git a/packages/auth/i18next-scanner.config.js b/packages/auth/i18next-scanner.config.js index aeb8fdb6..0e6216b2 100644 --- a/packages/auth/i18next-scanner.config.js +++ b/packages/auth/i18next-scanner.config.js @@ -8,6 +8,7 @@ module.exports = { removeUnusedKeys: true, func: {list: ['i18n.t', '_i18n.t']}, lngs: ['en','de'], + defaultNs: 'dbp-auth', resource: { loadPath: 'src/i18n/{{lng}}/{{ns}}.json', savePath: 'src/i18n/{{lng}}/{{ns}}.json' diff --git a/packages/auth/src/i18n.js b/packages/auth/src/i18n.js index fbc1b032..a54f51bc 100644 --- a/packages/auth/src/i18n.js +++ b/packages/auth/src/i18n.js @@ -1,10 +1,10 @@ import {createInstance as _createInstance, setOverrides} from '@dbp-toolkit/common/i18next.js'; -import de from './i18n/de/translation.json'; -import en from './i18n/en/translation.json'; +import de from './i18n/de/dbp-auth.json'; +import en from './i18n/en/dbp-auth.json'; export function createInstance() { - return _createInstance({en: en, de: de}, 'de', 'en'); + return _createInstance({en: en, de: de}, 'de', 'en', 'dbp-auth'); } export {setOverrides}; \ No newline at end of file diff --git a/packages/auth/src/i18n/de/translation.json b/packages/auth/src/i18n/de/dbp-auth.json similarity index 100% rename from packages/auth/src/i18n/de/translation.json rename to packages/auth/src/i18n/de/dbp-auth.json diff --git a/packages/auth/src/i18n/en/translation.json b/packages/auth/src/i18n/en/dbp-auth.json similarity index 100% rename from packages/auth/src/i18n/en/translation.json rename to packages/auth/src/i18n/en/dbp-auth.json -- GitLab