diff --git a/packages/nc-gui/components/account/Profile.vue b/packages/nc-gui/components/account/Profile.vue index db959d808a..b31d238b51 100644 --- a/packages/nc-gui/components/account/Profile.vue +++ b/packages/nc-gui/components/account/Profile.vue @@ -15,9 +15,9 @@ const formValidator = ref() const formRules = { title: [ - { required: true, message: t('error.nameRequired') }, - { min: 2, message: t('error.nameMinLength') }, - { max: 60, message: t('error.nameMaxLength') }, + { required: true, message: t('msg.error.nameRequired') }, + { min: 2, message: t('msg.error.nameMinLength') }, + { max: 60, message: t('msg.error.nameMaxLength') }, ], } diff --git a/packages/nc-gui/components/api-client/Headers.vue b/packages/nc-gui/components/api-client/Headers.vue index ad4f826526..9b58046552 100644 --- a/packages/nc-gui/components/api-client/Headers.vue +++ b/packages/nc-gui/components/api-client/Headers.vue @@ -66,10 +66,10 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase -
Header Name
+
{{ $t('labels.headerName') }}
-
Value
+
{{ $t('placeholder.value') }}
@@ -87,9 +87,9 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase @@ -97,7 +97,11 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase - + @@ -120,7 +124,7 @@ const filterOption = (input: string, option: Option) => option.value.toUpperCase
-
Add Header
+
{{ $t('labels.addHeader') }}
diff --git a/packages/nc-gui/components/api-client/Params.vue b/packages/nc-gui/components/api-client/Params.vue index 61aa3f1f2c..66a2e79336 100644 --- a/packages/nc-gui/components/api-client/Params.vue +++ b/packages/nc-gui/components/api-client/Params.vue @@ -24,11 +24,11 @@ const deleteParamRow = (i: number) => { -
Parameter Name
+
{{ $t('title.parameterName') }}
-
Value
+
{{ $t('placeholder.value') }}
@@ -41,13 +41,13 @@ const deleteParamRow = (i: number) => { - + - + @@ -69,7 +69,7 @@ const deleteParamRow = (i: number) => {
-
Add Parameter
+
{{ $t('activity.addParameter') }}
diff --git a/packages/nc-gui/components/cell/Currency.vue b/packages/nc-gui/components/cell/Currency.vue index fc67d9274a..1b5d363969 100644 --- a/packages/nc-gui/components/cell/Currency.vue +++ b/packages/nc-gui/components/cell/Currency.vue @@ -79,7 +79,7 @@ onMounted(() => { v-model="vModel" type="number" class="w-full h-full text-sm border-none rounded-md outline-none" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="submitCurrency" @keydown.down.stop @keydown.left.stop @@ -93,7 +93,7 @@ onMounted(() => { @contextmenu.stop /> - NULL + {{ $t('general.null') }} {{ currency }} diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index 991fa52903..e1f2f79433 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -25,6 +25,8 @@ const { modelValue, isPk } = defineProps() const emit = defineEmits(['update:modelValue']) +const { t } = useI18n() + const { showNull } = useGlobal() const columnMeta = inject(ColumnInj, null)! @@ -84,11 +86,11 @@ watch( const placeholder = computed(() => { if (isEditColumn.value && (modelValue === '' || modelValue === null)) { - return '(Optional)' + return t('labels.optional') } else if (modelValue === null && showNull.value) { - return 'NULL' + return t('general.null') } else if (isDateInvalid.value) { - return 'Invalid date' + return t('msg.invalidDate') } else { return '' } diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue index c0a3960d23..2b371829dd 100644 --- a/packages/nc-gui/components/cell/DateTimePicker.vue +++ b/packages/nc-gui/components/cell/DateTimePicker.vue @@ -40,6 +40,8 @@ const editable = inject(EditModeInj, ref(false)) const isLockedMode = inject(IsLockedInj, ref(false)) +const { t } = useI18n() + const isEditColumn = inject(EditColumnInj, ref(false)) const column = inject(ColumnInj)! @@ -137,11 +139,11 @@ watch( const placeholder = computed(() => { if (isEditColumn.value && (modelValue === '' || modelValue === null)) { - return '(Optional)' + return t('labels.optional') } else if (modelValue === null && showNull.value) { - return 'NULL' + return t('general.null') } else if (isDateInvalid.value) { - return 'Invalid date' + return t('msg.invalidDate') } else { return '' } diff --git a/packages/nc-gui/components/cell/Decimal.vue b/packages/nc-gui/components/cell/Decimal.vue index 547f14a227..80a7e9fc01 100644 --- a/packages/nc-gui/components/cell/Decimal.vue +++ b/packages/nc-gui/components/cell/Decimal.vue @@ -97,7 +97,7 @@ watch(isExpandedFormOpen, () => { class="outline-none !py-2 !px-1 border-none rounded-md w-full h-full !text-sm" type="number" :step="precision" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" style="letter-spacing: 0.06rem" @blur="editEnabled = false" @keydown.down.stop="onKeyDown" @@ -110,7 +110,7 @@ watch(isExpandedFormOpen, () => { @selectstart.capture.stop @mousedown.stop /> - NULL + {{ $t('general.null') }} {{ displayValue }} diff --git a/packages/nc-gui/components/cell/Duration.vue b/packages/nc-gui/components/cell/Duration.vue index 34cc923bf1..c3bc7bb3ea 100644 --- a/packages/nc-gui/components/cell/Duration.vue +++ b/packages/nc-gui/components/cell/Duration.vue @@ -23,6 +23,8 @@ const { modelValue, showValidationError = true } = defineProps() const emit = defineEmits(['update:modelValue']) +const { t } = useI18n() + const { showNull } = useGlobal() const column = inject(ColumnInj) @@ -39,7 +41,9 @@ const isEditColumn = inject(EditColumnInj, ref(false)) const durationType = computed(() => parseProp(column?.value?.meta)?.duration || 0) -const durationPlaceholder = computed(() => (isEditColumn.value ? '(Optional)' : durationOptions[durationType.value].title)) +const durationPlaceholder = computed(() => + isEditColumn.value ? `(${t('labels.optional')})` : durationOptions[durationType.value].title, +) const localState = computed({ get: () => convertMS2Duration(modelValue, durationType.value), @@ -105,13 +109,12 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value @mousedown.stop /> - NULL + {{ $t('general.null') }} {{ localState }}
- - Please enter a number + {{ $t('msg.plsEnterANumber') }}
diff --git a/packages/nc-gui/components/cell/Email.vue b/packages/nc-gui/components/cell/Email.vue index 434dd0a1fc..385fecb852 100644 --- a/packages/nc-gui/components/cell/Email.vue +++ b/packages/nc-gui/components/cell/Email.vue @@ -71,7 +71,7 @@ watch( :ref="focus" v-model="vModel" class="w-full outline-none text-sm px-1 py-2" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.down.stop @keydown.left.stop @@ -84,7 +84,7 @@ watch( @mousedown.stop /> - NULL + {{ $t('general.null') }} !isExpandedFormOpen.value && !isEditColumn.value class="outline-none px-1 border-none w-full h-full text-sm" type="number" step="0.1" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.down.stop @keydown.left.stop @@ -63,7 +63,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value @selectstart.capture.stop @mousedown.stop /> - NULL + {{ $t('general.null') }} {{ vModel }} diff --git a/packages/nc-gui/components/cell/Integer.vue b/packages/nc-gui/components/cell/Integer.vue index 477232670a..16a2597c32 100644 --- a/packages/nc-gui/components/cell/Integer.vue +++ b/packages/nc-gui/components/cell/Integer.vue @@ -88,7 +88,7 @@ function onKeyDown(e: any) { class="outline-none py-2 px-1 border-none w-full h-full text-sm" type="number" style="letter-spacing: 0.06rem" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown="onKeyDown" @keydown.down.stop @@ -99,7 +99,7 @@ function onKeyDown(e: any) { @selectstart.capture.stop @mousedown.stop /> - NULL + {{ $t('general.null') }} {{ displayValue }} diff --git a/packages/nc-gui/components/cell/Json.vue b/packages/nc-gui/components/cell/Json.vue index 21307ad536..fa28ad10a0 100644 --- a/packages/nc-gui/components/cell/Json.vue +++ b/packages/nc-gui/components/cell/Json.vue @@ -150,10 +150,12 @@ useSelectedCellKeyupListener(active, (e) => {
-
Cancel
+
{{ $t('general.cancel') }}
-
Save
+
{{ $t('general.save') }}
@@ -172,7 +174,7 @@ useSelectedCellKeyupListener(active, (e) => { - NULL + {{ $t('general.null') }} {{ vModel }} diff --git a/packages/nc-gui/components/cell/MultiSelect.vue b/packages/nc-gui/components/cell/MultiSelect.vue index ae68ab7aad..eafeca7270 100644 --- a/packages/nc-gui/components/cell/MultiSelect.vue +++ b/packages/nc-gui/components/cell/MultiSelect.vue @@ -378,7 +378,7 @@ const selectedOpts = computed(() => { v-model:value="vModel" mode="multiple" class="w-full overflow-hidden" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" :bordered="false" clear-icon show-search @@ -421,7 +421,7 @@ const selectedOpts = computed(() => {
- Create new option named {{ searchVal }} + {{ $t('msg.selectOption.createNewOptionNamed') }} {{ searchVal }}
diff --git a/packages/nc-gui/components/cell/Percent.vue b/packages/nc-gui/components/cell/Percent.vue index 5fec5b0412..55b6188e56 100644 --- a/packages/nc-gui/components/cell/Percent.vue +++ b/packages/nc-gui/components/cell/Percent.vue @@ -42,7 +42,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value class="w-full !text-sm !border-none !outline-none focus:ring-0 text-base p-1" :class="{ '!px-2': editEnabled }" type="number" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.down.stop @keydown.left.stop @@ -54,6 +54,6 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value @selectstart.capture.stop @mousedown.stop /> - NULL + {{ $t('general.null') }} {{ vModel }} diff --git a/packages/nc-gui/components/cell/PhoneNumber.vue b/packages/nc-gui/components/cell/PhoneNumber.vue index 42f2f37f25..24c3c8ef36 100644 --- a/packages/nc-gui/components/cell/PhoneNumber.vue +++ b/packages/nc-gui/components/cell/PhoneNumber.vue @@ -15,6 +15,8 @@ const rowHeight = inject(RowHeightInj, ref(undefined)) const { showNull } = useGlobal() +const { t } = useI18n() + const editEnabled = inject(EditModeInj)! const isEditColumn = inject(EditColumnInj, ref(false)) @@ -46,7 +48,7 @@ watch( () => editEnabled.value, () => { if (parseProp(column.value.meta)?.validate && !editEnabled.value && localState.value && !isMobilePhone(localState.value)) { - message.error('Invalid Phone Number') + message.error(t('msg.invalidPhoneNumber')) localState.value = undefined return } @@ -61,7 +63,7 @@ watch( :ref="focus" v-model="vModel" class="w-full outline-none text-sm px-1 py-2" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.down.stop @keydown.left.stop @@ -74,7 +76,7 @@ watch( @mousedown.stop /> - NULL + {{ $t('general.null') }} diff --git a/packages/nc-gui/components/cell/SingleSelect.vue b/packages/nc-gui/components/cell/SingleSelect.vue index 4e357d1cb2..5c0475addf 100644 --- a/packages/nc-gui/components/cell/SingleSelect.vue +++ b/packages/nc-gui/components/cell/SingleSelect.vue @@ -286,7 +286,7 @@ const selectedOpt = computed(() => { v-model:value="vModel" class="w-full overflow-hidden" :class="{ 'caret-transparent': !hasEditRoles }" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" :allow-clear="!column.rqd && editAllowed" :bordered="false" :open="isOpen && editAllowed" @@ -324,7 +324,7 @@ const selectedOpt = computed(() => {
- Create new option named {{ searchVal }} + {{ $t('msg.selectOption.createNewOptionNamed') }} {{ searchVal }}
diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index 9fc0b9209e..cd7b6efaf8 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -33,7 +33,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value :ref="focus" v-model="vModel" class="h-full w-full outline-none p-2 bg-transparent" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.down.stop @keydown.left.stop @@ -46,7 +46,7 @@ const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value @mousedown.stop /> - NULL + {{ $t('general.null') }} diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index 0ebd53ae86..e387dbe90e 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -84,7 +84,7 @@ onClickOutside(inputWrapperRef, (e) => { :style="{ minHeight: `${height}px`, }" - :placeholder="isEditColumn ? '(Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.optional') : ''" @blur="editEnabled = false" @keydown.alt.enter.stop @keydown.shift.enter.stop @@ -99,7 +99,7 @@ onClickOutside(inputWrapperRef, (e) => { @mousedown.stop /> - NULL + {{ $t('general.null') }} @@ -113,7 +113,7 @@ onClickOutside(inputWrapperRef, (e) => { @click.stop="isVisible = !isVisible" > - + { { if (isEditColumn.value && (modelValue === '' || modelValue === null)) { - return '(Optional)' + return t('labels.optional') } else if (modelValue === null && showNull.value) { - return 'NULL' + return t('general.null') } else if (isTimeInvalid.value) { - return 'Invalid time' + return t('msg.invalidTime') } else { return '' } diff --git a/packages/nc-gui/components/cell/Url.vue b/packages/nc-gui/components/cell/Url.vue index 6243e473bf..cd6d15077e 100644 --- a/packages/nc-gui/components/cell/Url.vue +++ b/packages/nc-gui/components/cell/Url.vue @@ -91,7 +91,7 @@ watch( v-if="editEnabled" :ref="focus" v-model="vModel" - :placeholder="isEditColumn ? 'Enter default URL (Optional)' : ''" + :placeholder="isEditColumn ? $t('labels.enterDefaultUrlOptional') : ''" class="outline-none text-sm w-full px-2 py-2 bg-transparent h-full" @blur="editEnabled = false" @keydown.down.stop @@ -105,7 +105,7 @@ watch( @mousedown.stop /> - NULL + $t('general.null') { if (isEditColumn.value && (modelValue === '' || modelValue === null)) { - return '(Optional)' + return t('labels.optional') } else if (modelValue === null && showNull.value) { - return 'NULL' + return t('general.null') } else if (isYearInvalid.value) { - return 'Invalid year' + return t('msg.invalidTime') } else { return '' } diff --git a/packages/nc-gui/components/shared-view/AskPassword.vue b/packages/nc-gui/components/shared-view/AskPassword.vue index e695823186..5c3abcfedf 100644 --- a/packages/nc-gui/components/shared-view/AskPassword.vue +++ b/packages/nc-gui/components/shared-view/AskPassword.vue @@ -35,27 +35,27 @@ const focus: VNodeRef = (el: typeof InputPassword) => el?.$el?.querySelector('in
- +
Unlock - + >{{ $t('general.unlock') }} +
diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue index 6b33c990b7..84d5806d4d 100644 --- a/packages/nc-gui/components/smartsheet/Form.vue +++ b/packages/nc-gui/components/smartsheet/Form.vue @@ -389,8 +389,10 @@ watch(view, (nextView) => {