From 289fd708db9789b292934bef354f187a58040302 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 28 Sep 2023 12:28:20 +0530 Subject: [PATCH] fix: i18n for View node, create and duplicate modal --- .../dashboard/TreeView/ViewsList.vue | 7 +++-- .../dashboard/TreeView/ViewsNode.vue | 6 ++-- packages/nc-gui/components/dlg/ViewCreate.vue | 29 ++++++++++++++----- packages/nc-gui/lang/en.json | 14 +++++++++ 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue b/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue index ad527ec940..f19692956b 100644 --- a/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue +++ b/packages/nc-gui/components/dashboard/TreeView/ViewsList.vue @@ -34,6 +34,7 @@ const table = inject(SidebarTableInj)! const { isMobileMode } = useGlobal() const { $e } = useNuxtApp() +const { t } = useI18n() const isDefaultBase = computed(() => { const base = project.value?.bases?.find((b) => b.id === table.value.base_id) @@ -84,11 +85,11 @@ function markItem(id: string) { /** validate view title */ function validate(view: ViewType) { if (!view.title || view.title.trim().length < 0) { - return 'View name is required' + return t('msg.error.viewNameRequired') } if (views.value.some((v) => v.title === view.title && v.id !== view.id)) { - return 'View name should be unique' + return t('msg.error.viewNameDuplicate') } return true @@ -357,7 +358,7 @@ function onOpenModal({ 'ml-24.75': !isDefaultBase, }" > - No Views + {{ $t('labels.noViews') }} -
Rename
+
{{ $t('general.rename') }}
- Duplicate + {{ $t('general.duplicate') }} @@ -298,7 +298,7 @@ function onRef(el: HTMLElement) { diff --git a/packages/nc-gui/components/dlg/ViewCreate.vue b/packages/nc-gui/components/dlg/ViewCreate.vue index ff637050ba..ce6f815606 100644 --- a/packages/nc-gui/components/dlg/ViewCreate.vue +++ b/packages/nc-gui/components/dlg/ViewCreate.vue @@ -238,8 +238,21 @@ onMounted(async () => {
@@ -266,8 +279,8 @@ onMounted(async () => { :disabled="groupingFieldColumnId || isMetaLoading" :loading="isMetaLoading" :options="viewSelectFieldOptions" - placeholder="Select a Grouping Field" - not-found-content="No Single Select Field can be found. Please create one first." + :placeholder="$t('placeholder.selectGroupField')" + :not-found-content="$t('placeholder.selectGroupFieldNotFound')" /> { :options="viewSelectFieldOptions" :disabled="groupingFieldColumnId || isMetaLoading" :loading="isMetaLoading" - placeholder="Select a GeoData Field" - not-found-content="No GeoData Field can be found. Please create one first." + :placeholder="$t('placeholder.selectGeoField')" + :not-found-content="$t('placeholder.selectGeoFieldNotFound')" /> @@ -294,8 +307,8 @@ onMounted(async () => { - Create View - + {{ $t('labels.createView') }} +
diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 0d138e9756..e4df5a8e0e 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -313,6 +313,14 @@ "profile": "Profile", "tableName": "Table name", "dashboardName": "Dashboard name", + "noViews": "No views", + "createView": "Create a View", + "creatingView": "Creating View", + "duplicateView": "Duplicate view", + "duplicateGridView": "Duplicate Grid View", + "duplicateGalleryView": "Duplicate Gallery View", + "duplicateFormView": "Duplicate Form View", + "duplicateKanbanView": "Duplicate Kanban View", "viewName": "View name", "viewLink": "View Link", "columnName": "Column Name", @@ -632,6 +640,10 @@ }, "placeholder": { "projName": "Enter Project Name", + "selectGroupField": "Select a Grouping Field", + "selectGroupFieldNotFound" : "No Single Select Field can be found. Please create one first.", + "selectGeoField": "Select a GeoData Field", + "selectGeoFieldNotFound": "No GeoData Field can be found. Please create one first.", "password": { "enter": "Enter the password", "current": "Current password", @@ -811,6 +823,8 @@ "noMoreRecords": "No more records" }, "error": { + "viewNameRequired": "View name is required", + "viewNameUnique": "View name should be unique", "searchProject": "Your search for {search} found no results", "invalidChar": "Invalid character in folder path.", "invalidDbCredentials": "Invalid database credentials.",