From ce9b8a8834875410f785a6abc377313e0eb7b82f Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 7 Apr 2022 16:20:43 +0200
Subject: [PATCH] person-profile: port to i18next-parser

---
 packages/person-profile/i18next-parser.config.js | 10 ++++++++++
 .../person-profile/i18next-scanner.config.js     | 16 ----------------
 packages/person-profile/package.json             |  4 ++--
 3 files changed, 12 insertions(+), 18 deletions(-)
 create mode 100644 packages/person-profile/i18next-parser.config.js
 delete mode 100644 packages/person-profile/i18next-scanner.config.js

diff --git a/packages/person-profile/i18next-parser.config.js b/packages/person-profile/i18next-parser.config.js
new file mode 100644
index 00000000..e1513af7
--- /dev/null
+++ b/packages/person-profile/i18next-parser.config.js
@@ -0,0 +1,10 @@
+module.exports = {
+    createOldCatalogs: false,
+    indentation: 4,
+    keepRemoved: false,
+    locales: ['en', 'de'],
+    output: 'src/i18n/$LOCALE/$NAMESPACE.json',
+    input: ['src/**/*.js'],
+    sort: true,
+    i18nextOptions: {compatibilityJSON: 'v3'},
+};
diff --git a/packages/person-profile/i18next-scanner.config.js b/packages/person-profile/i18next-scanner.config.js
deleted file mode 100644
index d15acb02..00000000
--- a/packages/person-profile/i18next-scanner.config.js
+++ /dev/null
@@ -1,16 +0,0 @@
-module.exports = {
-    input: ['src/*.js'],
-    output: './',
-    options: {
-        debug: false,
-        sort: true,
-        removeUnusedKeys: true,
-        func: {list: ['i18n.t', '_i18n.t']},
-        lngs: ['en', 'de'],
-        resource: {
-            loadPath: 'src/i18n/{{lng}}/{{ns}}.json',
-            savePath: 'src/i18n/{{lng}}/{{ns}}.json',
-            jsonIndent: 4,
-        },
-    },
-};
diff --git a/packages/person-profile/package.json b/packages/person-profile/package.json
index b1a8cb26..4029fccb 100644
--- a/packages/person-profile/package.json
+++ b/packages/person-profile/package.json
@@ -21,7 +21,7 @@
         "@rollup/plugin-url": "^6.0.0",
         "eslint": "^8.0.0",
         "eslint-plugin-jsdoc": "^38.0.0",
-        "i18next-scanner": "^3.0.0",
+        "i18next-parser": "^6.3.0",
         "karma": "^6.0.0",
         "karma-chrome-launcher": "^3.0.0",
         "karma-firefox-launcher": "^2.1.0",
@@ -54,7 +54,7 @@
         "build-prod": "rollup -c --environment BUILD:production",
         "build-demo": "rollup -c --environment BUILD:demo",
         "build-test": "rollup -c --environment BUILD:test",
-        "i18next": "i18next-scanner",
+        "i18next": "i18next",
         "watch": "npm run watch-local",
         "watch-local": "rollup -c --watch",
         "watch-dev": "rollup -c --watch --environment BUILD:development",
-- 
GitLab