Skip to content

Commit ed78ead

Browse files
committed
dev-dmo: add more languages for translations resource
AdminForth/1826/invalid-processing-progress
1 parent 08b3062 commit ed78ead

3 files changed

Lines changed: 198 additions & 4 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- AlterTable
2+
ALTER TABLE "translations" ADD COLUMN "de_string" TEXT;
3+
ALTER TABLE "translations" ADD COLUMN "it_string" TEXT;
4+
ALTER TABLE "translations" ADD COLUMN "pt_string" TEXT;
5+
ALTER TABLE "translations" ADD COLUMN "nl_string" TEXT;
6+
ALTER TABLE "translations" ADD COLUMN "pl_string" TEXT;
7+
ALTER TABLE "translations" ADD COLUMN "tr_string" TEXT;
8+
ALTER TABLE "translations" ADD COLUMN "cs_string" TEXT;
9+
ALTER TABLE "translations" ADD COLUMN "sv_string" TEXT;
10+
ALTER TABLE "translations" ADD COLUMN "da_string" TEXT;
11+
ALTER TABLE "translations" ADD COLUMN "fi_string" TEXT;
12+
ALTER TABLE "translations" ADD COLUMN "ro_string" TEXT;
13+
ALTER TABLE "translations" ADD COLUMN "hu_string" TEXT;
14+
ALTER TABLE "translations" ADD COLUMN "el_string" TEXT;
15+
ALTER TABLE "translations" ADD COLUMN "bg_string" TEXT;
16+
ALTER TABLE "translations" ADD COLUMN "zh_string" TEXT;
17+
ALTER TABLE "translations" ADD COLUMN "ko_string" TEXT;
18+
ALTER TABLE "translations" ADD COLUMN "ar_string" TEXT;
19+
ALTER TABLE "translations" ADD COLUMN "he_string" TEXT;
20+
ALTER TABLE "translations" ADD COLUMN "hi_string" TEXT;
21+
ALTER TABLE "translations" ADD COLUMN "vi_string" TEXT;

dev-demo/migrations/prisma/sqlite/schema.prisma

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ model audit_logs {
8888
ja_string String? // translation for Japanese language
8989
fr_string String? // translation for French language
9090
es_string String? // translation for Spanish language
91+
de_string String? // translation for German language
92+
it_string String? // translation for Italian language
93+
pt_string String? // translation for Portuguese language
94+
nl_string String? // translation for Dutch language
95+
pl_string String? // translation for Polish language
96+
tr_string String? // translation for Turkish language
97+
cs_string String? // translation for Czech language
98+
sv_string String? // translation for Swedish language
99+
da_string String? // translation for Danish language
100+
fi_string String? // translation for Finnish language
101+
ro_string String? // translation for Romanian language
102+
hu_string String? // translation for Hungarian language
103+
el_string String? // translation for Greek language
104+
bg_string String? // translation for Bulgarian language
105+
zh_string String? // translation for Chinese language
106+
ko_string String? // translation for Korean language
107+
ar_string String? // translation for Arabic language (RTL)
108+
he_string String? // translation for Hebrew language (RTL)
109+
hi_string String? // translation for Hindi language
110+
vi_string String? // translation for Vietnamese language
91111
ptBR_string String? // Brazilian Portuguese translation using BCP47 code (pt-BR)
92112
category String
93113
source String?

dev-demo/resources/translations.ts

Lines changed: 157 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,40 @@ export default {
1414
recordLabel: (r: any) => `✍️ ${r.en_string}`,
1515
plugins: [
1616
new I18nPlugin({
17-
supportedLanguages: ['en', 'uk', 'ja', 'fr', 'pt-BR'],
17+
supportedLanguages: [
18+
'en', 'uk', 'ja', 'fr', 'es', 'pt-BR',
19+
'de', 'it', 'pt', 'nl', 'pl', 'tr', 'cs', 'sv', 'da', 'fi',
20+
'ro', 'hu', 'el', 'bg', 'zh', 'ko', 'ar', 'he', 'hi', 'vi',
21+
],
1822

1923
// names of the fields in the resource which will store translations
2024
translationFieldNames: {
2125
en: 'en_string',
2226
uk: 'uk_string',
2327
ja: 'ja_string',
2428
fr: 'fr_string',
29+
es: 'es_string',
2530
'pt-BR': 'ptBR_string',
26-
31+
de: 'de_string',
32+
it: 'it_string',
33+
pt: 'pt_string',
34+
nl: 'nl_string',
35+
pl: 'pl_string',
36+
tr: 'tr_string',
37+
cs: 'cs_string',
38+
sv: 'sv_string',
39+
da: 'da_string',
40+
fi: 'fi_string',
41+
ro: 'ro_string',
42+
hu: 'hu_string',
43+
el: 'el_string',
44+
bg: 'bg_string',
45+
zh: 'zh_string',
46+
ko: 'ko_string',
47+
ar: 'ar_string',
48+
he: 'he_string',
49+
hi: 'hi_string',
50+
vi: 'vi_string',
2751
},
2852

2953
// name of the field which will store the category of the string
@@ -90,18 +114,147 @@ export default {
90114
type: AdminForthDataTypes.STRING,
91115
label: 'French',
92116
},
93-
{
117+
{
118+
name: "es_string",
119+
type: AdminForthDataTypes.STRING,
120+
label: 'Spanish',
121+
},
122+
{
94123
name: "ptBR_string",
95124
type: AdminForthDataTypes.STRING,
96125
label: "Portuguese (BR)"
97126
},
127+
128+
// rest of the languages are hidden from the list to keep it readable,
129+
// they are still editable on show/edit pages and translatable by the plugin
130+
{
131+
name: "de_string",
132+
type: AdminForthDataTypes.STRING,
133+
label: 'German',
134+
showIn: { list: true },
135+
},
136+
{
137+
name: "it_string",
138+
type: AdminForthDataTypes.STRING,
139+
label: 'Italian',
140+
showIn: { list: true },
141+
},
142+
{
143+
name: "pt_string",
144+
type: AdminForthDataTypes.STRING,
145+
label: 'Portuguese',
146+
showIn: { list: true },
147+
},
148+
{
149+
name: "nl_string",
150+
type: AdminForthDataTypes.STRING,
151+
label: 'Dutch',
152+
showIn: { list: true },
153+
},
154+
{
155+
name: "pl_string",
156+
type: AdminForthDataTypes.STRING,
157+
label: 'Polish',
158+
showIn: { list: true },
159+
},
160+
{
161+
name: "tr_string",
162+
type: AdminForthDataTypes.STRING,
163+
label: 'Turkish',
164+
showIn: { list: true },
165+
},
166+
{
167+
name: "cs_string",
168+
type: AdminForthDataTypes.STRING,
169+
label: 'Czech',
170+
showIn: { list: true },
171+
},
172+
{
173+
name: "sv_string",
174+
type: AdminForthDataTypes.STRING,
175+
label: 'Swedish',
176+
showIn: { list: true },
177+
},
178+
{
179+
name: "da_string",
180+
type: AdminForthDataTypes.STRING,
181+
label: 'Danish',
182+
showIn: { list: true },
183+
},
184+
{
185+
name: "fi_string",
186+
type: AdminForthDataTypes.STRING,
187+
label: 'Finnish',
188+
showIn: { list: true },
189+
},
190+
{
191+
name: "ro_string",
192+
type: AdminForthDataTypes.STRING,
193+
label: 'Romanian',
194+
showIn: { list: true },
195+
},
196+
{
197+
name: "hu_string",
198+
type: AdminForthDataTypes.STRING,
199+
label: 'Hungarian',
200+
showIn: { list: true },
201+
},
202+
{
203+
name: "el_string",
204+
type: AdminForthDataTypes.STRING,
205+
label: 'Greek',
206+
showIn: { list: true },
207+
},
208+
{
209+
name: "bg_string",
210+
type: AdminForthDataTypes.STRING,
211+
label: 'Bulgarian',
212+
showIn: { list: true },
213+
},
214+
{
215+
name: "zh_string",
216+
type: AdminForthDataTypes.STRING,
217+
label: 'Chinese',
218+
showIn: { list: true },
219+
},
220+
{
221+
name: "ko_string",
222+
type: AdminForthDataTypes.STRING,
223+
label: 'Korean',
224+
showIn: { list: true },
225+
},
226+
{
227+
name: "ar_string",
228+
type: AdminForthDataTypes.STRING,
229+
label: 'Arabic',
230+
showIn: { list: true },
231+
},
232+
{
233+
name: "he_string",
234+
type: AdminForthDataTypes.STRING,
235+
label: 'Hebrew',
236+
showIn: { list: true },
237+
},
238+
{
239+
name: "hi_string",
240+
type: AdminForthDataTypes.STRING,
241+
label: 'Hindi',
242+
showIn: { list: true },
243+
},
244+
{
245+
name: "vi_string",
246+
type: AdminForthDataTypes.STRING,
247+
label: 'Vietnamese',
248+
showIn: { list: true },
249+
},
250+
98251
{
99252
name: "completedLangs",
100253
},
101254
{
102255
name: "source",
103256
showIn: {
104-
list: false,
257+
list: true,
105258
edit: false,
106259
create: false,
107260
},

0 commit comments

Comments
 (0)