@@ -6,7 +6,11 @@ import da from './da'
6
6
import de from './de'
7
7
import en from './en'
8
8
import es from './es'
9
+ import fr from './fr'
10
+ import hi from './hi'
11
+ import ja from './ja'
9
12
import pt from './pt'
13
+ import ru from './ru'
10
14
import type { Localization } from './types'
11
15
12
16
const locales : Record < string , Localization > = {
@@ -18,6 +22,10 @@ const locales: Record<string, Localization> = {
18
22
da,
19
23
zh : cn ,
20
24
'zh-cn' : cn ,
25
+ ru,
26
+ fr,
27
+ hi,
28
+ ja,
21
29
}
22
30
23
31
class Locale {
@@ -58,3 +66,182 @@ function getLocale(localeCode: string, mixin?: Localization) {
58
66
}
59
67
60
68
export { Locale , getLocale }
69
+
70
+ // The following prompt was used for localizations translated with GPT-4:
71
+ //
72
+ // You are a service that translates user requests into JSON objects of type "Localizations" according to the following TypeScript definitions:
73
+ // ```typescript
74
+ // export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>
75
+
76
+ // export type PositionedLocalization = PartialRecord<TextPosition, string>
77
+ // export type CronLocalization = PartialRecord<CronType | '*', PositionedLocalization>
78
+
79
+ // export interface FieldLocalization {
80
+ // // Allow custom field ids
81
+ // [fieldId: string]: unknown
82
+
83
+ // /** `*` is used as a wildcard and matches any field id */
84
+ // '*'?: CronLocalization
85
+ // second?: CronLocalization
86
+ // minute?: CronLocalization
87
+ // hour?: CronLocalization
88
+ // day?: CronLocalization
89
+ // month?: CronLocalization
90
+ // dayOfWeek?: CronLocalization
91
+ // }
92
+
93
+ // export type PeriodLocalization = PositionedLocalization | FieldLocalization
94
+
95
+ // /**
96
+ // * Interface to define localizations for vue-js-cron
97
+ // * The localization strings are accessed by {periodId}.{fieldId}.{cronType}.{position}
98
+ // */
99
+ // export interface Localization {
100
+ // /** Allows custom period ids */
101
+ // [periodId: string]: unknown
102
+
103
+ // /** `*` is used as a wildcard and matches any period id */
104
+ // '*'?: PeriodLocalization
105
+ // minute?: PeriodLocalization
106
+ // hour?: PeriodLocalization
107
+ // day?: PeriodLocalization
108
+ // week?: PeriodLocalization
109
+ // month?: PeriodLocalization
110
+ // year?: PeriodLocalization
111
+ // }
112
+ // ```
113
+ // The following is a user request:
114
+ // """
115
+ // Translate the following Javascript object from German into Russian:
116
+ // {
117
+ // '*': {
118
+ // prefix: 'Jede',
119
+ // suffix: '',
120
+ // text: 'Unknown',
121
+ // '*': {
122
+ // value: { text: '{{value.text}}' },
123
+ // range: { text: '{{start.text}}-{{end.text}}' },
124
+ // everyX: { text: 'alle {{every.value}}' },
125
+ // },
126
+ // month: {
127
+ // '*': { prefix: 'im' },
128
+ // empty: {
129
+ // prefix: 'in',
130
+ // text: 'jedem Monat',
131
+ // },
132
+ // value: { text: '{{value.alt}}' },
133
+ // range: { text: '{{start.alt}}-{{end.alt}}' },
134
+ // },
135
+ // day: {
136
+ // '*': { prefix: 'den' },
137
+ // empty: {
138
+ // prefix: 'an',
139
+ // text: 'jedem Tag',
140
+ // },
141
+ // everyX: {
142
+ // prefix: '',
143
+ // text: 'alle {{every.value}} Tage',
144
+ // },
145
+ // noSpecific: {
146
+ // prefix: 'an',
147
+ // text: 'keinem bestimmten Tag',
148
+ // },
149
+ // },
150
+ // dayOfWeek: {
151
+ // '*': { prefix: 'am' },
152
+ // empty: {
153
+ // prefix: 'an',
154
+ // text: 'jedem Wochentag',
155
+ // },
156
+ // value: { text: '{{value.alt}}' },
157
+ // range: { text: '{{start.alt}}-{{end.alt}}' },
158
+ // noSpecific: {
159
+ // prefix: 'und',
160
+ // text: 'keinem bestimmten Wochentag',
161
+ // },
162
+ // },
163
+ // hour: {
164
+ // '*': { prefix: 'um' },
165
+ // empty: {
166
+ // prefix: 'zu',
167
+ // text: 'jeder Stunde',
168
+ // },
169
+ // everyX: {
170
+ // prefix: '',
171
+ // text: 'alle {{every.value}} Stunden',
172
+ // },
173
+ // },
174
+ // minute: {
175
+ // '*': { prefix: ':' },
176
+ // empty: { text: 'jede Minute' },
177
+ // everyX: {
178
+ // prefix: '',
179
+ // text: 'alle {{every.value}} Minuten',
180
+ // },
181
+ // },
182
+ // second: {
183
+ // '*': { prefix: ':' },
184
+ // empty: { text: 'jede Sekunde' },
185
+ // everyX: {
186
+ // prefix: '',
187
+ // text: 'alle {{every.value}} Sekunden',
188
+ // },
189
+ // },
190
+ // },
191
+ // minute: {
192
+ // text: 'Minute',
193
+ // },
194
+ // hour: {
195
+ // text: 'Stunde',
196
+ // minute: {
197
+ // '*': {
198
+ // prefix: 'zu',
199
+ // suffix: 'Minute(n)',
200
+ // },
201
+ // empty: { text: 'jeder' },
202
+ // },
203
+ // },
204
+ // day: {
205
+ // prefix: 'Jeden',
206
+ // text: 'Tag',
207
+ // },
208
+ // week: {
209
+ // text: 'Woche',
210
+ // },
211
+ // month: {
212
+ // prefix: 'Jedes',
213
+ // text: 'Monat',
214
+ // },
215
+ // year: {
216
+ // prefix: 'Jedes',
217
+ // text: 'Jahr',
218
+ // },
219
+
220
+ // //quartz format
221
+ // 'q-second': {
222
+ // text: 'Sekunde',
223
+ // },
224
+ // 'q-minute': {
225
+ // text: 'Minute',
226
+ // second: {
227
+ // '*': {
228
+ // prefix: 'und',
229
+ // },
230
+ // },
231
+ // },
232
+ // 'q-hour': {
233
+ // text: 'Stunde',
234
+ // minute: {
235
+ // '*': {
236
+ // prefix: 'und',
237
+ // },
238
+ // },
239
+ // second: {
240
+ // '*': {
241
+ // prefix: 'und',
242
+ // },
243
+ // },
244
+ // },
245
+ // }
246
+ // """
247
+ // The following is the user request translated into a JSON object with 2 spaces of indentation and no properties with the value undefined:
0 commit comments