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
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -325,6 +325,63 @@ If you want to limit access to translations resource only to developers or trans
325
325
326
326
Please note that access to "Translate selected" bulk action which uses LLM AI translation adapter is determined by allowedActions.edit permission of resource.
327
327
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
+
```tstitle='./schema.prisma'
337
+
modeltranslations {
338
+
...
339
+
completedLangsString?
340
+
//diff-add
341
+
reviewedString?
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
+
```tstitle='./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
+
```tstitle='./resources/translations.ts'
373
+
plugins: [
374
+
newI18nPlugin({
375
+
...
376
+
reviewedCheckboxesFieldName: 'reviewed',
377
+
}),
378
+
],
379
+
```
380
+
This will add checkboxes to the translations resource:
381
+
382
+

383
+
384
+
328
385
## Translations in custom APIs
329
386
330
387
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