Skip to content

Commit 915e04d

Browse files
committed
add translations and language and labels
1 parent f42e699 commit 915e04d

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

dev-demo/custom/Dash.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="flex justify-between">
1010
<div>
1111
<h5 class="leading-none text-3xl font-bold text-gray-900 dark:text-white pb-2">{{ data.totalAparts }}</h5>
12-
<p class="text-base font-normal text-gray-500 dark:text-gray-400">{{ $t('Apartment last 7 days | Apartments last 7 days', data.totalAparts) }}</p>
12+
<p class="text-base font-normal text-gray-500 dark:text-gray-400">{{ $t('Apartment last 7 days | Apartments last 7 days') }}</p>
1313
</div>
1414

1515
</div>

live-demo/app/custom/Dashboard.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<template>
22
<div class="px-4 py-8 bg-blue-50 dark:bg-gray-900 dark:shadow-none min-h-[calc(100vh-56px)]">
3-
<h1 class="mb-4 text-xl font-extrabold text-gray-900 dark:text-white md:text-2xl lg:text-3xl"><span
4-
class="text-transparent bg-clip-text bg-gradient-to-r to-emerald-600 from-sky-400">{{$t('Apartments')}}</span>
5-
{{$t('Statistics.')}}</h1>
3+
<h1 class="mb-4 text-xl font-extrabold text-gray-900 dark:text-white md:text-2xl lg:text-3xl"v-html='$t("<span class=\"text-transparent bg-clip-text bg-gradient-to-r to-emerald-600 from-sky-400\">Apartments</span> Statistics.")'></h1>
64

75
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
86
<div class="max-w-md w-full bg-white rounded-lg shadow dark:bg-gray-800 p-4 md:p-6" v-if="data">
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "translations" ADD COLUMN "de_string" TEXT;

live-demo/app/resources/translations.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ export default {
3131
},
3232
plugins: [
3333
new I18nPlugin({
34-
supportedLanguages: ['en', 'uk', 'ja', 'fr'],
34+
supportedLanguages: ['en', 'uk', 'ja', 'fr', 'de'],
3535

3636
// names of the fields in the resource which will store translations
3737
translationFieldNames: {
3838
en: 'en_string',
3939
uk: 'uk_string',
4040
ja: 'ja_string',
4141
fr: 'fr_string',
42+
de: 'de_string',
4243
},
4344

4445
// name of the field which will store the category of the string
@@ -77,6 +78,7 @@ export default {
7778
{
7879
name: "en_string",
7980
type: AdminForthDataTypes.STRING,
81+
label: 'English',
8082
},
8183
{
8284
name: "created_at",
@@ -85,14 +87,22 @@ export default {
8587
{
8688
name: "uk_string",
8789
type: AdminForthDataTypes.STRING,
90+
label: 'Ukrainian',
8891
},
8992
{
9093
name: "ja_string",
9194
type: AdminForthDataTypes.STRING,
95+
label: 'Japanese',
9296
},
9397
{
9498
name: "fr_string",
9599
type: AdminForthDataTypes.STRING,
100+
label: 'French',
101+
},
102+
{
103+
name: "de_string",
104+
type: AdminForthDataTypes.STRING,
105+
label: 'German',
96106
},
97107
{
98108
name: "completedLangs",

live-demo/app/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ model translations {
4747
ja_string String? // translation for Japanese language
4848
fr_string String? // translation for French language
4949
es_string String? // translation for Spanish language
50+
de_string String?
5051
category String
5152
source String?
5253
completedLangs String?

0 commit comments

Comments
 (0)