Browse Source

fix(nc-gui): i18n for aettings and page

pull/6614/head
reenphygeorge 1 year ago
parent
commit
9bd231bf40
  1. 4
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  2. 31
      packages/nc-gui/components/workspace/Settings.vue
  3. 15
      packages/nc-gui/lang/en.json
  4. 5
      packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue
  5. 7
      packages/nc-gui/pages/reset/[id].vue

4
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -346,7 +346,7 @@ useActiveKeyupListener(
await Modal.confirm({
title: t('msg.saveChanges'),
okText: t('general.save'),
cancelText: t('label.discard'),
cancelText: t('labels.discard'),
onOk: async () => {
await save()
reloadHook?.trigger(null)
@ -360,7 +360,7 @@ useActiveKeyupListener(
await Modal.confirm({
title: 'Do you want to save the record?',
okText: t('general.save'),
cancelText: t('label.discard'),
cancelText: t('labels.discard'),
onOk: async () => {
const data = await _save(rowState.value)
await syncLTARRefs(data)

31
packages/nc-gui/components/workspace/Settings.vue

@ -1,5 +1,8 @@
<script lang="ts" setup>
import { useI18n } from '#imports'
const { signOut } = useGlobal()
const { t } = useI18n()
const { deleteWorkspace, navigateToWorkspace, updateWorkspace } = useWorkspace()
const { workspacesList, activeWorkspaceId, activeWorkspace, workspaces } = storeToRefs(useWorkspace())
@ -17,9 +20,9 @@ const form = ref({
const formRules = {
title: [
{ required: true, message: 'Workspace name required' },
{ min: 3, message: 'Workspace name must be at least 3 characters long' },
{ max: 50, message: 'Workspace name must be at most 50 characters long' },
{ required: true, message: t('msg.wsNameRequired') },
{ min: 3, message: t('msg.wsNameMinLength') },
{ max: 50, message: t('msg.wsNameMaxLength') },
],
}
@ -104,9 +107,9 @@ const onCancel = () => {
<template>
<div class="flex flex-col items-center nc-workspace-settings-settings">
<div class="item flex flex-col w-full">
<div class="font-medium text-base">Change Workspace Name</div>
<div class="font-medium text-base">{{ $t('labels.changeWsName') }}</div>
<a-form ref="formValidator" layout="vertical" no-style :model="form" class="w-full" @finish="titleChange">
<div class="text-gray-500 mt-6 mb-1.5">Workspace name</div>
<div class="text-gray-500 mt-6 mb-1.5">{{ $t('objects.workspace') $t('general.name')}}</div>
<a-form-item name="title" :rules="formRules.title">
<a-input
v-model:value="form.title"
@ -123,8 +126,8 @@ const onCancel = () => {
data-testid="nc-workspace-settings-settings-rename-cancel"
@click="onCancel"
>
<template #loading> Renaming Workspace </template>
Cancel
<template #loading> {{ $t('title.renamingWs') }} </template>
{{ $t('general.cancel') }}
</NcButton>
<NcButton
v-e="['c:workspace:settings:rename']"
@ -134,18 +137,18 @@ const onCancel = () => {
:loading="isDeleting"
data-testid="nc-workspace-settings-settings-rename-submit"
>
<template #loading> Renaming Workspace </template>
Rename Workspace
<template #loading> {{ $t('title.renamingWs') }} </template>
{{ $t('title.renameWs') }}
</NcButton>
</div>
</a-form>
</div>
<div class="item flex flex-col">
<div class="font-medium text-base">Delete Workspace</div>
<div class="text-gray-500 mt-2">Delete this workspace and all its contents.</div>
<div class="font-medium text-base">{{ $t('title.deleteWs') }}</div>
<div class="text-gray-500 mt-2">{{ $t('msg.wsDeleteDlg') }}</div>
<div class="flex flex-row mt-8 gap-x-2">
<a-checkbox v-model:checked="isConfirmed" />
<div class="flex">I understand that this action is irreversible</div>
<div class="flex">{{ $t('msg.userConfirmation') }}</div>
</div>
<div class="flex flex-row w-full justify-end mt-8">
@ -156,8 +159,8 @@ const onCancel = () => {
:loading="isDeleting"
@click="onDelete"
>
<template #loading> Deleting Workspace </template>
Delete Workspace
<template #loading> {{ $t('title.deletingWs') }} </template>
{{ $t('title.deleteWs') }}
</NcButton>
</div>
</div>

15
packages/nc-gui/lang/en.json

@ -319,6 +319,10 @@
"downloadFile": "Download File",
"renameTable": "Rename Table",
"renamingTable": "Renaming Table",
"renamingWs": "Renaming Workspace",
"renameWs": "Rename Workspace",
"deleteWs": "Delete Workspace",
"deletingWs": "Deleting Workspace",
"copyAuthToken": "Copy Auth Token",
"copiedAuthToken": "Copied Auth Token",
"copyInviteToken": "Copy Invite Token",
@ -598,7 +602,8 @@
"zoomInToViewColumns": "Zoom in to view columns",
"embedInSite": "Embed this view in your site",
"titleRequired": "title is required.",
"sourceNameRequired":"Source name is required"
"sourceNameRequired":"Source name is required",
"changeWsName":"Change Workspace Name",
},
"activity": {
"onCondition": "On Condition",
@ -1141,7 +1146,13 @@
"noMoreRecords": "No more records",
"tokenNameNotEmpty": "Token name should not be empty",
"tokenNameMaxLength": "Token name should not be more than 255 characters",
"dbNamerequired": "Database name is required"
"dbNamerequired": "Database name is required",
"wsNameRequired":"Workspace name required",
"wsNameMinLength":"Workspace name must be at least 3 characters long",
"wsNameMaxLength":"Workspace name must be at most 50 characters long",
"wsDeleteDlg": "Delete this workspace and all it’s contents.",
"userConfirmation": "I understand that this action is irreversible",
"pageNotFound":"Page Not Found"
},
"error": {
"nameRequired": "Name Required",

5
packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue

@ -17,6 +17,7 @@ import {
useRoute,
useSidebar,
watch,
useI18n
} from '#imports'
definePageMeta({
@ -27,6 +28,8 @@ useSidebar('nc-left-sidebar', { hasSidebar: false })
const route = useRoute()
const { t } = useI18n()
const { loadSharedView, sharedView, sharedViewMeta, meta, notFound, password, passwordDlg, passwordError } =
useProvideSharedFormStore(route.params.viewId as string)
@ -43,7 +46,7 @@ if (!notFound.value) {
applyLanguageDirection(sharedViewMeta.value.rtl ? 'rtl' : 'ltr')
} else {
navigateTo('/error/404')
throw createError({ statusCode: 404, statusMessage: 'Page Not Found' })
throw createError({ statusCode: 404, statusMessage: t('msg.pageNotFound') })
}
const form = reactive({

7
packages/nc-gui/pages/reset/[id].vue

@ -10,6 +10,7 @@ import {
useApi,
useRoute,
useRouter,
useI18n
} from '#imports'
definePageMeta({
@ -18,6 +19,8 @@ definePageMeta({
const { api, isLoading, error } = useApi()
const { t } = useI18n()
const route = useRoute()
const navigator = useRouter()
@ -88,7 +91,7 @@ function resetError() {
<a-form-item
:label="$t('placeholder.password.new')"
name="password"
:rules="[{ required: true, message: 'password is required' }]"
:rules="[{ required: true, message: t('error.passwdRequired') }]"
>
<a-input-password
v-model:value="form.password"
@ -101,7 +104,7 @@ function resetError() {
<a-form-item
:label="$t('placeholder.password.confirm')"
name="newPassword"
:rules="[{ required: true, message: 'password is required' }]"
:rules="[{ required: true, message: t('error.passwdRequired') }]"
>
<a-input-password
v-model:value="form.newPassword"

Loading…
Cancel
Save