strapi-plugin-magic-link-v5 4.0.7 → 4.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/admin/src/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { prefixPluginTranslations } from '@strapi/strapi/admin';
|
|
1
|
+
// import { prefixPluginTranslations } from '@strapi/strapi/admin';
|
|
2
2
|
import pluginPkg from '../../package.json';
|
|
3
3
|
import pluginId from './pluginId';
|
|
4
4
|
import Initializer from './components/Initializer';
|
|
5
5
|
import PluginIcon from './components/PluginIcon';
|
|
6
6
|
import pluginPermissions from './permissions';
|
|
7
7
|
import getTrad from './utils/getTrad';
|
|
8
|
+
import prefixPluginTranslations from './utils/prefixPluginTranslations';
|
|
8
9
|
|
|
9
10
|
const name = pluginPkg.strapi.name;
|
|
10
11
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds plugin prefix to translation keys
|
|
3
|
+
* @param {Object} translations - The translations object
|
|
4
|
+
* @param {string} pluginId - The plugin identifier
|
|
5
|
+
* @returns {Object} Prefixed translations
|
|
6
|
+
*/
|
|
7
|
+
const prefixPluginTranslations = (translations, pluginId) => {
|
|
8
|
+
if (!pluginId) {
|
|
9
|
+
throw new TypeError("pluginId can't be empty");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return Object.keys(translations).reduce((acc, current) => {
|
|
13
|
+
acc[`${pluginId}.${current}`] = translations[current];
|
|
14
|
+
return acc;
|
|
15
|
+
}, {});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default prefixPluginTranslations;
|
package/package.json
CHANGED