i18n-dashboard 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +715 -0
- package/app.vue +8 -0
- package/assets/css/main.css +21 -0
- package/assets/locales/en.json +380 -0
- package/bin/cli.mjs +279 -0
- package/components/LinkedKeyPicker.vue +135 -0
- package/components/PathPicker.vue +153 -0
- package/components/PluralEditor.vue +295 -0
- package/components/ScanModal.vue +153 -0
- package/components/TranslationHistoryModal.vue +66 -0
- package/components/TranslationRow.vue +541 -0
- package/components/dashboard/WidgetConfigModal.vue +121 -0
- package/components/dashboard/WidgetGrid.vue +190 -0
- package/components/dashboard/WidgetPicker.vue +75 -0
- package/components/dashboard/widgets/ActivityWidget.vue +109 -0
- package/components/dashboard/widgets/LanguagesCoverageWidget.vue +104 -0
- package/components/dashboard/widgets/ProjectsWidget.vue +77 -0
- package/components/dashboard/widgets/ReviewWidget.vue +150 -0
- package/components/dashboard/widgets/StatWidget.vue +133 -0
- package/composables/useAuth.ts +72 -0
- package/composables/useConfig.ts +14 -0
- package/composables/useDashboard.ts +89 -0
- package/composables/useFormats.ts +100 -0
- package/composables/useKeys.ts +231 -0
- package/composables/useLanguages.ts +221 -0
- package/composables/useProfile.ts +76 -0
- package/composables/useProject.ts +180 -0
- package/composables/useReview.ts +94 -0
- package/composables/useSettings.ts +30 -0
- package/composables/useStats.ts +16 -0
- package/composables/useT.ts +38 -0
- package/composables/useUsers.ts +101 -0
- package/composables/useWidgetData.ts +50 -0
- package/consts/commons.const.ts +6 -0
- package/consts/dashboard.const.ts +94 -0
- package/consts/languages.const.ts +223 -0
- package/enums/commons.enum.ts +7 -0
- package/i18n-dashboard.config.example.js +40 -0
- package/interfaces/commons.interface.ts +23 -0
- package/interfaces/job.interface.ts +10 -0
- package/interfaces/key.interface.ts +39 -0
- package/interfaces/languages.interface.ts +23 -0
- package/interfaces/project.interface.ts +9 -0
- package/interfaces/scan.interface.ts +12 -0
- package/interfaces/settings.interface.ts +4 -0
- package/interfaces/stat.interface.ts +30 -0
- package/interfaces/translation.interface.ts +11 -0
- package/interfaces/user.interface.ts +24 -0
- package/layouts/auth.vue +5 -0
- package/layouts/default.vue +327 -0
- package/middleware/auth.global.ts +26 -0
- package/nuxt.config.ts +66 -0
- package/package.json +89 -0
- package/pages/index.vue +5 -0
- package/pages/login.vue +74 -0
- package/pages/onboarding.vue +563 -0
- package/pages/projects/[id]/formats/datetime.vue +240 -0
- package/pages/projects/[id]/formats/modifiers.vue +194 -0
- package/pages/projects/[id]/formats/number.vue +250 -0
- package/pages/projects/[id]/index.vue +182 -0
- package/pages/projects/[id]/languages.vue +537 -0
- package/pages/projects/[id]/review.vue +109 -0
- package/pages/projects/[id]/settings.vue +515 -0
- package/pages/projects/[id]/translations/[keyId].vue +642 -0
- package/pages/projects/[id]/translations/index.vue +250 -0
- package/pages/projects/[id]/users.vue +276 -0
- package/pages/projects/index.vue +334 -0
- package/pages/users/[id]/profile.vue +421 -0
- package/pages/users/index.vue +345 -0
- package/plugins/loading.client.ts +3 -0
- package/plugins/ui-i18n.ts +6 -0
- package/server/api/auth/login.post.ts +28 -0
- package/server/api/auth/logout.post.ts +7 -0
- package/server/api/auth/me.get.ts +11 -0
- package/server/api/auth/me.put.ts +31 -0
- package/server/api/auth/password.put.ts +27 -0
- package/server/api/auth/status.get.ts +16 -0
- package/server/api/config.get.ts +10 -0
- package/server/api/dashboard/layout.get.ts +18 -0
- package/server/api/dashboard/layout.post.ts +18 -0
- package/server/api/db-config.get.ts +44 -0
- package/server/api/db-config.post.ts +73 -0
- package/server/api/export.get.ts +64 -0
- package/server/api/formats/datetime/[id].delete.ts +8 -0
- package/server/api/formats/datetime/[id].put.ts +15 -0
- package/server/api/formats/datetime.get.ts +11 -0
- package/server/api/formats/datetime.post.ts +16 -0
- package/server/api/formats/modifiers/[id].delete.ts +8 -0
- package/server/api/formats/modifiers/[id].put.ts +10 -0
- package/server/api/formats/modifiers.get.ts +10 -0
- package/server/api/formats/modifiers.post.ts +14 -0
- package/server/api/formats/number/[id].delete.ts +8 -0
- package/server/api/formats/number/[id].put.ts +15 -0
- package/server/api/formats/number.get.ts +11 -0
- package/server/api/formats/number.post.ts +16 -0
- package/server/api/formats/snippet.get.ts +87 -0
- package/server/api/fs/browse.get.ts +50 -0
- package/server/api/history/[translationId].get.ts +13 -0
- package/server/api/keys/[id].delete.ts +14 -0
- package/server/api/keys/[id].get.ts +41 -0
- package/server/api/keys/[id].patch.ts +20 -0
- package/server/api/keys/index.get.ts +98 -0
- package/server/api/keys/index.post.ts +17 -0
- package/server/api/languages/[code].delete.ts +15 -0
- package/server/api/languages/[id].put.ts +24 -0
- package/server/api/languages/index.get.ts +13 -0
- package/server/api/languages/index.post.ts +42 -0
- package/server/api/onboarding.post.ts +56 -0
- package/server/api/profile.get.ts +81 -0
- package/server/api/project-snapshot.get.ts +73 -0
- package/server/api/project-snapshot.post.ts +160 -0
- package/server/api/projects/[id].delete.ts +13 -0
- package/server/api/projects/[id].put.ts +40 -0
- package/server/api/projects/index.get.ts +19 -0
- package/server/api/projects/index.post.ts +34 -0
- package/server/api/scan.post.ts +165 -0
- package/server/api/settings/index.get.ts +9 -0
- package/server/api/settings/index.post.ts +20 -0
- package/server/api/setup.post.ts +39 -0
- package/server/api/stats/global.get.ts +126 -0
- package/server/api/stats.get.ts +70 -0
- package/server/api/sync.post.ts +179 -0
- package/server/api/translate.post.ts +52 -0
- package/server/api/translations/batch-translate.post.ts +121 -0
- package/server/api/translations/bulk-status.post.ts +24 -0
- package/server/api/translations/index.post.ts +62 -0
- package/server/api/translations/job/[id].get.ts +23 -0
- package/server/api/translations/status.post.ts +30 -0
- package/server/api/translations/translate-all.post.ts +18 -0
- package/server/api/ui-locale.get.ts +39 -0
- package/server/api/users/[id]/profile.get.ts +107 -0
- package/server/api/users/[id]/roles.put.ts +67 -0
- package/server/api/users/[id].delete.ts +36 -0
- package/server/api/users/[id].put.ts +43 -0
- package/server/api/users/index.get.ts +49 -0
- package/server/api/users/index.post.ts +89 -0
- package/server/consts/auto-translate.const.ts +2 -0
- package/server/consts/commons.const.ts +10 -0
- package/server/consts/db.const.ts +3 -0
- package/server/consts/scanner.const.ts +4 -0
- package/server/consts/translation-job.const.ts +8 -0
- package/server/db/index.ts +672 -0
- package/server/enums/auth.enum.ts +5 -0
- package/server/enums/translation.enum.ts +6 -0
- package/server/interfaces/profile.interface.ts +48 -0
- package/server/interfaces/project-config.interface.ts +9 -0
- package/server/interfaces/scanner.interface.ts +18 -0
- package/server/interfaces/translation-job.interface.ts +13 -0
- package/server/middleware/auth.ts +32 -0
- package/server/plugins/db.ts +6 -0
- package/server/routes/locale/[lang].get.ts +179 -0
- package/server/types/auth.type.ts +3 -0
- package/server/utils/auth.util.ts +89 -0
- package/server/utils/auto-translate.util.ts +112 -0
- package/server/utils/lang-api.util.ts +24 -0
- package/server/utils/mailer.util.ts +80 -0
- package/server/utils/project-config.util.ts +37 -0
- package/server/utils/scanner.uti.ts +307 -0
- package/server/utils/translation-job.util.ts +142 -0
- package/services/auth.service.ts +31 -0
- package/services/base.service.ts +140 -0
- package/services/job.service.ts +10 -0
- package/services/key.service.ts +26 -0
- package/services/language.service.ts +26 -0
- package/services/profile.service.ts +14 -0
- package/services/project.service.ts +23 -0
- package/services/scan.service.ts +14 -0
- package/services/settings.service.ts +14 -0
- package/services/stats.service.ts +11 -0
- package/services/translation.service.ts +36 -0
- package/services/user.service.ts +28 -0
- package/tsconfig.json +3 -0
- package/types/commons.type.ts +3 -0
- package/types/dashboard.type.ts +26 -0
- package/utils/config.util.ts +60 -0
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "i18n-dashboard",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A web dashboard to manage vue-i18n translation keys with database persistence",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"i18n-dashboard": "./bin/cli.mjs"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "nuxt dev --port 3333",
|
|
11
|
+
"build": "nuxt build",
|
|
12
|
+
"preview": "nuxt preview",
|
|
13
|
+
"postinstall": "nuxt prepare",
|
|
14
|
+
"start": "node bin/cli.mjs start",
|
|
15
|
+
"start:detach": "node bin/cli.mjs start --detach",
|
|
16
|
+
"stop": "node bin/cli.mjs stop",
|
|
17
|
+
"init": "node bin/cli.mjs init",
|
|
18
|
+
"sync": "node bin/cli.mjs sync"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@nuxt/ui": "^3.3.7",
|
|
22
|
+
"@vitalets/google-translate-api": "^9.2.1",
|
|
23
|
+
"bcryptjs": "^2.4.3",
|
|
24
|
+
"commander": "^13.1.0",
|
|
25
|
+
"knex": "^3.1.0",
|
|
26
|
+
"nodemailer": "^6.10.1",
|
|
27
|
+
"nuxt": "^3.21.1",
|
|
28
|
+
"vue": "^3.5.13"
|
|
29
|
+
},
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"better-sqlite3": "^11.8.1",
|
|
32
|
+
"mysql2": "^3.13.0",
|
|
33
|
+
"pg": "^8.14.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"vue-i18n": ">=9.0.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"vue-i18n": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18.0.0"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"assets/",
|
|
48
|
+
"bin/",
|
|
49
|
+
"components/",
|
|
50
|
+
"composables/",
|
|
51
|
+
"consts/",
|
|
52
|
+
"enums/",
|
|
53
|
+
"interfaces/",
|
|
54
|
+
"layouts/",
|
|
55
|
+
"middleware/",
|
|
56
|
+
"pages/",
|
|
57
|
+
"plugins/",
|
|
58
|
+
"server/",
|
|
59
|
+
"services/",
|
|
60
|
+
"types/",
|
|
61
|
+
"utils/",
|
|
62
|
+
"app.vue",
|
|
63
|
+
"nuxt.config.ts",
|
|
64
|
+
"tsconfig.json",
|
|
65
|
+
"i18n-dashboard.config.example.js"
|
|
66
|
+
],
|
|
67
|
+
"author": "i18n-dashboard contributors",
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "https://github.com/arnaudprioul/i18n-dashboard.git"
|
|
71
|
+
},
|
|
72
|
+
"homepage": "https://github.com/arnaudprioul/i18n-dashboard#readme",
|
|
73
|
+
"bugs": {
|
|
74
|
+
"url": "https://github.com/arnaudprioul/i18n-dashboard/issues"
|
|
75
|
+
},
|
|
76
|
+
"keywords": [
|
|
77
|
+
"vue",
|
|
78
|
+
"vue-i18n",
|
|
79
|
+
"i18n",
|
|
80
|
+
"translations",
|
|
81
|
+
"dashboard",
|
|
82
|
+
"localization"
|
|
83
|
+
],
|
|
84
|
+
"license": "MIT",
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@iconify-json/heroicons": "^1.2.3",
|
|
87
|
+
"@types/node": "^25.3.5"
|
|
88
|
+
}
|
|
89
|
+
}
|
package/pages/index.vue
ADDED
package/pages/login.vue
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UCard class="w-full max-w-md">
|
|
3
|
+
<template #header>
|
|
4
|
+
<div class="flex items-center gap-3">
|
|
5
|
+
<div class="w-10 h-10 rounded-xl bg-primary-500 flex items-center justify-center shrink-0">
|
|
6
|
+
<UIcon name="i-heroicons-language" class="text-white text-lg" />
|
|
7
|
+
</div>
|
|
8
|
+
<div>
|
|
9
|
+
<h1 class="text-lg font-bold text-gray-900 dark:text-white">i18n Dashboard</h1>
|
|
10
|
+
<p class="text-xs text-gray-400">{{ t('login.title', 'Log in') }}</p>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<form class="space-y-4" @submit.prevent="handleLogin">
|
|
16
|
+
<UFormField :label="t('login.email', 'Email')" required>
|
|
17
|
+
<UInput
|
|
18
|
+
v-model="form.email"
|
|
19
|
+
type="email"
|
|
20
|
+
placeholder="admin@example.com"
|
|
21
|
+
class="w-full"
|
|
22
|
+
autocomplete="email"
|
|
23
|
+
autofocus
|
|
24
|
+
/>
|
|
25
|
+
</UFormField>
|
|
26
|
+
|
|
27
|
+
<UFormField :label="t('login.password', 'Password')" required>
|
|
28
|
+
<UInput
|
|
29
|
+
v-model="form.password"
|
|
30
|
+
type="password"
|
|
31
|
+
placeholder="••••••••"
|
|
32
|
+
class="w-full"
|
|
33
|
+
autocomplete="current-password"
|
|
34
|
+
/>
|
|
35
|
+
</UFormField>
|
|
36
|
+
|
|
37
|
+
<p v-if="error" class="text-sm text-red-500 bg-red-50 dark:bg-red-900/20 rounded-lg px-3 py-2">
|
|
38
|
+
<UIcon name="i-heroicons-exclamation-circle" class="inline mr-1" />
|
|
39
|
+
{{ error }}
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<UButton type="submit" block :loading="loading" class="mt-2">
|
|
43
|
+
{{ t('login.submit', 'Sign in') }}
|
|
44
|
+
</UButton>
|
|
45
|
+
</form>
|
|
46
|
+
</UCard>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
definePageMeta({ layout: 'auth' })
|
|
51
|
+
|
|
52
|
+
const router = useRouter()
|
|
53
|
+
const { login } = useAuth()
|
|
54
|
+
const { t } = useT()
|
|
55
|
+
|
|
56
|
+
const form = ref({ email: '', password: '' })
|
|
57
|
+
const loading = ref(false)
|
|
58
|
+
const error = ref('')
|
|
59
|
+
|
|
60
|
+
async function handleLogin() {
|
|
61
|
+
if (!form.value.email || !form.value.password) return
|
|
62
|
+
loading.value = true
|
|
63
|
+
error.value = ''
|
|
64
|
+
try {
|
|
65
|
+
await login(form.value.email, form.value.password)
|
|
66
|
+
await clearNuxtData('auth-status')
|
|
67
|
+
await router.push('/')
|
|
68
|
+
} catch (e: any) {
|
|
69
|
+
error.value = e.data?.message || t('login.error', 'Invalid credentials')
|
|
70
|
+
} finally {
|
|
71
|
+
loading.value = false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</script>
|