@antelopejs/dms-lang 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +62 -0
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +46 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/pages/index.d.ts +4 -0
  7. package/dist/pages/index.js +21 -0
  8. package/dist/pages/index.js.map +1 -0
  9. package/dist/pages/module.d.ts +1 -0
  10. package/dist/pages/module.js +12 -0
  11. package/dist/pages/module.js.map +1 -0
  12. package/dist/pages/overview.d.ts +9 -0
  13. package/dist/pages/overview.js +29 -0
  14. package/dist/pages/overview.js.map +1 -0
  15. package/dist/pages/translations.d.ts +9 -0
  16. package/dist/pages/translations.js +29 -0
  17. package/dist/pages/translations.js.map +1 -0
  18. package/dist/routes/index.d.ts +2 -0
  19. package/dist/routes/index.js +19 -0
  20. package/dist/routes/index.js.map +1 -0
  21. package/dist/routes/publicLocales.d.ts +6 -0
  22. package/dist/routes/publicLocales.js +46 -0
  23. package/dist/routes/publicLocales.js.map +1 -0
  24. package/dist/routes/translations.d.ts +72 -0
  25. package/dist/routes/translations.js +213 -0
  26. package/dist/routes/translations.js.map +1 -0
  27. package/dist/utils/config.d.ts +6 -0
  28. package/dist/utils/config.js +15 -0
  29. package/dist/utils/config.js.map +1 -0
  30. package/dist/utils/json.d.ts +5 -0
  31. package/dist/utils/json.js +86 -0
  32. package/dist/utils/json.js.map +1 -0
  33. package/dist/utils/locale-discovery.d.ts +3 -0
  34. package/dist/utils/locale-discovery.js +39 -0
  35. package/dist/utils/locale-discovery.js.map +1 -0
  36. package/dist/utils/mutations.d.ts +3 -0
  37. package/dist/utils/mutations.js +35 -0
  38. package/dist/utils/mutations.js.map +1 -0
  39. package/dist/utils/own.d.ts +3 -0
  40. package/dist/utils/own.js +64 -0
  41. package/dist/utils/own.js.map +1 -0
  42. package/dist/utils/registry.d.ts +11 -0
  43. package/dist/utils/registry.js +43 -0
  44. package/dist/utils/registry.js.map +1 -0
  45. package/dist/utils/resolve.d.ts +24 -0
  46. package/dist/utils/resolve.js +203 -0
  47. package/dist/utils/resolve.js.map +1 -0
  48. package/dist/utils/tree.d.ts +24 -0
  49. package/dist/utils/tree.js +161 -0
  50. package/dist/utils/tree.js.map +1 -0
  51. package/dist/utils/workspaces.d.ts +38 -0
  52. package/dist/utils/workspaces.js +236 -0
  53. package/dist/utils/workspaces.js.map +1 -0
  54. package/frontend-vue/.editorconfig +12 -0
  55. package/frontend-vue/.prettierrc +10 -0
  56. package/frontend-vue/app/build/components/pages/lang/TranslationMatrix.vue +284 -0
  57. package/frontend-vue/app/components/LanguageAddModal.vue +78 -0
  58. package/frontend-vue/app/components/WorkspaceEndpoint.vue +29 -0
  59. package/frontend-vue/app/components/WorkspaceSelector.vue +180 -0
  60. package/frontend-vue/app/components/WorkspaceStatus.vue +24 -0
  61. package/frontend-vue/app/composables/translation/useI18nWorkspaces.ts +177 -0
  62. package/frontend-vue/app/composables/translation/useLanguageCatalog.ts +90 -0
  63. package/frontend-vue/app/composables/translation/useLocaleMeta.ts +18 -0
  64. package/frontend-vue/app/composables/translation/useMutationToast.ts +30 -0
  65. package/frontend-vue/app/composables/translation/useTranslationProgress.ts +73 -0
  66. package/frontend-vue/app/composables/translation/useWorkspaceContext.ts +27 -0
  67. package/frontend-vue/app/composables/translation/useWorkspaceFlat.ts +81 -0
  68. package/frontend-vue/app/custom-pages/lang/overview.vue +397 -0
  69. package/frontend-vue/app/custom-pages/lang/translations.vue +498 -0
  70. package/frontend-vue/app/plugins/workspace-sidebar-widget.ts +12 -0
  71. package/frontend-vue/dms.frontend.ts +42 -0
  72. package/frontend-vue/eslint.config.mjs +50 -0
  73. package/frontend-vue/i18n/locales/lang-en-GB.json +80 -0
  74. package/frontend-vue/i18n/locales/lang-fr-FR.json +80 -0
  75. package/frontend-vue/package.json +37 -0
  76. package/package.json +76 -0
@@ -0,0 +1,498 @@
1
+ <script setup lang="ts">
2
+ import { useDmsRoute } from '#dms-inertia/frontend-module'
3
+ import TranslationMatrix from '../../build/components/pages/lang/TranslationMatrix.vue'
4
+ import {
5
+ type FlatTranslationRow,
6
+ isLocaleValueMissing,
7
+ } from '../../composables/translation/useTranslationProgress'
8
+
9
+ interface LocaleColumn {
10
+ code: string
11
+ name: string
12
+ flag: string
13
+ isDefault: boolean
14
+ }
15
+
16
+ interface SavePayload {
17
+ key: string
18
+ locale: string
19
+ value: string
20
+ }
21
+
22
+ type TranslationFilter = 'all' | 'missing' | 'complete'
23
+
24
+ const FILTER_PREDICATES: Record<
25
+ TranslationFilter,
26
+ (missing: boolean) => boolean
27
+ > = {
28
+ all: () => true,
29
+ missing: (missing) => missing,
30
+ complete: (missing) => !missing,
31
+ }
32
+
33
+ const route = useDmsRoute()
34
+ const { t } = useI18n()
35
+ const toast = useToast()
36
+ const { confirm } = useConfirm()
37
+ const { localeMetaOf } = useLocaleMeta()
38
+ const { tryMutate } = useMutationToast()
39
+
40
+ const {
41
+ editable: devEditable,
42
+ selectedWorkspace,
43
+ upsertKey,
44
+ renameKey,
45
+ deleteKey,
46
+ } = useI18nWorkspaces()
47
+
48
+ const { isDefault, isModules, isEditable, canManage } = useWorkspaceContext()
49
+
50
+ const initialFilter =
51
+ route.query.filter === 'missing' || route.query.filter === 'complete'
52
+ ? route.query.filter
53
+ : 'all'
54
+ const initialLocale =
55
+ typeof route.query.locale === 'string' ? route.query.locale : ''
56
+
57
+ const filter = ref<TranslationFilter>(initialFilter)
58
+ const search = ref('')
59
+ const { flat, isLoading, loadFlat, reload, removeLanguage } = useWorkspaceFlat()
60
+
61
+ const canManageKeys = computed(() => isEditable.value && !isModules.value)
62
+ const canEditValues = computed(() => isEditable.value && !isModules.value)
63
+ const showOverride = computed(() => isModules.value && devEditable.value)
64
+
65
+ const allLocaleColumns = computed<LocaleColumn[]>(() => {
66
+ const fallback = flat.value.defaultLocale
67
+ return [...flat.value.locales]
68
+ .sort((a, b) => (a === fallback ? -1 : b === fallback ? 1 : 0))
69
+ .map((code) => ({
70
+ code,
71
+ ...localeMetaOf(code),
72
+ isDefault: code === fallback,
73
+ }))
74
+ })
75
+
76
+ const visibleOrder = ref<string[]>([])
77
+ let localeFocusPending = Boolean(initialLocale)
78
+
79
+ function focusedOrder(codes: string[]): string[] | null {
80
+ if (!codes.includes(initialLocale)) return null
81
+ const fallback = flat.value.defaultLocale
82
+ if (initialLocale === fallback) return [initialLocale]
83
+ return codes.includes(fallback) ? [fallback, initialLocale] : [initialLocale]
84
+ }
85
+
86
+ watch(
87
+ () => allLocaleColumns.value.map((column) => column.code).join(','),
88
+ () => {
89
+ const codes = allLocaleColumns.value.map((column) => column.code)
90
+ if (codes.length > 0 && localeFocusPending) {
91
+ localeFocusPending = false
92
+ const focused = focusedOrder(codes)
93
+ if (focused) {
94
+ visibleOrder.value = focused
95
+ return
96
+ }
97
+ }
98
+ visibleOrder.value = codes
99
+ },
100
+ { immediate: true },
101
+ )
102
+
103
+ const displayColumns = computed<LocaleColumn[]>(() => {
104
+ const byCode = new Map(
105
+ allLocaleColumns.value.map((column) => [column.code, column]),
106
+ )
107
+ return visibleOrder.value
108
+ .map((code) => byCode.get(code))
109
+ .filter((column): column is LocaleColumn => Boolean(column))
110
+ })
111
+
112
+ function isColumnShown(code: string): boolean {
113
+ return visibleOrder.value.includes(code)
114
+ }
115
+
116
+ function toggleColumn(code: string) {
117
+ visibleOrder.value = visibleOrder.value.includes(code)
118
+ ? visibleOrder.value.filter((current) => current !== code)
119
+ : [...visibleOrder.value, code]
120
+ }
121
+
122
+ function moveColumn(code: string, direction: -1 | 1) {
123
+ const index = visibleOrder.value.indexOf(code)
124
+ const target = index + direction
125
+ if (index < 0 || target < 0 || target >= visibleOrder.value.length) return
126
+ const next = [...visibleOrder.value]
127
+ ;[next[index], next[target]] = [next[target], next[index]]
128
+ visibleOrder.value = next
129
+ }
130
+
131
+ const columnManagerRows = computed(() => {
132
+ const shown = displayColumns.value.map((column) => ({
133
+ ...column,
134
+ shown: true,
135
+ }))
136
+ const hidden = allLocaleColumns.value
137
+ .filter((column) => !isColumnShown(column.code))
138
+ .map((column) => ({ ...column, shown: false }))
139
+ return [...shown, ...hidden]
140
+ })
141
+
142
+ function rowMissing(row: FlatTranslationRow): boolean {
143
+ return displayColumns.value
144
+ .filter((column) => !column.isDefault)
145
+ .some((column) => isLocaleValueMissing(row.values[column.code]))
146
+ }
147
+
148
+ const counts = computed(() => {
149
+ const missing = flat.value.rows.filter(rowMissing).length
150
+ return {
151
+ all: flat.value.rows.length,
152
+ missing,
153
+ complete: flat.value.rows.length - missing,
154
+ }
155
+ })
156
+
157
+ const filterItems = computed(() => [
158
+ {
159
+ label: `${t('dms_lang.editor.filter_all')} ${counts.value.all}`,
160
+ value: 'all',
161
+ },
162
+ {
163
+ label: `${t('dms_lang.editor.filter_missing')} ${counts.value.missing}`,
164
+ value: 'missing',
165
+ },
166
+ {
167
+ label: `${t('dms_lang.editor.filter_complete')} ${counts.value.complete}`,
168
+ value: 'complete',
169
+ },
170
+ ])
171
+
172
+ const filteredRows = computed(() => {
173
+ const needle = search.value.trim().toLowerCase()
174
+ const matchesFilter = FILTER_PREDICATES[filter.value]
175
+ return flat.value.rows.filter((row) => {
176
+ const passFilter = matchesFilter(rowMissing(row))
177
+ const passSearch = !needle || row.key.toLowerCase().includes(needle)
178
+ return passFilter && passSearch
179
+ })
180
+ })
181
+
182
+ function toMatrixValues(
183
+ source: Record<string, unknown>,
184
+ ): Record<string, string | undefined> {
185
+ const result: Record<string, string | undefined> = {}
186
+ for (const code of flat.value.locales) {
187
+ const value = source[code]
188
+ result[code] = value == null ? undefined : String(value)
189
+ }
190
+ return result
191
+ }
192
+
193
+ const matrixRows = computed(() =>
194
+ filteredRows.value.map((row) => ({
195
+ key: row.key,
196
+ values: toMatrixValues(row.values),
197
+ inherited: row.inherited ? toMatrixValues(row.inherited) : undefined,
198
+ })),
199
+ )
200
+
201
+ async function onSave(payload: SavePayload) {
202
+ const ok = await tryMutate(() =>
203
+ upsertKey(
204
+ selectedWorkspace.value,
205
+ payload.key,
206
+ { [payload.locale]: payload.value },
207
+ flat.value.defaultLocale,
208
+ ),
209
+ )
210
+ if (!ok) return
211
+ const row = flat.value.rows.find((item) => item.key === payload.key)
212
+ if (row)
213
+ row.values[payload.locale] =
214
+ payload.value === '' ? undefined : payload.value
215
+ toast.add({ title: t('dms_lang.translation.ws_saved'), color: 'success' })
216
+ }
217
+
218
+ function overrideKey(key: string) {
219
+ selectedWorkspace.value = DEFAULT_WORKSPACE
220
+ filter.value = 'all'
221
+ search.value = key
222
+ }
223
+
224
+ const langAddOpen = ref(false)
225
+
226
+ const keyAddOpen = ref(false)
227
+ const keyAddForm = ref({ path: '' })
228
+ const keyRenameOpen = ref(false)
229
+ const keyRenameForm = ref({ path: '', newPath: '' })
230
+
231
+ function openAddKey() {
232
+ keyAddForm.value = { path: '' }
233
+ keyAddOpen.value = true
234
+ }
235
+
236
+ async function submitAddKey() {
237
+ const path = keyAddForm.value.path.trim()
238
+ if (!path) return
239
+ const seed = isDefault.value ? { [flat.value.defaultLocale]: '' } : {}
240
+ const ok = await tryMutate(() =>
241
+ upsertKey(selectedWorkspace.value, path, seed, flat.value.defaultLocale),
242
+ )
243
+ if (!ok) return
244
+ keyAddOpen.value = false
245
+ await loadFlat()
246
+ }
247
+
248
+ function openRenameKey(key: string) {
249
+ keyRenameForm.value = { path: key, newPath: key }
250
+ keyRenameOpen.value = true
251
+ }
252
+
253
+ async function submitRenameKey() {
254
+ const { path, newPath } = keyRenameForm.value
255
+ const ok = await tryMutate(() =>
256
+ renameKey(selectedWorkspace.value, path, newPath),
257
+ )
258
+ if (!ok) return
259
+ keyRenameOpen.value = false
260
+ await loadFlat()
261
+ }
262
+
263
+ async function requestDeleteKey(key: string) {
264
+ const workspace = selectedWorkspace.value
265
+ const confirmed = await confirm({
266
+ title: t('dms_lang.translation.ws_delete_key_title'),
267
+ description: t('dms_lang.translation.ws_delete_key_confirm', { path: key }),
268
+ confirmLabel: t('dms_lang.translation.ws_delete'),
269
+ confirmColor: 'error',
270
+ })
271
+ if (!confirmed) return
272
+ const ok = await tryMutate(() => deleteKey(workspace, key))
273
+ if (!ok) return
274
+ await loadFlat()
275
+ }
276
+ </script>
277
+
278
+ <template>
279
+ <div class="space-y-6">
280
+ <div class="flex flex-wrap items-center gap-3">
281
+ <DmsLangWorkspaceStatus />
282
+
283
+ <div class="flex-1" />
284
+
285
+ <UButton
286
+ v-if="canManage"
287
+ icon="i-lucide-languages"
288
+ color="neutral"
289
+ variant="subtle"
290
+ :label="$t('dms_lang.translation.ws_add_language')"
291
+ @click="langAddOpen = true"
292
+ />
293
+ </div>
294
+
295
+ <DmsLangWorkspaceEndpoint />
296
+
297
+ <div class="flex flex-wrap items-center gap-3">
298
+ <DmsSegmented
299
+ v-model="filter"
300
+ :items="filterItems"
301
+ :aria-label="$t('dms_lang.editor.filter_all')"
302
+ />
303
+ <UInput
304
+ v-model="search"
305
+ icon="i-lucide-search"
306
+ :placeholder="$t('dms_lang.editor.search_placeholder')"
307
+ class="w-64"
308
+ />
309
+ <div class="flex-1" />
310
+
311
+ <UPopover>
312
+ <UButton
313
+ icon="i-lucide-columns-3"
314
+ color="neutral"
315
+ variant="subtle"
316
+ size="sm"
317
+ :label="$t('dms_lang.editor.columns')"
318
+ />
319
+ <template #content>
320
+ <div class="w-72 space-y-0.5 p-2">
321
+ <div
322
+ v-for="column in columnManagerRows"
323
+ :key="column.code"
324
+ class="hover:bg-elevated/50 flex items-center gap-2 rounded-md px-2 py-1.5"
325
+ >
326
+ <UCheckbox
327
+ :model-value="column.shown"
328
+ @update:model-value="toggleColumn(column.code)"
329
+ />
330
+ <UIcon
331
+ :name="
332
+ column.flag ? `flagpack:${column.flag}` : 'i-lucide-globe'
333
+ "
334
+ class="size-4 shrink-0"
335
+ />
336
+ <span class="min-w-0 flex-1 truncate text-sm">
337
+ {{ column.name }}
338
+ </span>
339
+ <UBadge
340
+ v-if="column.isDefault"
341
+ color="neutral"
342
+ variant="subtle"
343
+ size="sm"
344
+ >
345
+ {{ $t('dms_lang.editor.base') }}
346
+ </UBadge>
347
+ <template v-if="column.shown">
348
+ <UButton
349
+ icon="i-lucide-chevron-up"
350
+ color="neutral"
351
+ variant="ghost"
352
+ size="xs"
353
+ :aria-label="$t('dms_lang.editor.move_up')"
354
+ @click="moveColumn(column.code, -1)"
355
+ />
356
+ <UButton
357
+ icon="i-lucide-chevron-down"
358
+ color="neutral"
359
+ variant="ghost"
360
+ size="xs"
361
+ :aria-label="$t('dms_lang.editor.move_down')"
362
+ @click="moveColumn(column.code, 1)"
363
+ />
364
+ </template>
365
+ <UButton
366
+ v-if="canManage && !column.isDefault"
367
+ icon="i-lucide-trash-2"
368
+ color="error"
369
+ variant="ghost"
370
+ size="xs"
371
+ :aria-label="$t('dms_lang.translation.ws_delete')"
372
+ @click="removeLanguage(column.code)"
373
+ />
374
+ </div>
375
+
376
+ <template v-if="canManage">
377
+ <USeparator class="my-1.5" />
378
+ <UButton
379
+ icon="i-lucide-plus"
380
+ color="neutral"
381
+ variant="ghost"
382
+ size="sm"
383
+ block
384
+ :label="$t('dms_lang.translation.ws_add_language')"
385
+ @click="langAddOpen = true"
386
+ />
387
+ </template>
388
+ </div>
389
+ </template>
390
+ </UPopover>
391
+
392
+ <UButton
393
+ v-if="canManageKeys"
394
+ icon="i-lucide-plus"
395
+ color="neutral"
396
+ variant="subtle"
397
+ size="sm"
398
+ :label="$t('dms_lang.translation.ws_add_key')"
399
+ @click="openAddKey"
400
+ />
401
+ </div>
402
+
403
+ <div class="relative">
404
+ <div
405
+ v-if="isLoading"
406
+ class="bg-default/50 absolute inset-0 z-30 flex items-center justify-center rounded-xl"
407
+ >
408
+ <div class="text-center">
409
+ <UIcon
410
+ name="i-lucide-loader-circle"
411
+ class="text-muted mb-2 size-8 animate-spin"
412
+ />
413
+ <p class="text-muted text-xs">
414
+ {{ $t('dms_lang.translation.loading_translations') }}
415
+ </p>
416
+ </div>
417
+ </div>
418
+
419
+ <DmsCard :padded="false">
420
+ <TranslationMatrix
421
+ :rows="matrixRows"
422
+ :columns="displayColumns"
423
+ :editable="canEditValues"
424
+ :show-inherited="isDefault"
425
+ :overridable="showOverride"
426
+ :manage-keys="canManageKeys"
427
+ :reset-key="`${selectedWorkspace}|${filter}|${search}`"
428
+ @save="onSave"
429
+ @rename="openRenameKey"
430
+ @remove="requestDeleteKey"
431
+ @override="overrideKey"
432
+ />
433
+ </DmsCard>
434
+ </div>
435
+
436
+ <DmsLangLanguageAddModal v-model:open="langAddOpen" @added="reload" />
437
+
438
+ <UModal
439
+ v-model:open="keyAddOpen"
440
+ :title="$t('dms_lang.translation.ws_add_key')"
441
+ >
442
+ <template #body>
443
+ <UFormField
444
+ :label="$t('dms_lang.translation.ws_key_path')"
445
+ :help="$t('dms_lang.translation.ws_key_path_help')"
446
+ >
447
+ <UInput
448
+ v-model="keyAddForm.path"
449
+ class="w-full"
450
+ placeholder="menu.home.title"
451
+ />
452
+ </UFormField>
453
+ </template>
454
+ <template #footer>
455
+ <div class="flex w-full justify-end gap-2">
456
+ <UButton
457
+ color="neutral"
458
+ variant="ghost"
459
+ :label="$t('dms_lang.translation.ws_cancel')"
460
+ @click="keyAddOpen = false"
461
+ />
462
+ <UButton
463
+ :label="$t('dms_lang.translation.ws_add')"
464
+ @click="submitAddKey"
465
+ />
466
+ </div>
467
+ </template>
468
+ </UModal>
469
+
470
+ <UModal
471
+ v-model:open="keyRenameOpen"
472
+ :title="$t('dms_lang.translation.ws_rename_key')"
473
+ >
474
+ <template #body>
475
+ <UFormField
476
+ :label="$t('dms_lang.translation.ws_new_path')"
477
+ :help="$t('dms_lang.translation.ws_key_path_help')"
478
+ >
479
+ <UInput v-model="keyRenameForm.newPath" class="w-full" />
480
+ </UFormField>
481
+ </template>
482
+ <template #footer>
483
+ <div class="flex w-full justify-end gap-2">
484
+ <UButton
485
+ color="neutral"
486
+ variant="ghost"
487
+ :label="$t('dms_lang.translation.ws_cancel')"
488
+ @click="keyRenameOpen = false"
489
+ />
490
+ <UButton
491
+ :label="$t('dms_lang.translation.ws_save')"
492
+ @click="submitRenameKey"
493
+ />
494
+ </div>
495
+ </template>
496
+ </UModal>
497
+ </div>
498
+ </template>
@@ -0,0 +1,12 @@
1
+ import { defineDmsPlugin } from '#dms-inertia/frontend-module'
2
+
3
+ const LANG_MODULE_ID = 'lang'
4
+
5
+ export default defineDmsPlugin(() => {
6
+ const { register } = useSidebarWidgets()
7
+ register({
8
+ id: 'dms-lang:workspace-selector',
9
+ component: 'DmsLangWorkspaceSelector',
10
+ module: LANG_MODULE_ID,
11
+ })
12
+ })
@@ -0,0 +1,42 @@
1
+ import { defineAsyncComponent, type Component } from 'vue'
2
+ import type { DmsFrontendModule } from '#dms-inertia/frontend-module'
3
+ import workspaceSidebarWidget from './app/plugins/workspace-sidebar-widget'
4
+
5
+ interface VueModule {
6
+ default: Component
7
+ }
8
+
9
+ const components = import.meta.glob<VueModule>(
10
+ './app/{components,build/components}/**/*.vue',
11
+ )
12
+ const pages = import.meta.glob<VueModule>('./app/custom-pages/**/*.vue')
13
+
14
+ const frontendModule: DmsFrontendModule = {
15
+ setup(sdk) {
16
+ for (const [path, loader] of Object.entries(components).sort()) {
17
+ const name = path
18
+ .split('/')
19
+ .at(-1)!
20
+ .replace(/\.vue$/, '')
21
+ sdk.registerComponent(
22
+ `DmsLang${name}`,
23
+ defineAsyncComponent(async () => (await loader()).default),
24
+ )
25
+ }
26
+ for (const [path, loader] of Object.entries(pages).sort()) {
27
+ const name = path.replace('./app/custom-pages/', '').replace(/\.vue$/, '')
28
+ const component = defineAsyncComponent(
29
+ async () => (await loader()).default,
30
+ )
31
+ sdk.registerPage(name, component, loader)
32
+ const componentName = name
33
+ .split(/[/_-]/)
34
+ .map((part) => `${part[0].toUpperCase()}${part.slice(1)}`)
35
+ .join('')
36
+ sdk.registerComponent(`Dms${componentName}`, component)
37
+ }
38
+ sdk.registerPlugin(workspaceSidebarWidget)
39
+ },
40
+ }
41
+
42
+ export default frontendModule
@@ -0,0 +1,50 @@
1
+ // @ts-check
2
+ import eslint from '@eslint/js'
3
+ import typescript from '@typescript-eslint/eslint-plugin'
4
+ import typescriptParser from '@typescript-eslint/parser'
5
+ import vue from 'eslint-plugin-vue'
6
+ import globals from 'globals'
7
+
8
+ const sourceFiles = ['**/*.{js,mjs,cjs,ts,vue}']
9
+
10
+ export default [
11
+ { ignores: ['dist/**', 'node_modules/**'] },
12
+ eslint.configs.recommended,
13
+ ...vue.configs['flat/recommended'],
14
+ {
15
+ files: ['**/*.{ts,mts,cts}'],
16
+ languageOptions: { parser: typescriptParser },
17
+ },
18
+ {
19
+ files: sourceFiles,
20
+ languageOptions: {
21
+ globals: { ...globals.browser, ...globals.node },
22
+ parserOptions: {
23
+ parser: typescriptParser,
24
+ sourceType: 'module',
25
+ },
26
+ },
27
+ plugins: { '@typescript-eslint': typescript },
28
+ rules: {
29
+ 'no-redeclare': 'off',
30
+ 'no-undef': 'off',
31
+ 'no-unused-vars': 'off',
32
+ '@typescript-eslint/no-explicit-any': 'off',
33
+ '@typescript-eslint/no-unused-vars': [
34
+ 'error',
35
+ {
36
+ argsIgnorePattern: '^_',
37
+ varsIgnorePattern: '^_',
38
+ caughtErrorsIgnorePattern: '^_',
39
+ },
40
+ ],
41
+ 'vue/attributes-order': 'off',
42
+ 'vue/html-indent': 'off',
43
+ 'vue/html-self-closing': 'off',
44
+ 'vue/max-attributes-per-line': 'off',
45
+ 'vue/multi-word-component-names': 'off',
46
+ 'vue/require-default-prop': 'off',
47
+ 'vue/singleline-html-element-content-newline': 'off',
48
+ },
49
+ },
50
+ ]
@@ -0,0 +1,80 @@
1
+ {
2
+ "dms_lang": {
3
+ "title": "Language Management",
4
+ "description": "Manage your dashboard languages and translations",
5
+ "overview": {
6
+ "title": "Overview",
7
+ "description": "Coverage, languages and settings of the selected workspace.",
8
+ "kpi_languages": "Languages",
9
+ "kpi_keys": "Translation keys",
10
+ "kpi_missing": "Missing",
11
+ "kpi_coverage": "Coverage",
12
+ "coverage": "Coverage",
13
+ "keys_missing": "{count} keys missing",
14
+ "complete": "Fully translated",
15
+ "base_language": "Base language",
16
+ "translate": "Translate",
17
+ "set_default": "Set default",
18
+ "open_editor": "Open editor"
19
+ },
20
+ "sidebar": {
21
+ "workspace": "Workspace",
22
+ "languages_count": "{count} language | {count} languages"
23
+ },
24
+ "editor": {
25
+ "title": "Translations",
26
+ "description": "Edit every key side-by-side across locales, filter what's missing.",
27
+ "col_key": "Key",
28
+ "base": "base",
29
+ "no_keys": "No keys match.",
30
+ "filter_all": "All",
31
+ "filter_missing": "Missing",
32
+ "filter_complete": "Complete",
33
+ "search_placeholder": "Search keys…",
34
+ "columns": "Languages",
35
+ "move_up": "Move up",
36
+ "move_down": "Move down"
37
+ },
38
+ "translation": {
39
+ "default": "Default",
40
+ "loading_translations": "Loading translations...",
41
+ "ws_new": "New workspace",
42
+ "ws_read_only": "Read-only",
43
+ "ws_editable": "Editable",
44
+ "ws_actions": "Workspace actions",
45
+ "ws_rename": "Rename",
46
+ "ws_delete": "Delete",
47
+ "ws_cancel": "Cancel",
48
+ "ws_save": "Save",
49
+ "ws_create": "Create",
50
+ "ws_add": "Add",
51
+ "ws_languages": "Languages",
52
+ "ws_workspace_name": "Workspace name",
53
+ "ws_workspace_name_help": "Lowercase letters, digits, dashes and underscores.",
54
+ "ws_add_language": "New language",
55
+ "ws_add_language_locked": "Languages of this workspace come from your project files. Create a workspace to manage its languages here.",
56
+ "ws_language": "Language",
57
+ "ws_language_select": "Select a language",
58
+ "ws_default_locale": "Default language",
59
+ "ws_add_key": "Add key",
60
+ "ws_key_path": "Key path",
61
+ "ws_key_path_help": "Dot-separated, e.g. menu.home.title",
62
+ "ws_rename_key": "Rename key",
63
+ "ws_new_path": "New key path",
64
+ "ws_delete_workspace_title": "Delete workspace",
65
+ "ws_delete_workspace_confirm": "Delete workspace \"{name}\" and all its translation files? This cannot be undone.",
66
+ "ws_delete_language_title": "Remove language",
67
+ "ws_delete_language_confirm": "Remove language \"{code}\" and its file from this workspace?",
68
+ "ws_delete_key_title": "Delete key",
69
+ "ws_delete_key_confirm": "Delete key \"{path}\" from every language?",
70
+ "ws_no_languages": "No language yet",
71
+ "ws_saved": "Saved",
72
+ "ws_save_error": "Could not save changes",
73
+ "ws_load_error": "Could not load translations",
74
+ "ws_override": "Override",
75
+ "ws_default_hint": "Your project's own translation files — edit them directly.",
76
+ "ws_modules_hint": "Translation keys provided by installed DMS modules. Read-only; use Override to redefine one in your project.",
77
+ "ws_http_notice_hint": "Replace {'{'}locale{'}'} with a locale code (e.g. en). Works with i18next-http-backend or a plain fetch in your app."
78
+ }
79
+ }
80
+ }