From c371276206ad20edf5f16e6623f8e93d1572c148 Mon Sep 17 00:00:00 2001 From: nichenqin Date: Thu, 5 Dec 2024 15:40:28 +0800 Subject: [PATCH] fix: fix template i18n --- .../blocks/template/template-card.svelte | 10 ++- .../blocks/template/template-header.svelte | 23 +++--- .../(share)/s/b/[shareId]/+layout.svelte | 5 +- packages/i18n/src/i18n/en/index.ts | 14 +++- packages/i18n/src/i18n/es/index.ts | 14 +++- packages/i18n/src/i18n/i18n-types.ts | 80 +++++++++++++++++++ packages/i18n/src/i18n/ja/index.ts | 14 +++- packages/i18n/src/i18n/ko/index.ts | 14 +++- packages/i18n/src/i18n/pt/index.ts | 14 +++- packages/i18n/src/i18n/zh/index.ts | 14 +++- 10 files changed, 173 insertions(+), 29 deletions(-) diff --git a/apps/frontend/src/lib/components/blocks/template/template-card.svelte b/apps/frontend/src/lib/components/blocks/template/template-card.svelte index a321b042b..e36611879 100644 --- a/apps/frontend/src/lib/components/blocks/template/template-card.svelte +++ b/apps/frontend/src/lib/components/blocks/template/template-card.svelte @@ -13,6 +13,7 @@ import TemplatePreview from "./template-preview.svelte" import { Checkbox } from "$lib/components/ui/checkbox/index.js" import Label from "$lib/components/ui/label/label.svelte" + import { LL } from "@undb/i18n/client" let includeData = false @@ -67,7 +68,7 @@ disabled={$createFromTemplate.isPending} > - Preview Template + {$LL.template.previewTemplate()} @@ -75,7 +76,8 @@
- Preview template {template.name} + {$LL.template.previewTemplate()} + {template.name} @@ -92,7 +94,7 @@ {#if $createFromTemplate.isPending} {/if} - Use this Template + {$LL.template.useThisTemplate()}
@@ -101,7 +103,7 @@ for="terms" class="text-xs font-medium leading-none text-gray-500 peer-disabled:cursor-not-allowed peer-disabled:opacity-70" > - Include data. + {$LL.table.record.includeData()}
diff --git a/apps/frontend/src/lib/components/blocks/template/template-header.svelte b/apps/frontend/src/lib/components/blocks/template/template-header.svelte index 02df5bcdd..8107b7c1b 100644 --- a/apps/frontend/src/lib/components/blocks/template/template-header.svelte +++ b/apps/frontend/src/lib/components/blocks/template/template-header.svelte @@ -15,6 +15,7 @@ import * as Form from "$lib/components/ui/form/index.js" import { goto, invalidate } from "$app/navigation" import LoginOrSignup from "../auth/login-or-signup.svelte" + import { LL } from "@undb/i18n/client" export let template: ITemplateDTO export let me: any @@ -103,18 +104,18 @@ }} > - + - Which space do you want to create this template in? - You can create a new base or a new table in the selected space. + {$LL.template.whichSpace()} + {$LL.template.whichSpaceDescription()}
- Space + {$LL.space.space()} - + {#each items as item} @@ -133,9 +134,7 @@ - Select a space to create a new base or a new table in the selected space. + {$LL.template.selectATemplateToCreateABase()} @@ -147,8 +146,8 @@
- Include data - Include data from the template to the new base or table. + {$LL.table.record.includeData()} + {$LL.template.includeDataDescription()}
@@ -158,14 +157,14 @@ {#if $createFromTemplate.isPending} {/if} - Import + {$LL.common.import()}
{:else} {$LL.template.loginToCreateNewBaseOrTable()} {/if} diff --git a/apps/frontend/src/routes/(share)/s/b/[shareId]/+layout.svelte b/apps/frontend/src/routes/(share)/s/b/[shareId]/+layout.svelte index 08b972a94..99735cec3 100644 --- a/apps/frontend/src/routes/(share)/s/b/[shareId]/+layout.svelte +++ b/apps/frontend/src/routes/(share)/s/b/[shareId]/+layout.svelte @@ -6,6 +6,7 @@ import Logo from "$lib/images/logo.svg" import { Button } from "$lib/components/ui/button" import { page } from "$app/stores" + import { LL } from "@undb/i18n/client" export let data: LayoutData @@ -36,7 +37,9 @@ Undb - +
diff --git a/packages/i18n/src/i18n/en/index.ts b/packages/i18n/src/i18n/en/index.ts index 763d8bb68..497c6e09b 100644 --- a/packages/i18n/src/i18n/en/index.ts +++ b/packages/i18n/src/i18n/en/index.ts @@ -528,6 +528,7 @@ const webhook = { } const space = { + space: 'Space', spaces: 'Spaces', name: "Space Name", setDisplayName: 'Set Display Name', @@ -623,8 +624,16 @@ const webhook = { } const template = { + template: 'Template', + useThisTemplate: 'Use this template', + previewTemplate: 'Preview Template', + getStarted: 'Get Started with this template', + whichSpace: "Which space do you want to create this template in?", + whichSpaceDescription: "You can create a new base or a new table in the selected space.", createBase: 'Create New Base', - selectATemplateToCreateABase: 'Select a template to create a new base' + selectATemplateToCreateABase: 'Select a template to create a new base', + includeDataDescription: 'Include data from the template to the new base or table.', + loginToCreateNewBaseOrTable: 'Login to create a new base or table' } const auth = { @@ -722,7 +731,8 @@ const en = { today: 'Today', clear: 'Clear', updated: 'Updated', - now: 'Now' + now: 'Now', + import: 'Import' }, share: { title: 'Share', diff --git a/packages/i18n/src/i18n/es/index.ts b/packages/i18n/src/i18n/es/index.ts index ade90313c..1eef358d6 100644 --- a/packages/i18n/src/i18n/es/index.ts +++ b/packages/i18n/src/i18n/es/index.ts @@ -515,6 +515,7 @@ const base = { } const space = { + space: 'Espacio', spaces: 'Espacios', name: 'Nombre del espacio', setDisplayName: 'Establecer nombre de visualización', @@ -619,8 +620,16 @@ const events = { } const template = { + template: 'Plantilla', + useThisTemplate: 'Usar esta plantilla', + previewTemplate: 'Vista previa de plantilla', + getStarted: 'Comenzar con esta plantilla', + whichSpace: "¿Qué espacio quieres crear esta plantilla en?", + whichSpaceDescription: "Puedes crear una nueva Base o una nueva tabla en el espacio seleccionado.", createBase: 'Crear Base', - selectATemplateToCreateABase: 'Selecciona una plantilla para crear una Base' + selectATemplateToCreateABase: 'Selecciona una plantilla para crear una Base', + includeDataDescription: 'Incluir datos de la plantilla en la nueva Base o tabla.', + loginToCreateNewBaseOrTable: 'Iniciar sesión para crear una nueva Base o tabla' } const auth = { @@ -715,7 +724,8 @@ const es = { today: 'Hoy', clear: 'Limpiar', updated: 'Actualizado', - now: 'Ahora' + now: 'Ahora', + import: 'Importar' }, share: { title: 'Compartir', diff --git a/packages/i18n/src/i18n/i18n-types.ts b/packages/i18n/src/i18n/i18n-types.ts index 23fd026e4..b394349ba 100644 --- a/packages/i18n/src/i18n/i18n-types.ts +++ b/packages/i18n/src/i18n/i18n-types.ts @@ -130,6 +130,30 @@ type RootTranslation = { enterYourWorkEmail: string } template: { + /** + * T​e​m​p​l​a​t​e + */ + template: string + /** + * U​s​e​ ​t​h​i​s​ ​t​e​m​p​l​a​t​e + */ + useThisTemplate: string + /** + * P​r​e​v​i​e​w​ ​T​e​m​p​l​a​t​e + */ + previewTemplate: string + /** + * G​e​t​ ​S​t​a​r​t​e​d​ ​w​i​t​h​ ​t​h​i​s​ ​t​e​m​p​l​a​t​e + */ + getStarted: string + /** + * W​h​i​c​h​ ​s​p​a​c​e​ ​d​o​ ​y​o​u​ ​w​a​n​t​ ​t​o​ ​c​r​e​a​t​e​ ​t​h​i​s​ ​t​e​m​p​l​a​t​e​ ​i​n​? + */ + whichSpace: string + /** + * Y​o​u​ ​c​a​n​ ​c​r​e​a​t​e​ ​a​ ​n​e​w​ ​b​a​s​e​ ​o​r​ ​a​ ​n​e​w​ ​t​a​b​l​e​ ​i​n​ ​t​h​e​ ​s​e​l​e​c​t​e​d​ ​s​p​a​c​e​. + */ + whichSpaceDescription: string /** * C​r​e​a​t​e​ ​N​e​w​ ​B​a​s​e */ @@ -138,6 +162,14 @@ type RootTranslation = { * S​e​l​e​c​t​ ​a​ ​t​e​m​p​l​a​t​e​ ​t​o​ ​c​r​e​a​t​e​ ​a​ ​n​e​w​ ​b​a​s​e */ selectATemplateToCreateABase: string + /** + * I​n​c​l​u​d​e​ ​d​a​t​a​ ​f​r​o​m​ ​t​h​e​ ​t​e​m​p​l​a​t​e​ ​t​o​ ​t​h​e​ ​n​e​w​ ​b​a​s​e​ ​o​r​ ​t​a​b​l​e​. + */ + includeDataDescription: string + /** + * L​o​g​i​n​ ​t​o​ ​c​r​e​a​t​e​ ​a​ ​n​e​w​ ​b​a​s​e​ ​o​r​ ​t​a​b​l​e + */ + loginToCreateNewBaseOrTable: string } setting: { /** @@ -221,6 +253,10 @@ type RootTranslation = { systemFieldsUpdated: string } space: { + /** + * S​p​a​c​e + */ + space: string /** * S​p​a​c​e​s */ @@ -2282,6 +2318,10 @@ type RootTranslation = { * N​o​w */ now: string + /** + * I​m​p​o​r​t + */ + 'import': string } share: { /** @@ -2532,6 +2572,30 @@ export type TranslationFunctions = { enterYourWorkEmail: () => LocalizedString } template: { + /** + * Template + */ + template: () => LocalizedString + /** + * Use this template + */ + useThisTemplate: () => LocalizedString + /** + * Preview Template + */ + previewTemplate: () => LocalizedString + /** + * Get Started with this template + */ + getStarted: () => LocalizedString + /** + * Which space do you want to create this template in? + */ + whichSpace: () => LocalizedString + /** + * You can create a new base or a new table in the selected space. + */ + whichSpaceDescription: () => LocalizedString /** * Create New Base */ @@ -2540,6 +2604,14 @@ export type TranslationFunctions = { * Select a template to create a new base */ selectATemplateToCreateABase: () => LocalizedString + /** + * Include data from the template to the new base or table. + */ + includeDataDescription: () => LocalizedString + /** + * Login to create a new base or table + */ + loginToCreateNewBaseOrTable: () => LocalizedString } setting: { /** @@ -2622,6 +2694,10 @@ export type TranslationFunctions = { systemFieldsUpdated: () => LocalizedString } space: { + /** + * Space + */ + space: () => LocalizedString /** * Spaces */ @@ -4658,6 +4734,10 @@ export type TranslationFunctions = { * Now */ now: () => LocalizedString + /** + * Import + */ + 'import': () => LocalizedString } share: { /** diff --git a/packages/i18n/src/i18n/ja/index.ts b/packages/i18n/src/i18n/ja/index.ts index ae2029622..8ead27b2e 100644 --- a/packages/i18n/src/i18n/ja/index.ts +++ b/packages/i18n/src/i18n/ja/index.ts @@ -518,6 +518,7 @@ const base = { } const space = { + space: 'スペース', spaces: 'スペース', name: 'スペース名', setDisplayName: '表示名を設定', @@ -622,8 +623,16 @@ const events = { } const template = { + template: 'テンプレート', + useThisTemplate: 'このテンプレートを使用', + previewTemplate: 'テンプレートのプレビュー', + getStarted: 'このテンプレートを使用して開始', + whichSpace: "このテンプレートを作成するスペースはどれですか?", + whichSpaceDescription: "新しい Base または新しいテーブルを選択したスペースに作成できます。", createBase: 'Base を作成', - selectATemplateToCreateABase: 'テンプレートを選択して Base を作成します' + selectATemplateToCreateABase: 'テンプレートを選択して Base を作成します', + includeDataDescription: 'テンプレートのデータを新しい Base またはテーブルに含めます。', + loginToCreateNewBaseOrTable: 'ログインして新しい Base またはテーブルを作成します' } const auth = { @@ -721,7 +730,8 @@ const ja = { today: '今日', clear: 'クリア', updated: '更新済み', - now: '現在' + now: '現在', + import: 'インポート' }, share: { title: '共有', diff --git a/packages/i18n/src/i18n/ko/index.ts b/packages/i18n/src/i18n/ko/index.ts index f0c5fbefb..b58e2e77e 100644 --- a/packages/i18n/src/i18n/ko/index.ts +++ b/packages/i18n/src/i18n/ko/index.ts @@ -517,6 +517,7 @@ const base = { } const space = { + space: '공간', spaces: '공간', name: '공간 이름', setDisplayName: '표시 이름 설정', @@ -622,8 +623,16 @@ const events = { } const template = { + template: '템플릿', + useThisTemplate: '이 템플릿 사용', + previewTemplate: '템플릿 미리보기', + getStarted: '이 템플릿으로 시작', + whichSpace: "이 템플릿을 생성할 공간은 어디인가요?", + whichSpaceDescription: "새로운 Base 또는 선택한 공간에 새로운 테이블을 생성할 수 있습니다.", createBase: 'Base 생성', - selectATemplateToCreateABase: '템플릿을 선택하여 Base를 생성하세요' + selectATemplateToCreateABase: '템플릿을 선택하여 Base를 생성하세요', + includeDataDescription: '템플릿의 데이터를 새로운 Base 또는 테이블에 포함합니다.', + loginToCreateNewBaseOrTable: '로그인하여 새로운 Base 또는 테이블을 생성하세요' } const auth = { @@ -721,7 +730,8 @@ const ko = { today: '오늘', clear: '지우기', updated: '업데이트됨', - now: '지금' + now: '지금', + import: '가져오기' }, share: { title: '공유', diff --git a/packages/i18n/src/i18n/pt/index.ts b/packages/i18n/src/i18n/pt/index.ts index 4bce55eca..49859b393 100644 --- a/packages/i18n/src/i18n/pt/index.ts +++ b/packages/i18n/src/i18n/pt/index.ts @@ -526,6 +526,7 @@ const base = { } const space = { + space: 'Espaço', spaces: 'Espaços', name: "Nome do Espaço", setDisplayName: 'Definir Nome de Exibição', @@ -621,8 +622,16 @@ const events = { } const template = { + template: 'Modelo', + useThisTemplate: 'Usar este modelo', + previewTemplate: 'Visualizar modelo', + getStarted: 'Começar com este modelo', + whichSpace: 'Em qual espaço?', + whichSpaceDescription: "Você pode criar uma nova base ou uma nova tabela em um espaço selecionado.", createBase: 'Criar Nova Base', - selectATemplateToCreateABase: 'Selecione um modelo para criar uma nova base' + selectATemplateToCreateABase: 'Selecione um modelo para criar uma nova base', + includeDataDescription: 'Incluir dados do modelo na nova base ou tabela.', + loginToCreateNewBaseOrTable: 'Faça login para criar uma nova base ou tabela' } const auth = { @@ -720,7 +729,8 @@ const pt = { today: 'Hoje', clear: 'Limpar', updated: 'Atualizado', - now: 'Agora' + now: 'Agora', + import: 'Importar' }, share: { title: 'Compartilhar', diff --git a/packages/i18n/src/i18n/zh/index.ts b/packages/i18n/src/i18n/zh/index.ts index a9a5b8663..dc62ee329 100644 --- a/packages/i18n/src/i18n/zh/index.ts +++ b/packages/i18n/src/i18n/zh/index.ts @@ -517,6 +517,7 @@ const base = { } const space = { + space: '空间', spaces: '空间', name: '空间名称', setDisplayName: '设置显示名称', @@ -622,8 +623,16 @@ const events = { } const template= { + template: '模板', + useThisTemplate: '使用此模板', + previewTemplate: '预览模板', + getStarted: '从模板开始', + whichSpace: '在哪个空间?', + whichSpaceDescription: "您可以在选定的空间中创建一个新的 Base 或一个新的表。", createBase: '从模板创建 Base', - selectATemplateToCreateABase: '选择一个模板来创建一个 Base' + selectATemplateToCreateABase: '选择一个模板来创建一个 Base', + includeDataDescription: '将模板的数据包含到新的 Base 或表中。', + loginToCreateNewBaseOrTable: '登录以创建新的 Base 或表' } const auth = { @@ -723,7 +732,8 @@ const zh = { today: '今天', clear: '清除', updated: '已更新', - now: '现在' + now: '现在', + import: '导入' }, share: { title: '分享',