Skip to content

Commit 072fa48

Browse files
committed
docs: add Proofreading checkboxes to i18n plugin docs
1 parent 087fdc0 commit 072fa48

File tree

1 file changed

+57
-0
lines changed
  • adminforth/documentation/docs/tutorial/05-Plugins

1 file changed

+57
-0
lines changed

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,63 @@ If you want to limit access to translations resource only to developers or trans
325325
326326
Please note that access to "Translate selected" bulk action which uses LLM AI translation adapter is determined by allowedActions.edit permission of resource.
327327
328+
## Proofreading checkboxes
329+
330+
You can enable didicated checkboxes for proofreading translations. This will allow proofreaders to check each translation and mark it "reviewed" or "not reviewed".
331+
332+
TO enable this options add TEXT column to the resource.
333+
334+
If using prisma, add something like this:
335+
336+
```ts title='./schema.prisma'
337+
model translations {
338+
...
339+
completedLangs String?
340+
//diff-add
341+
reviewed String?
342+
343+
// we need both indexes on en_string+category and separately on category
344+
@@index([en_string, category])
345+
@@index([category])
346+
@@index([completedLangs])
347+
}
348+
```
349+
350+
And add column to the resource:
351+
352+
```ts title='./resources/translations.ts'
353+
{
354+
...
355+
columns: [
356+
...
357+
{
358+
name: "reviewed",
359+
type: AdminForthDataTypes.JSON, // should be JSON type
360+
label: 'Reviewed',
361+
showIn: {
362+
all: false
363+
},
364+
},
365+
],
366+
}
367+
```
368+
369+
370+
Now just add `reviewedCheckboxesFieldName` to the plugin options:
371+
372+
```ts title='./resources/translations.ts'
373+
plugins: [
374+
new I18nPlugin({
375+
...
376+
reviewedCheckboxesFieldName: 'reviewed',
377+
}),
378+
],
379+
```
380+
This will add checkboxes to the translations resource:
381+
382+
![alt text](image-5.png)
383+
384+
328385
## Translations in custom APIs
329386
330387
Sometimes you need to return a translated error or success message from your API. You can use special `tr` function for this.

0 commit comments

Comments
 (0)