summaryrefslogtreecommitdiff
path: root/admin/src/index.ts
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-02-05 13:19:56 +0300
committerValentin Popov <valentin@popov.link>2026-02-05 13:19:56 +0300
commitefa89313fa4152252b477aafd88f7cf4a66747d8 (patch)
tree5939b251fe1bbc6bea3881a71154cabd3aa538ec /admin/src/index.ts
parentf6de8611955bf382612996500efba21a2d64ea1f (diff)
downloadstrapi-plugin-checkbox-list-efa89313fa4152252b477aafd88f7cf4a66747d8.tar.xz
strapi-plugin-checkbox-list-efa89313fa4152252b477aafd88f7cf4a66747d8.zip
Initial Strapi plugin project
Diffstat (limited to 'admin/src/index.ts')
-rw-r--r--admin/src/index.ts43
1 files changed, 43 insertions, 0 deletions
diff --git a/admin/src/index.ts b/admin/src/index.ts
new file mode 100644
index 0000000..4dff817
--- /dev/null
+++ b/admin/src/index.ts
@@ -0,0 +1,43 @@
+import { getTranslation } from './utils/getTranslation';
+import { PLUGIN_ID } from './pluginId';
+import { Initializer } from './components/Initializer';
+import { PluginIcon } from './components/PluginIcon';
+
+export default {
+ register(app: any) {
+ app.addMenuLink({
+ to: `plugins/${PLUGIN_ID}`,
+ icon: PluginIcon,
+ intlLabel: {
+ id: `${PLUGIN_ID}.plugin.name`,
+ defaultMessage: PLUGIN_ID,
+ },
+ Component: async () => {
+ const { App } = await import('./pages/App');
+
+ return App;
+ },
+ });
+
+ app.registerPlugin({
+ id: PLUGIN_ID,
+ initializer: Initializer,
+ isReady: false,
+ name: PLUGIN_ID,
+ });
+ },
+
+ async registerTrads({ locales }: { locales: string[] }) {
+ return Promise.all(
+ locales.map(async (locale) => {
+ try {
+ const { default: data } = await import(`./translations/${locale}.json`);
+
+ return { data, locale };
+ } catch {
+ return { data: {}, locale };
+ }
+ })
+ );
+ },
+};