You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/05-Plugins/10-i18n.md
+20-17Lines changed: 20 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -426,23 +426,9 @@ You can use this module not only to translate Admin area of your application but
426
426
This will allow you to reuse the same functionality and AI completion adapters for all your translations. For example in this app we
427
427
will consider that we have a Nuxt.js SEO-centric frontend which we want to translate with [vue-i18n](https://vue-i18n.intlify.dev/).
428
428
429
-
To do it you need to use 2 function from the plugin. First at some step, e.g. CI pipeline you should get all translation strings from your external app (e.g. Nuxt.js frontend) and create an own rest API like `'/feed-nuxt-strings'`, this API might look like this
430
-
431
-
For extracting 18n messages we use [vue-i18n-extract](https://github.com/Spittal/vue-i18n-extract) package.
"i18n:feed-to-backoffice": "npm run i18n:extract && curl -X POST -H 'Content-Type: application/json' -d @i18n-messages.json http://adminforth:3000/feed-nuxt-strings"
439
-
""
440
-
}
441
-
}
442
-
```
443
-
444
-
Make sure to replace `adminforth:3000` with AdminForth API URL.
429
+
To do it you need to use 2 exposed methods from the plugin: `feedCategoryTranslations` and `getCategoryTranslations`.
445
430
431
+
First of all, at some step, e.g. CI pipeline you should get all translation strings from your external app and feed them ao an own rest API like `'/feed-nuxt-strings'`, this API might look like this
446
432
447
433
```tstitle="./index.ts"
448
434
app.get(`${ADMIN_BASE_URL}/feed-nuxt-strings`,
@@ -473,7 +459,24 @@ Make sure to replace `adminforth:3000` with AdminForth API URL.
473
459
474
460
```
475
461
476
-
> 👆 This example method is just a stub, please make sure you not expose it to public or add some simple authorization on it,
462
+
For extracting 18n messages we use [vue-i18n-extract](https://github.com/Spittal/vue-i18n-extract) package.
0 commit comments