Skip to content

Commit e17433f

Browse files
committed
window.admin
1 parent 8d6c6b0 commit e17433f

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

adminforth/documentation/docs/tutorial/05-Plugins/10-i18n.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ If you don't use params, you can use `tr` without third param:
384384
> So to collect all translations you should use your app for some time and make sure all strings are used at
385385
> In future we plan to add backend strings collection in same way like frontend strings are collected.
386386
387-
## Translating messaged within bulk action
387+
## Translating messages within bulk action
388388
389389
Label adn confirm strings of bulk actions are already translated by AdminForth, but
390390
`succesMessage` returned by action function should be translated manually because of the dynamic nature of the message.
@@ -422,9 +422,9 @@ import { admin } from '../index';
422422
423423
## Translating external application
424424
425-
You can use this module not only to translate Admin area of your application but also to translate other services of your application.
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-
will consider that we have a Nuxt.js SEO-centric frontend which we want to translate with [vue-i18n](https://vue-i18n.intlify.dev/).
425+
You can use this module not only to translate admin area of your application but also to translate other parts like SEO-facing or user-facing services.
426+
This will allow you to reuse the same functionality and AI completion adapters for all your translations and manage them in one place.
427+
For example in this app we will consider translating a Nuxt.js SEO-centric frontend which we want to translate with [vue-i18n](https://vue-i18n.intlify.dev/).
428428
429429
To do it you need to use 2 exposed methods from the plugin: `feedCategoryTranslations` and `getCategoryTranslations`.
430430
@@ -467,7 +467,6 @@ You can add extract command to `package.json`:
467467
"scripts": {
468468
"i18n:extract": "echo '{}' > i18n-empty.json && vue-i18n-extract report --vueFiles './src/**/*.?(js|vue)' --output ./i18n-messages.json --languageFiles 'i18n-empty.json' --add",
469469
"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"
470-
""
471470
}
472471
}
473472
```

adminforth/plugins/i18n/Changelog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.0.21] - next
8+
## [1.0.22] - next
9+
10+
11+
## [1.0.21] - 2024-12-30
912

1013
### Fixed
1114
- improve cache reset when editing messages manually

adminforth/plugins/i18n/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adminforth/plugins/i18n/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adminforth/i18n",
3-
"version": "1.0.21-next.1",
3+
"version": "1.0.22-next.0",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"type": "module",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { FrontendAPIInterface } from "@/types/FrontendAPI";
2+
3+
declare global {
4+
interface Window {
5+
adminforth: FrontendAPIInterface;
6+
}
7+
}
8+
9+
export {};

0 commit comments

Comments
 (0)