Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat: add localization support for multiple languages and update locale keys (#7155)

白熱80582bb4e398
diff --git a/packages/docs-ui/src/views/PageSettings.tsx b/packages/docs-ui/src/views/PageSettings.tsx
index 20caed71ce..01d2e0a3ba 100644
--- a/packages/docs-ui/src/views/PageSettings.tsx
+++ b/packages/docs-ui/src/views/PageSettings.tsx
@@ -17,7 +17,18 @@
import type { DocumentDataModel, ISize, PaperType } from '@univerjs/core';
import type { IConfirmChildrenProps } from '@univerjs/ui';
import type { ReactNode } from 'react';
-import { DocumentFlavor, IUniverInstanceService, LocaleService, MODERN_DOCUMENT_WIDTH, ModernDocumentWidthMode, PAGE_SIZE, PageOrientType, PAPER_TYPES, UniverInstanceType } from '@univerjs/core';
+import type { LocaleKey } from '../locale/types';
+import {
+ DocumentFlavor,
+ IUniverInstanceService,
+ LocaleService,
+ MODERN_DOCUMENT_WIDTH,
+ ModernDocumentWidthMode,
+ PAGE_SIZE,
+ PageOrientType,
+ PAPER_TYPES,
+ UniverInstanceType,
+} from '@univerjs/core';
import { clsx, InputNumber, Select } from '@univerjs/design';
import { useDependency } from '@univerjs/ui';
import { useEffect, useState } from 'react';
@@ -172,7 +183,7 @@ export function PageSettings(props: IConfirmChildrenProps) {
})}
onClick={() => handleModeChange(mode)}
>
- {localeService.t(mode === DocumentFlavor.MODERN ? 'docs-ui.page-settings.modern-mode' : 'docs-ui.page-settings.classic-mode')}
+ {localeService.t<LocaleKey>(mode === DocumentFlavor.MODERN ? 'docs-ui.page-settings.modern-mode' : 'docs-ui.page-settings.classic-mode')}
</button>
))}
</div>
@@ -180,7 +191,7 @@ export function PageSettings(props: IConfirmChildrenProps) {
{settings.mode === DocumentFlavor.MODERN
? (
<div className="univer-flex univer-flex-col univer-gap-2.5">
- <SettingsLabel>{localeService.t('docs-ui.page-settings.modern-width')}</SettingsLabel>
+ <SettingsLabel>{localeService.t<LocaleKey>('docs-ui.page-settings.modern-width')}</SettingsLabel>
<div className="univer-grid univer-grid-cols-3 univer-gap-2">
{MODERN_WIDTH_OPTIONS.map((option) => (
<button
@@ -211,7 +222,9 @@ export function PageSettings(props: IConfirmChildrenProps) {
: (
<>
<div className="univer-flex univer-flex-col univer-gap-2">
- <SettingsLabel>{localeService.t('docs-ui.page-settings.paper-size')}</SettingsLabel>
+ <SettingsLabel>
+ {localeService.t<LocaleKey>('docs-ui.page-settings.paper-size')}
+ </SettingsLabel>
<Select
value={settings.paperSize}
onChange={handlePaperSizeChange}
@@ -223,11 +236,13 @@ export function PageSettings(props: IConfirmChildrenProps) {
</div>
<div className="univer-flex univer-flex-col univer-gap-2">
- <SettingsLabel>{localeService.t('docs-ui.page-settings.custom-paper-size')}</SettingsLabel>
+ <SettingsLabel>{localeService.t<LocaleKey>('docs-ui.page-settings.custom-paper-size')}</SettingsLabel>
<div className="univer-flex univer-flex-col univer-gap-2.5">
<div className="univer-flex univer-gap-2.5">
<div className="univer-flex univer-flex-1 univer-flex-col univer-gap-2">
- <SettingsLabel muted>{localeService.t('docs-ui.page-settings.top')}</SettingsLabel>
+ <SettingsLabel muted>
+ {localeService.t<LocaleKey>('docs-ui.page-settings.top')}
+ </SettingsLabel>
<InputNumber
precision={2}
min={0}
@@ -237,7 +252,9 @@ export function PageSettings(props: IConfirmChildrenProps) {
/>
</div>
<div className="univer-flex univer-flex-1 univer-flex-col univer-gap-2">
- <SettingsLabel muted>{localeService.t('docs-ui.page-settings.bottom')}</SettingsLabel>
+ <SettingsLabel muted>
+ {localeService.t<LocaleKey>('docs-ui.page-settings.bottom')}
+ </SettingsLabel>
<InputNumber
precision={2}
min={0}
@@ -249,7 +266,9 @@ export function PageSettings(props: IConfirmChildrenProps) {
</div>
<div className="univer-flex univer-gap-2.5">
<div className="univer-flex univer-flex-1 univer-flex-col univer-gap-2">
- <SettingsLabel muted>{localeService.t('docs-ui.page-settings.left')}</SettingsLabel>
+ <SettingsLabel muted>
+ {localeService.t<LocaleKey>('docs-ui.page-settings.left')}
+ </SettingsLabel>
<InputNumber
precision={2}
min={0}
@@ -259,7 +278,9 @@ export function PageSettings(props: IConfirmChildrenProps) {
/>
</div>
<div className="univer-flex univer-flex-1 univer-flex-col univer-gap-2">
- <SettingsLabel muted>{localeService.t('docs-ui.page-settings.right')}</SettingsLabel>
+ <SettingsLabel muted>
+ {localeService.t<LocaleKey>('docs-ui.page-settings.right')}
+ </SettingsLabel>
<InputNumber
precision={2}
min={0}
diff --git a/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx b/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
index 63472bb8e1..c8aecbc0e9 100644
--- a/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
+++ b/packages/drawing-ui/src/views/image-popup-menu/ImagePopupMenu.tsx
@@ -16,6 +16,7 @@
import type { DocumentDataModel } from '@univerjs/core';
import type { ReactNode } from 'react';
+import type { LocaleKey } from '../../locale/types';
import {
BooleanNumber,
ICommandService,
@@ -30,7 +31,7 @@ import { useDependency } from '@univerjs/ui';
import { useState } from 'react';
export interface IImagePopupMenuItem {
- label: string;
+ label: LocaleKey;
index: number;
commandId: string;
commandParams?: object;
@@ -108,7 +109,7 @@ export function ImagePopupMenu(props: IImagePopupMenuProps) {
align="start"
items={menuItems.map((item) => ({
type: 'item',
- children: localeService.t(item.label),
+ children: localeService.t<LocaleKey>(item.label),
disabled: item.disable,
onSelect: () => handleClick(item),
}))}
@@ -300,27 +301,27 @@ function DocImageFloatingToolbar(props: IDocImageFloatingToolbarProps) {
const deleteItem = getMenuItem('drawing-ui.image-popup.delete');
const wrappingStyleOptions = [
{
- label: localeService.t('drawing-ui.image-text-wrap.inline'),
+ label: localeService.t<LocaleKey>('drawing-ui.image-text-wrap.inline'),
value: TextWrappingStyle.INLINE,
icon: <TextWrapShapeIcon />,
},
{
- label: localeService.t('drawing-ui.image-text-wrap.square'),
+ label: localeService.t<LocaleKey>('drawing-ui.image-text-wrap.square'),
value: TextWrappingStyle.WRAP_SQUARE,
icon: <TextWrapShapeIcon />,
},
{
- label: localeService.t('drawing-ui.image-text-wrap.topAndBottom'),
+ label: localeService.t<LocaleKey>('drawing-ui.image-text-wrap.topAndBottom'),
value: TextWrappingStyle.WRAP_TOP_AND_BOTTOM,
icon: <TextWrapShapeIcon />,
},
{
- label: localeService.t('drawing-ui.image-text-wrap.behindText'),
+ label: localeService.t<LocaleKey>('drawing-ui.image-text-wrap.behindText'),
value: TextWrappingStyle.BEHIND_TEXT,
icon: <TextWrapShapeIcon />,
},
{
- label: localeService.t('drawing-ui.image-text-wrap.inFrontText'),
+ label: localeService.t<LocaleKey>('drawing-ui.image-text-wrap.inFrontText'),
value: TextWrappingStyle.IN_FRONT_OF_TEXT,
icon: <TextWrapShapeIcon />,
},
@@ -362,7 +363,7 @@ function DocImageFloatingToolbar(props: IDocImageFloatingToolbarProps) {
>
<ToolbarGroup>
<ToolbarDropdownButton
- title={wrappingStyleOptions.find((option) => option.value === wrappingStyle)?.label ?? localeService.t('drawing-ui.image-text-wrap.inline')}
+ title={wrappingStyleOptions.find((option) => option.value === wrappingStyle)?.label ?? localeService.t<LocaleKey>('drawing-ui.image-text-wrap.inline')}
value={wrappingStyle}
options={wrappingStyleOptions}
onChange={updateWrappingStyle}
@@ -371,7 +372,7 @@ function DocImageFloatingToolbar(props: IDocImageFloatingToolbarProps) {
<Separator orientation="vertical" />
<ToolbarGroup>
<ToolbarButton
- title={editItem ? localeService.t(editItem.label) : localeService.t('drawing-ui.image-popup.edit')}
+ title={editItem ? localeService.t<LocaleKey>(editItem.label) : localeService.t<LocaleKey>('drawing-ui.image-popup.edit')}
disabled={!editItem || editItem.disable}
onClick={() => {
setHidden(true);
@@ -381,7 +382,7 @@ function DocImageFloatingToolbar(props: IDocImageFloatingToolbarProps) {
<DocSettingIcon />
</ToolbarButton>
<ToolbarButton
- title={cropItem ? localeService.t(cropItem.label) : localeService.t('drawing-ui.image-popup.crop')}
+ title={cropItem ? localeService.t<LocaleKey>(cropItem.label) : localeService.t<LocaleKey>('drawing-ui.image-popup.crop')}
disabled={!cropItem || cropItem.disable}
onClick={() => executeMenuItem(cropItem)}
>
@@ -391,7 +392,7 @@ function DocImageFloatingToolbar(props: IDocImageFloatingToolbarProps) {
<Separator orientation="vertical" />
<ToolbarGroup>
<ToolbarButton
- title={deleteItem ? localeService.t(deleteItem.label) : localeService.t('drawing-ui.image-popup.delete')}
+ title={deleteItem ? localeService.t<LocaleKey>(deleteItem.label) : localeService.t<LocaleKey>('drawing-ui.image-popup.delete')}
disabled={!deleteItem || deleteItem.disable}
onClick={() => executeMenuItem(deleteItem)}
>
diff --git a/packages/find-replace/src/commands/commands/replace.command.ts b/packages/find-replace/src/commands/commands/replace.command.ts
index 9e7c9ac70e..7024bf94be 100644
--- a/packages/find-replace/src/commands/commands/replace.command.ts
+++ b/packages/find-replace/src/commands/commands/replace.command.ts
@@ -15,6 +15,7 @@
*/
import type { ICommand } from '@univerjs/core';
+import type { LocaleKey } from '../../locale/types';
import { CommandType, IConfirmService, LocaleService } from '@univerjs/core';
import { MessageType } from '@univerjs/design';
import { IMessageService } from '@univerjs/ui';
@@ -41,9 +42,9 @@ export const ReplaceAllMatchesCommand: ICommand = {
if (!await confirmService.confirm({
id: CONFIRM_REPLACE_ALL_ID,
- title: { title: localeService.t('find-replace.replace.confirm.title') },
- cancelText: localeService.t('find-replace.button.cancel'),
- confirmText: localeService.t('find-replace.button.confirm'),
+ title: { title: localeService.t<LocaleKey>('find-replace.replace.confirm.title') },
+ cancelText: localeService.t<LocaleKey>('find-replace.button.cancel'),
+ confirmText: localeService.t<LocaleKey>('find-replace.button.confirm'),
})) {
return false;
}
@@ -56,12 +57,12 @@ export const ReplaceAllMatchesCommand: ICommand = {
if (success === 0) {
messageService.show({
type: MessageType.Error,
- content: localeService.t('find-replace.replace.all-failure'),
+ content: localeService.t<LocaleKey>('find-replace.replace.all-failure'),
});
} else {
messageService.show({
type: MessageType.Warning,
- content: localeService.t('find-replace.replace.partial-success', `${success}`, `${failure}`),
+ content: localeService.t<LocaleKey>('find-replace.replace.partial-success', `${success}`, `${failure}`),
});
}
@@ -70,7 +71,7 @@ export const ReplaceAllMatchesCommand: ICommand = {
messageService.show({
type: MessageType.Success,
- content: localeService.t('find-replace.replace.all-success', `${success}`),
+ content: localeService.t<LocaleKey>('find-replace.replace.all-success', `${success}`),
});
return true;
diff --git a/packages/find-replace/src/locale/ar-SA.ts b/packages/find-replace/src/locale/ar-SA.ts
index 5db528541c..99246bd0c9 100644
--- a/packages/find-replace/src/locale/ar-SA.ts
+++ b/packages/find-replace/src/locale/ar-SA.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'تم استبدال {0} تطابقات',
+ 'partial-success': 'تم استبدال {0} تطابقات، وتعذر استبدال {1}',
'all-failure': 'فشل الاستبدال',
confirm: {
title: 'هل أنت متأكد من استبدال جميع التطابقات؟',
diff --git a/packages/find-replace/src/locale/ca-ES.ts b/packages/find-replace/src/locale/ca-ES.ts
index 1e88cdf319..6cc0abe965 100644
--- a/packages/find-replace/src/locale/ca-ES.ts
+++ b/packages/find-replace/src/locale/ca-ES.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'S\'han reemplaçat totes les {0} coincidències',
+ 'partial-success': 'S\'han reemplaçat {0} coincidències, no s\'han pogut reemplaçar {1}',
'all-failure': 'Error en el reemplaçament',
confirm: {
title: 'Esteu segur que voleu reemplaçar totes les coincidències?',
diff --git a/packages/find-replace/src/locale/de-DE.ts b/packages/find-replace/src/locale/de-DE.ts
index 6d1eeb20dd..35bf1e5faf 100644
--- a/packages/find-replace/src/locale/de-DE.ts
+++ b/packages/find-replace/src/locale/de-DE.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Alle {0} Treffer ersetzt',
+ 'partial-success': '{0} Treffer ersetzt, {1} konnten nicht ersetzt werden',
'all-failure': 'Ersetzen fehlgeschlagen',
confirm: {
title: 'Sollen alle Treffer ersetzt werden?',
diff --git a/packages/find-replace/src/locale/en-US.ts b/packages/find-replace/src/locale/en-US.ts
index 417ce2f1c6..7cbb68eff3 100644
--- a/packages/find-replace/src/locale/en-US.ts
+++ b/packages/find-replace/src/locale/en-US.ts
@@ -56,6 +56,7 @@ const locale = {
},
replace: {
'all-success': 'Replaced all {0} matches',
+ 'partial-success': 'Replaced {0} matches, failed to replace {1}',
'all-failure': 'Replace failed',
confirm: {
title: 'Are you sure to replace all matches?',
diff --git a/packages/find-replace/src/locale/es-ES.ts b/packages/find-replace/src/locale/es-ES.ts
index ca4914e8d5..12c9dad6b4 100644
--- a/packages/find-replace/src/locale/es-ES.ts
+++ b/packages/find-replace/src/locale/es-ES.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Se reemplazaron todas las {0} coincidencias',
+ 'partial-success': 'Se reemplazaron {0} coincidencias; no se pudieron reemplazar {1}',
'all-failure': 'Error al reemplazar',
confirm: {
title: '¿Está seguro de que desea reemplazar todas las coincidencias?',
diff --git a/packages/find-replace/src/locale/fa-IR.ts b/packages/find-replace/src/locale/fa-IR.ts
index 6b53a8f1fd..17d5207029 100644
--- a/packages/find-replace/src/locale/fa-IR.ts
+++ b/packages/find-replace/src/locale/fa-IR.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'همه {0} مورد تطابق جایگزین شدند',
+ 'partial-success': '{0} مورد تطابق جایگزین شد، جایگزینی {1} مورد ناموفق بود',
'all-failure': 'جایگزینی ناموفق بود',
confirm: {
title: 'آیا مطمئن هستید که می‌خواهید همه موارد تطابق را جایگزین کنید؟',
diff --git a/packages/find-replace/src/locale/fr-FR.ts b/packages/find-replace/src/locale/fr-FR.ts
index 9195d9f5e5..c0c8742c86 100644
--- a/packages/find-replace/src/locale/fr-FR.ts
+++ b/packages/find-replace/src/locale/fr-FR.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Toutes les {0} correspondances ont été remplacées',
+ 'partial-success': '{0} correspondances ont été remplacées, {1} ont échoué',
'all-failure': 'Échec du remplacement',
confirm: {
title: 'Êtes-vous sûr de vouloir remplacer toutes les correspondances ?',
diff --git a/packages/find-replace/src/locale/id-ID.ts b/packages/find-replace/src/locale/id-ID.ts
index a150db988c..7bfc012027 100644
--- a/packages/find-replace/src/locale/id-ID.ts
+++ b/packages/find-replace/src/locale/id-ID.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Berhasil mengganti {0} kecocokan',
+ 'partial-success': 'Berhasil mengganti {0} kecocokan, gagal mengganti {1}',
'all-failure': 'Penggantian gagal',
confirm: {
title: 'Apakah Anda yakin ingin mengganti semua kecocokan?',
diff --git a/packages/find-replace/src/locale/it-IT.ts b/packages/find-replace/src/locale/it-IT.ts
index fbe6344af8..7d0b61a6c2 100644
--- a/packages/find-replace/src/locale/it-IT.ts
+++ b/packages/find-replace/src/locale/it-IT.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Sostituite tutte le {0} corrispondenze',
+ 'partial-success': 'Sostituite {0} corrispondenze, {1} non sostituite',
'all-failure': 'Sostituzione non riuscita',
confirm: {
title: 'Sei sicuro di voler sostituire tutte le corrispondenze?',
diff --git a/packages/find-replace/src/locale/ja-JP.ts b/packages/find-replace/src/locale/ja-JP.ts
index 1e0678f50b..4c26956126 100644
--- a/packages/find-replace/src/locale/ja-JP.ts
+++ b/packages/find-replace/src/locale/ja-JP.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': '一致項目 {0} 件すべてを置換しました',
+ 'partial-success': '{0} 件の一致項目を置換しました。{1} 件の置換に失敗しました',
'all-failure': '置換に失敗しました',
confirm: {
title: 'すべての一致項目を置換してもよろしいですか?',
diff --git a/packages/find-replace/src/locale/ko-KR.ts b/packages/find-replace/src/locale/ko-KR.ts
index bb48e570e9..5318cb6dcf 100644
--- a/packages/find-replace/src/locale/ko-KR.ts
+++ b/packages/find-replace/src/locale/ko-KR.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': '일치 항목 {0}개를 모두 바꿨습니다.',
+ 'partial-success': '일치 항목 {0}개를 바꾸고 {1}개는 바꾸지 못했습니다.',
'all-failure': '바꾸기 실패',
confirm: {
title: '모든 일치 항목을 바꾸시겠습니까?',
diff --git a/packages/find-replace/src/locale/pl-PL.ts b/packages/find-replace/src/locale/pl-PL.ts
index a52c4b57be..0571ef84db 100644
--- a/packages/find-replace/src/locale/pl-PL.ts
+++ b/packages/find-replace/src/locale/pl-PL.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Zastąpiono wszystkie dopasowania: {0}',
+ 'partial-success': 'Zastąpiono dopasowania: {0}, nie udało się zastąpić: {1}',
'all-failure': 'Zastępowanie nie powiodło się',
confirm: {
title: 'Czy na pewno chcesz zastąpić wszystkie dopasowania?',
diff --git a/packages/find-replace/src/locale/pt-BR.ts b/packages/find-replace/src/locale/pt-BR.ts
index 071df53d10..24984db434 100644
--- a/packages/find-replace/src/locale/pt-BR.ts
+++ b/packages/find-replace/src/locale/pt-BR.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Substituídas todas as {0} correspondências',
+ 'partial-success': '{0} correspondências substituídas, falha ao substituir {1}',
'all-failure': 'Falha na substituição',
confirm: {
title: 'Tem certeza de que deseja substituir todas as correspondências?',
diff --git a/packages/find-replace/src/locale/ru-RU.ts b/packages/find-replace/src/locale/ru-RU.ts
index 96dadc06f5..674ef88ca0 100644
--- a/packages/find-replace/src/locale/ru-RU.ts
+++ b/packages/find-replace/src/locale/ru-RU.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Заменены все совпадения: {0}',
+ 'partial-success': 'Заменено совпадений: {0}, не удалось заменить: {1}',
'all-failure': 'Ошибка замены',
confirm: {
title: 'Вы уверены, что хотите заменить все совпадения?',
diff --git a/packages/find-replace/src/locale/sk-SK.ts b/packages/find-replace/src/locale/sk-SK.ts
index f36c048ff6..8a610559c8 100644
--- a/packages/find-replace/src/locale/sk-SK.ts
+++ b/packages/find-replace/src/locale/sk-SK.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Všetkých {0} zhôd bolo nahradených',
+ 'partial-success': 'Nahradených {0} zhôd, {1} sa nepodarilo nahradiť',
'all-failure': 'Nahradenie zlyhalo',
confirm: {
title: 'Ste si istí, že chcete nahradiť všetky zhody?',
diff --git a/packages/find-replace/src/locale/vi-VN.ts b/packages/find-replace/src/locale/vi-VN.ts
index da920c2d0b..7ffbf865fe 100644
--- a/packages/find-replace/src/locale/vi-VN.ts
+++ b/packages/find-replace/src/locale/vi-VN.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': 'Đã thay thế tất cả {0} kết quả phù hợp',
+ 'partial-success': 'Đã thay thế {0} kết quả phù hợp, không thể thay thế {1}',
'all-failure': 'Thay thế thất bại',
confirm: {
title: 'Bạn có chắc chắn muốn thay thế tất cả các kết quả phù hợp không?',
diff --git a/packages/find-replace/src/locale/zh-CN.ts b/packages/find-replace/src/locale/zh-CN.ts
index e5647e4801..7e562bf6b6 100644
--- a/packages/find-replace/src/locale/zh-CN.ts
+++ b/packages/find-replace/src/locale/zh-CN.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': '已全部替换 {0} 个匹配项',
+ 'partial-success': '已替换 {0} 个匹配项,{1} 个替换失败',
'all-failure': '替换失败',
confirm: {
title: '确定要替换所有的匹配项吗?',
diff --git a/packages/find-replace/src/locale/zh-HK.ts b/packages/find-replace/src/locale/zh-HK.ts
index bf96be73f4..a315a1c0a3 100644
--- a/packages/find-replace/src/locale/zh-HK.ts
+++ b/packages/find-replace/src/locale/zh-HK.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': '已取代全部 {0} 個相符項目',
+ 'partial-success': '已取代 {0} 個相符項目,{1} 個取代失敗',
'all-failure': '取代失敗',
confirm: {
title: '確定要取代所有相符項目嗎?',
diff --git a/packages/find-replace/src/locale/zh-TW.ts b/packages/find-replace/src/locale/zh-TW.ts
index bf96be73f4..a315a1c0a3 100644
--- a/packages/find-replace/src/locale/zh-TW.ts
+++ b/packages/find-replace/src/locale/zh-TW.ts
@@ -58,6 +58,7 @@ const locale: typeof enUS = {
},
replace: {
'all-success': '已取代全部 {0} 個相符項目',
+ 'partial-success': '已取代 {0} 個相符項目,{1} 個取代失敗',
'all-failure': '取代失敗',
confirm: {
title: '確定要取代所有相符項目嗎?',
diff --git a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx
index 810fe5d5d5..0c5f9188a4 100644
--- a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/ColorScale.tsx
@@ -17,6 +17,7 @@
import type { Workbook } from '@univerjs/core';
import type { IColorScale, IConditionalFormattingRuleConfig } from '@univerjs/sheets-conditional-formatting';
import type { IFormulaEditorRef } from '@univerjs/sheets-formula-ui';
+import type { LocaleKey } from '../../../locale/types';
import type { IStyleEditorProps } from './type';
import { IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { borderClassName, clsx, InputNumber, Select } from '@univerjs/design';
@@ -28,10 +29,13 @@ import { ColorPicker } from '../../ColorPicker';
import { Preview } from '../../Preview';
import { previewClassName } from './styles';
-const createOptionItem = (text: string, localeService: LocaleService) => ({ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${text}`), value: text });
+const createOptionItem = (text: string, localeService: LocaleService) => ({
+ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${text}`),
+ value: text,
+});
const TextInput = (props: { id: string; type: CFValueType | 'none'; value: number | string; onChange: (v: number | string) => void; className: string }) => {
- const { type, className, onChange, id, value } = props;
+ const { type, className, onChange, value } = props;
const univerInstanceService = useDependency(IUniverInstanceService);
const unitId = univerInstanceService.getCurrentUnitOfType<Workbook>(UniverInstanceType.UNIVER_SHEET)!.getUnitId();
const subUnitId = univerInstanceService.getCurrentUnitOfType<Workbook>(UniverInstanceType.UNIVER_SHEET)!.getActiveSheet()?.getSheetId();
@@ -230,7 +234,7 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
dark:!univer-text-gray-200
`}
>
- {localeService.t('sheets-conditional-formatting-ui.panel.styleRule')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.panel.styleRule')}
</div>
<div className={previewClassName}>
<Preview rule={getResult({ minType, medianType, maxType, minValue, medianValue, maxValue, minColor, medianColor, maxColor }) as IConditionalFormattingRuleConfig} />
@@ -241,7 +245,7 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
dark:!univer-text-gray-200
`}
>
- {localeService.t('sheets-conditional-formatting-ui.valueType.min')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.valueType.min')}
</div>
<div className="univer-mt-3 univer-flex univer-h-8 univer-items-center">
<Select
@@ -310,7 +314,7 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
dark:!univer-text-gray-200
`}
>
- {localeService.t('sheets-conditional-formatting-ui.panel.medianValue')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.panel.medianValue')}
</div>
<div className="univer-mt-3 univer-flex univer-h-8 univer-items-center">
<Select
@@ -383,7 +387,7 @@ export const ColorScaleStyleEditor = (props: IStyleEditorProps) => {
dark:!univer-text-gray-200
`}
>
- {localeService.t('sheets-conditional-formatting-ui.valueType.max')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.valueType.max')}
</div>
<div className="univer-mt-3 univer-flex univer-h-8 univer-items-center">
<Select
diff --git a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/HighlightCell.tsx b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/HighlightCell.tsx
index d10f5877f5..2f1a3ff7f7 100644
--- a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/HighlightCell.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/HighlightCell.tsx
@@ -21,6 +21,7 @@ import type {
ITextHighlightCell,
ITimePeriodHighlightCell,
} from '@univerjs/sheets-conditional-formatting';
+import type { LocaleKey } from '../../../locale/types';
import type { IStyleEditorProps } from './type';
import { LocaleService } from '@univerjs/core';
import { Input, InputNumber, Select } from '@univerjs/design';
@@ -39,7 +40,10 @@ import { Preview } from '../../Preview';
import { WrapperError } from '../../wrapper-error/WrapperError';
import { previewClassName } from './styles';
-const createOptionItem = (text: string, localeService: LocaleService) => ({ label: localeService.t(`sheets-conditional-formatting-ui.operator.${text}`), value: text });
+const createOptionItem = (text: string, localeService: LocaleService) => ({
+ label: localeService.t(`sheets-conditional-formatting-ui.operator.${text}`),
+ value: text,
+});
type IValue = number | string | [number, number];
type IResult = (Pick<ITextHighlightCell | INumberHighlightCell | ITimePeriodHighlightCell, 'operator' | 'subType'>) & { value?: IValue };
@@ -92,7 +96,7 @@ function HighlightCellInput(props: {
case CFSubRuleType.text: {
if ([CFTextOperator.beginsWith, CFTextOperator.containsText, CFTextOperator.endsWith, CFTextOperator.notEqual, CFTextOperator.notContainsText, CFTextOperator.equal].includes(operator as any)) {
if (!inputTextValue) {
- setTextError(localeService.t('sheets-conditional-formatting-ui.errorMessage.notBlank'));
+ setTextError(localeService.t<LocaleKey>('sheets-conditional-formatting-ui.errorMessage.notBlank'));
return false;
}
return next(v);
@@ -245,19 +249,19 @@ export const HighlightCellStyleEditor = (props: IStyleEditorProps<any, ITextHigh
const typeOptions = [{
value: CFSubRuleType.text,
- label: localeService.t('sheets-conditional-formatting-ui.subRuleType.text'),
+ label: localeService.t<LocaleKey>('sheets-conditional-formatting-ui.subRuleType.text'),
}, {
value: CFSubRuleType.number,
- label: localeService.t('sheets-conditional-formatting-ui.subRuleType.number'),
+ label: localeService.t<LocaleKey>('sheets-conditional-formatting-ui.subRuleType.number'),
}, {
value: CFSubRuleType.timePeriod,
- label: localeService.t('sheets-conditional-formatting-ui.subRuleType.timePeriod'),
+ label: localeService.t<LocaleKey>('sheets-conditional-formatting-ui.subRuleType.timePeriod'),
}, {
value: CFSubRuleType.duplicateValues,
- label: localeService.t('sheets-conditional-formatting-ui.subRuleType.duplicateValues'),
+ label: localeService.t<LocaleKey>('sheets-conditional-formatting-ui.subRuleType.duplicateValues'),
}, {
value: CFSubRuleType.uniqueValues,
- label: localeService.t('sheets-conditional-formatting-ui.subRuleType.uniqueValues'),
+ label: localeService.t<LocaleKey>('sheets-conditional-formatting-ui.subRuleType.uniqueValues'),
}];
const operatorOptions = useMemo(() => getOperatorOptions(subType, localeService), [subType]);
@@ -373,7 +377,7 @@ export const HighlightCellStyleEditor = (props: IStyleEditorProps<any, ITextHigh
dark:!univer-text-gray-200
`}
>
- {localeService.t('sheets-conditional-formatting-ui.panel.styleRule')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.panel.styleRule')}
</div>
<div className="univer-flex univer-justify-between univer-gap-4">
<Select
diff --git a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx
index 31d6417e29..efb7ebed5c 100644
--- a/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/views/panel/rule-edit/IconSet.tsx
@@ -17,6 +17,7 @@
import type { Workbook } from '@univerjs/core';
import type { IIconSet } from '@univerjs/sheets-conditional-formatting';
import type { IFormulaEditorRef } from '@univerjs/sheets-formula-ui';
+import type { LocaleKey } from '../../../locale/types';
import type { IStyleEditorProps } from './type';
import { get, IUniverInstanceService, LocaleService, set, Tools, UniverInstanceType } from '@univerjs/core';
import { borderClassName, Checkbox, clsx, Dropdown, InputNumber, Select } from '@univerjs/design';
@@ -125,7 +126,9 @@ const IconGroupList = forwardRef<HTMLDivElement, IIconGroupListProps>((props, re
{iconGroup.map((group, index) => {
return (
<div key={index} className="univer-mb-3">
- <div className="univer-mb-1 univer-text-sm">{localeService.t(group.title)}</div>
+ <div className="univer-mb-1 univer-text-sm">
+ {localeService.t(group.title)}
+ </div>
<div className="univer-flex univer-flex-wrap">
{group.group.map((groupItem) => {
return (
@@ -226,12 +229,30 @@ const IconSetRuleEdit = (props: {
const { onChange, configList, errorMap = {} } = props;
const localeService = useDependency(LocaleService);
- const options = [{ label: localeService.t(`sheets-conditional-formatting-ui.symbol.${CFNumberOperator.greaterThan}`), value: CFNumberOperator.greaterThan }, { label: localeService.t(`sheets-conditional-formatting-ui.symbol.${CFNumberOperator.greaterThanOrEqual}`), value: CFNumberOperator.greaterThanOrEqual }];
+ const options = [{
+ label: localeService.t<LocaleKey>(`sheets-conditional-formatting-ui.symbol.${CFNumberOperator.greaterThan}`),
+ value: CFNumberOperator.greaterThan,
+ }, {
+ label: localeService.t<LocaleKey>(`sheets-conditional-formatting-ui.symbol.${CFNumberOperator.greaterThanOrEqual}`),
+ value: CFNumberOperator.greaterThanOrEqual,
+ }];
const valueTypeOptions = [
- { label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.num}`), value: CFValueType.num },
- { label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.percent}`), value: CFValueType.percent },
- { label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.percentile}`), value: CFValueType.percentile },
- { label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.formula}`), value: CFValueType.formula },
+ {
+ label: localeService.t<LocaleKey>(`sheets-conditional-formatting-ui.valueType.${CFValueType.num}`),
+ value: CFValueType.num,
+ },
+ {
+ label: localeService.t<LocaleKey>(`sheets-conditional-formatting-ui.valueType.${CFValueType.percent}`),
+ value: CFValueType.percent,
+ },
+ {
+ label: localeService.t<LocaleKey>(`sheets-conditional-formatting-ui.valueType.${CFValueType.percentile}`),
+ value: CFValueType.percentile,
+ },
+ {
+ label: localeService.t<LocaleKey>(`sheets-conditional-formatting-ui.valueType.${CFValueType.formula}`),
+ value: CFValueType.formula,
+ },
];
const handleValueValueChange = (v: number | string, index: number) => {
onChange([String(index), 'value', 'value'], v);
@@ -256,7 +277,7 @@ const IconSetRuleEdit = (props: {
const isEnd = index === configList.length - 1;
const isFirst = index === 0;
const preItem = configList[index - 1];
- const lessThanText = preItem?.value.type === CFValueType.formula ? localeService.t('sheets-conditional-formatting-ui.valueType.formula') : preItem?.value.value;
+ const lessThanText = preItem?.value.type === CFValueType.formula ? localeService.t<LocaleKey>('sheets-conditional-formatting-ui.valueType.formula') : preItem?.value.value;
const handleIconClick = (iconType: IIconSetType, iconId: string) => {
const value = { ...item, iconId, iconType } as typeof item;
@@ -277,13 +298,13 @@ const IconSetRuleEdit = (props: {
<div
className="univer-w-[45%]"
>
- {localeService.t('sheets-conditional-formatting-ui.iconSet.icon')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.icon')}
{index + 1}
</div>
<div className="univer-w-[45%]">
<>
- {!isFirst && !isEnd && localeService.t('sheets-conditional-formatting-ui.iconSet.rule')}
+ {!isFirst && !isEnd && localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.rule')}
{!isFirst && !isEnd && (
<span
className={`
@@ -291,10 +312,10 @@ const IconSetRuleEdit = (props: {
dark:!univer-text-gray-200
`}
>
- {localeService.t('sheets-conditional-formatting-ui.iconSet.when')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.when')}
{localeService.t(`sheets-conditional-formatting-ui.symbol.${getOppositeOperator(preItem.operator)}`)}
{lessThanText}
- {isEnd ? '' : ` ${localeService.t('sheets-conditional-formatting-ui.iconSet.and')} `}
+ {isEnd ? '' : ` ${localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.and')} `}
</span>
)}
@@ -341,12 +362,12 @@ const IconSetRuleEdit = (props: {
dark:!univer-text-gray-200
`}
>
- {localeService.t('sheets-conditional-formatting-ui.iconSet.rule')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.rule')}
<span className="univer-font-medium">
- {localeService.t('sheets-conditional-formatting-ui.iconSet.when')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.when')}
{localeService.t(`sheets-conditional-formatting-ui.symbol.${getOppositeOperator(preItem.operator)}`)}
{lessThanText}
- {isEnd ? '' : ` ${localeService.t('sheets-conditional-formatting-ui.iconSet.and')} `}
+ {isEnd ? '' : ` ${localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.and')} `}
</span>
</div>
)}
@@ -361,8 +382,8 @@ const IconSetRuleEdit = (props: {
dark:!univer-text-gray-200
`}
>
- <div>{localeService.t('sheets-conditional-formatting-ui.iconSet.type')}</div>
- <div>{localeService.t('sheets-conditional-formatting-ui.iconSet.value')}</div>
+ <div>{localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.type')}</div>
+ <div>{localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.value')}</div>
</div>
<div
className="univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4"
@@ -556,7 +577,7 @@ export const IconSet = (props: IStyleEditorProps<unknown, IIconSet>) => {
return (
<div>
<div className="univer-mt-4 univer-text-sm univer-text-gray-600">
- {localeService.t('sheets-conditional-formatting-ui.panel.styleRule')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.panel.styleRule')}
</div>
<div className="univer-mt-3">
<Dropdown
@@ -588,11 +609,11 @@ export const IconSet = (props: IStyleEditorProps<unknown, IIconSet>) => {
<div className="univer-mt-3 univer-flex univer-items-center univer-text-xs">
<div className="univer-flex univer-items-center univer-text-xs">
<Checkbox onChange={reverseIcon} />
- {localeService.t('sheets-conditional-formatting-ui.iconSet.reverseIconOrder')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.reverseIconOrder')}
</div>
<div className="univer-ml-6 univer-flex univer-items-center univer-text-xs">
<Checkbox checked={!isShowValue} onChange={(v) => { setIsShowValue(!v); }} />
- {localeService.t('sheets-conditional-formatting-ui.iconSet.onlyShowIcon')}
+ {localeService.t<LocaleKey>('sheets-conditional-formatting-ui.iconSet.onlyShowIcon')}
</div>
</div>
<IconSetRuleEdit errorMap={errorMap} onChange={handleChange} configList={configList} />
diff --git a/packages/sheets-conditional-formatting/src/models/icon-map.ts b/packages/sheets-conditional-formatting/src/models/icon-map.ts
index d24fe03b8c..f7b6afdd07 100644
--- a/packages/sheets-conditional-formatting/src/models/icon-map.ts
+++ b/packages/sheets-conditional-formatting/src/models/icon-map.ts
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+import type { LocaleKey } from '../locale/types';
import { ICON_MAP } from '../assets/icon-map';
export enum IIconSetType {
@@ -41,7 +42,7 @@ export enum IIconSetType {
empty = 'EMPTY_ICON_TYPE',
}
-export const iconGroup: { title: string; group: { name: IIconSetType; list: string[] }[] }[] = [
+export const iconGroup: { title: LocaleKey; group: { name: IIconSetType; list: string[] }[] }[] = [
{
title: 'sheets-conditional-formatting.iconSet.direction',
group: [
diff --git a/packages/sheets-data-validation-ui/src/views/components/DataValidationDetail.tsx b/packages/sheets-data-validation-ui/src/views/components/DataValidationDetail.tsx
index 13d5be48a3..03a9485582 100644
--- a/packages/sheets-data-validation-ui/src/views/components/DataValidationDetail.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/DataValidationDetail.tsx
@@ -26,6 +26,7 @@ import type {
} from '@univerjs/core';
import type { IUpdateSheetDataValidationRangeCommandParams } from '@univerjs/sheets-data-validation';
import type { IRangeSelectorInstance } from '@univerjs/sheets-formula-ui';
+import type { LocaleKey } from '../../locale/types';
import {
debounce,
ICommandService,
@@ -311,8 +312,8 @@ function DataValidationDetailInner(props: { activeRuleInfo: { unitId: string; su
return (
<div data-u-comp="data-validation-detail" className="univer-py-2">
<FormLayout
- label={localeService.t('sheets-data-validation-ui.panel.range')}
- error={(!localRule.ranges.length || isRangeError) ? localeService.t('sheets-data-validation-ui.panel.rangeError') : ''}
+ label={localeService.t<LocaleKey>('sheets-data-validation-ui.panel.range')}
+ error={(!localRule.ranges.length || isRangeError) ? localeService.t<LocaleKey>('sheets-data-validation-ui.panel.rangeError') : ''}
>
<RangeSelector
selectorRef={rangeSelectorInstance}
@@ -333,7 +334,7 @@ function DataValidationDetailInner(props: { activeRuleInfo: { unitId: string; su
onVerify={(isValid) => setIsRangeError(!isValid)}
/>
</FormLayout>
- <FormLayout label={localeService.t('sheets-data-validation-ui.panel.type')}>
+ <FormLayout label={localeService.t<LocaleKey>('sheets-data-validation-ui.panel.type')}>
<Select
className="univer-w-full"
value={localRule.type}
@@ -346,14 +347,14 @@ function DataValidationDetailInner(props: { activeRuleInfo: { unitId: string; su
</FormLayout>
{operators?.length
? (
- <FormLayout label={localeService.t('sheets-data-validation-ui.panel.operator')}>
+ <FormLayout label={localeService.t<LocaleKey>('sheets-data-validation-ui.panel.operator')}>
<Select
className="univer-w-full"
value={`${localRule.operator}`}
options={[
{
value: '',
- label: localeService.t('sheets-data-validation-ui.operators.legal'),
+ label: localeService.t<LocaleKey>('sheets-data-validation-ui.operators.legal'),
},
...operators.map((op, i) => ({
value: `${op}`,
@@ -401,16 +402,16 @@ function DataValidationDetailInner(props: { activeRuleInfo: { unitId: string; su
allowBlank: !(localRule.allowBlank ?? true),
})}
>
- {localeService.t('sheets-data-validation-ui.panel.allowBlank')}
+ {localeService.t<LocaleKey>('sheets-data-validation-ui.panel.allowBlank')}
</Checkbox>
</FormLayout>
<DataValidationOptions value={options} onChange={handleUpdateRuleOptions} extraComponent={validator.optionsInput} />
<div className="univer-mt-5 univer-flex univer-flex-row univer-justify-end">
<Button className="univer-ml-3" onClick={handleDelete}>
- {localeService.t('sheets-data-validation-ui.panel.removeRule')}
+ {localeService.t<LocaleKey>('sheets-data-validation-ui.panel.removeRule')}
</Button>
<Button className="univer-ml-3" variant="primary" onClick={handleOk}>
- {localeService.t('sheets-data-validation-ui.panel.done')}
+ {localeService.t<LocaleKey>('sheets-data-validation-ui.panel.done')}
</Button>
</div>
</div>
diff --git a/packages/sheets-data-validation/src/validators/date-validator.ts b/packages/sheets-data-validation/src/validators/date-validator.ts
index 320dd34663..9d6655f43e 100644
--- a/packages/sheets-data-validation/src/validators/date-validator.ts
+++ b/packages/sheets-data-validation/src/validators/date-validator.ts
@@ -17,6 +17,7 @@
import type { CellValue, IDataValidationRule, IDataValidationRuleBase, ISheetDataValidationRule, Nullable } from '@univerjs/core';
import type { IFormulaResult, IFormulaValidResult, IValidatorCellInfo } from '@univerjs/data-validation';
import type { ISheetLocationBase } from '@univerjs/sheets';
+import type { LocaleKey } from '../locale/types';
import { DataValidationOperator, DataValidationType, dateKit, isFormulaString, numfmt, Tools } from '@univerjs/core';
import { LexerTreeBuilder } from '@univerjs/engine-formula';
import { DateOperatorErrorTitleMap, DateOperatorNameMap, DateOperatorTitleMap } from '../common/date-text-map';
@@ -106,7 +107,7 @@ export class DateValidator extends BaseSheetValidator {
}
const formula1Success = this._validatorSingleFormula(rule.formula1);
- const errorMsg = this.localeService.t('sheets-data-validation.validFail.date');
+ const errorMsg = this.localeService.t<LocaleKey>('sheets-data-validation.validFail.date');
const isTwoFormula = TWO_FORMULA_OPERATOR_COUNT.includes(operator);
if (isTwoFormula) {
const formula2Success = this._validatorSingleFormula(rule.formula2);
diff --git a/packages/sheets-data-validation/src/validators/decimal-validator.ts b/packages/sheets-data-validation/src/validators/decimal-validator.ts
index c7c195cf25..a6a33efbf2 100644
--- a/packages/sheets-data-validation/src/validators/decimal-validator.ts
+++ b/packages/sheets-data-validation/src/validators/decimal-validator.ts
@@ -17,6 +17,7 @@
import type { CellValue, IDataValidationRule, IDataValidationRuleBase, ISheetDataValidationRule, Nullable } from '@univerjs/core';
import type { IFormulaResult, IFormulaValidResult, IValidatorCellInfo } from '@univerjs/data-validation';
import type { ISheetLocationBase } from '@univerjs/sheets';
+import type { LocaleKey } from '../locale/types';
import { DataValidationOperator, DataValidationType, isFormulaString, Tools } from '@univerjs/core';
import { LexerTreeBuilder } from '@univerjs/engine-formula';
import { DataValidationCustomFormulaService } from '../services/dv-custom-formula.service';
@@ -103,7 +104,7 @@ export class DecimalValidator extends BaseSheetValidator {
const formula1Success = Tools.isDefine(rule.formula1) && this._isFormulaOrNumber(rule.formula1);
const formula2Success = Tools.isDefine(rule.formula2) && this._isFormulaOrNumber(rule.formula2);
const isTwoFormula = TWO_FORMULA_OPERATOR_COUNT.includes(operator);
- const errorMsg = this.localeService.t('sheets-data-validation.validFail.number');
+ const errorMsg = this.localeService.t<LocaleKey>('sheets-data-validation.validFail.number');
if (isTwoFormula) {
return {
success: formula1Success && formula2Success,
diff --git a/packages/sheets-data-validation/src/validators/text-length-validator.ts b/packages/sheets-data-validation/src/validators/text-length-validator.ts
index 13ac75d20b..b91e67574a 100644
--- a/packages/sheets-data-validation/src/validators/text-length-validator.ts
+++ b/packages/sheets-data-validation/src/validators/text-length-validator.ts
@@ -17,6 +17,7 @@
import type { CellValue, IDataValidationRule, IDataValidationRuleBase, ISheetDataValidationRule, Nullable } from '@univerjs/core';
import type { IFormulaResult, IFormulaValidResult, IValidatorCellInfo } from '@univerjs/data-validation';
import type { ISheetLocationBase } from '@univerjs/sheets';
+import type { LocaleKey } from '../locale/types';
import { DataValidationOperator, DataValidationType, isFormulaString, Tools } from '@univerjs/core';
import { LexerTreeBuilder } from '@univerjs/engine-formula';
import { DataValidationCustomFormulaService } from '../services/dv-custom-formula.service';
@@ -62,7 +63,7 @@ export class TextLengthValidator extends BaseSheetValidator {
const formula1Success = Tools.isDefine(rule.formula1) && this._isFormulaOrInt(rule.formula1);
const formula2Success = Tools.isDefine(rule.formula2) && this._isFormulaOrInt(rule.formula2);
const isTwoFormula = TWO_FORMULA_OPERATOR_COUNT.includes(operator);
- const errorMsg = this.localeService.t('sheets-data-validation.validFail.number');
+ const errorMsg = this.localeService.t<LocaleKey>('sheets-data-validation.validFail.number');
if (isTwoFormula) {
return {
success: formula1Success && formula2Success,
diff --git a/packages/sheets-data-validation/src/validators/whole-validator.ts b/packages/sheets-data-validation/src/validators/whole-validator.ts
index 371f26fb93..989aafb0b8 100644
--- a/packages/sheets-data-validation/src/validators/whole-validator.ts
+++ b/packages/sheets-data-validation/src/validators/whole-validator.ts
@@ -17,6 +17,7 @@
import type { CellValue, IDataValidationRule, IDataValidationRuleBase, ISheetDataValidationRule, Nullable } from '@univerjs/core';
import type { IFormulaResult, IFormulaValidResult, IValidatorCellInfo } from '@univerjs/data-validation';
import type { ISheetLocationBase } from '@univerjs/sheets';
+import type { LocaleKey } from '../locale/types';
import { DataValidationOperator, DataValidationType, isFormulaString, Tools } from '@univerjs/core';
import { LexerTreeBuilder } from '@univerjs/engine-formula';
import { DataValidationCustomFormulaService } from '../services/dv-custom-formula.service';
@@ -33,7 +34,7 @@ export class WholeValidator extends BaseSheetValidator {
private readonly _lexerTreeBuilder = this.injector.get(LexerTreeBuilder);
id: string = DataValidationType.WHOLE;
- title: string = 'sheets-data-validation.whole.title';
+ title: LocaleKey = 'sheets-data-validation.whole.title';
order = 10;
operators: DataValidationOperator[] = [
@@ -103,7 +104,7 @@ export class WholeValidator extends BaseSheetValidator {
const formula1Success = Tools.isDefine(rule.formula1) && this._isFormulaOrInt(rule.formula1);
const formula2Success = Tools.isDefine(rule.formula2) && this._isFormulaOrInt(rule.formula2);
const isTwoFormula = TWO_FORMULA_OPERATOR_COUNT.includes(operator);
- const errorMsg = this.localeService.t('sheets-data-validation.validFail.number');
+ const errorMsg = this.localeService.t<LocaleKey>('sheets-data-validation.validFail.number');
if (isTwoFormula) {
return {
success: formula1Success && formula2Success,
diff --git a/packages/sheets-filter-ui/src/controllers/sheets-filter-permission.controller.ts b/packages/sheets-filter-ui/src/controllers/sheets-filter-permission.controller.ts
index b3b54cfeb7..1b521eb74d 100644
--- a/packages/sheets-filter-ui/src/controllers/sheets-filter-permission.controller.ts
+++ b/packages/sheets-filter-ui/src/controllers/sheets-filter-permission.controller.ts
@@ -17,6 +17,7 @@
import type { ICommandInfo } from '@univerjs/core';
import type { MenuConfig } from '@univerjs/ui';
import type { IOpenFilterPanelOperationParams } from '../commands/operations/sheets-filter.operation';
+import type { LocaleKey } from '../locale/types';
import { Disposable, ICommandService, Inject, Injector, IUniverInstanceService, LocaleService, Tools } from '@univerjs/core';
import { expandToContinuousRange, getSheetCommandTarget, RangeProtectionPermissionViewPoint, SheetPermissionCheckController, SheetsSelectionsService, WorksheetFilterPermission, WorksheetViewPermission } from '@univerjs/sheets';
import { SheetsFilterService, SmartToggleSheetsFilterCommand } from '@univerjs/sheets-filter';
@@ -80,7 +81,7 @@ export class SheetsFilterPermissionController extends Disposable {
}
if (!permission) {
- this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t('sheets-filter-ui.permission.filterErr'));
+ this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t<LocaleKey>('sheets-filter-ui.permission.filterErr'));
}
}
if (command.id === OpenFilterPanelOperation.id) {
@@ -96,7 +97,7 @@ export class SheetsFilterPermissionController extends Disposable {
worksheetTypes: [WorksheetFilterPermission, WorksheetViewPermission],
}, [colRange], unitId, subUnitId);
if (!permission) {
- this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t('sheets-filter-ui.permission.filterErr'));
+ this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t<LocaleKey>('sheets-filter-ui.permission.filterErr'));
}
}
}
diff --git a/packages/sheets-filter-ui/src/locale/ar-SA.ts b/packages/sheets-filter-ui/src/locale/ar-SA.ts
index 2b5fbd49cf..e35e122154 100644
--- a/packages/sheets-filter-ui/src/locale/ar-SA.ts
+++ b/packages/sheets-filter-ui/src/locale/ar-SA.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'تبديل التصفية',
},
+ permission: {
+ filterErr: 'ليس لديك إذن لاستخدام التصفية.',
+ },
panel: {
'clear-filter': 'مسح التصفية',
cancel: 'إلغاء',
diff --git a/packages/sheets-filter-ui/src/locale/ca-ES.ts b/packages/sheets-filter-ui/src/locale/ca-ES.ts
index 7a7fccce4a..f64dcf035a 100644
--- a/packages/sheets-filter-ui/src/locale/ca-ES.ts
+++ b/packages/sheets-filter-ui/src/locale/ca-ES.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Alterna el filtre',
},
+ permission: {
+ filterErr: 'No teniu permís per utilitzar el filtre.',
+ },
panel: {
'clear-filter': 'Neteja el filtre',
cancel: 'Cancel·la',
diff --git a/packages/sheets-filter-ui/src/locale/de-DE.ts b/packages/sheets-filter-ui/src/locale/de-DE.ts
index c27aafb261..87db81f25d 100644
--- a/packages/sheets-filter-ui/src/locale/de-DE.ts
+++ b/packages/sheets-filter-ui/src/locale/de-DE.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Filter ein-/ausschalten',
},
+ permission: {
+ filterErr: 'Sie haben keine Berechtigung, den Filter zu verwenden.',
+ },
panel: {
'clear-filter': 'Filter löschen',
cancel: 'Abbrechen',
diff --git a/packages/sheets-filter-ui/src/locale/en-US.ts b/packages/sheets-filter-ui/src/locale/en-US.ts
index 7f038b4c47..a9dc16c8df 100644
--- a/packages/sheets-filter-ui/src/locale/en-US.ts
+++ b/packages/sheets-filter-ui/src/locale/en-US.ts
@@ -24,6 +24,9 @@ const locale = {
shortcut: {
'smart-toggle-filter': 'Toggle Filter',
},
+ permission: {
+ filterErr: 'You do not have permission to use the filter.',
+ },
panel: {
'clear-filter': 'Clear Filter',
cancel: 'Cancel',
diff --git a/packages/sheets-filter-ui/src/locale/es-ES.ts b/packages/sheets-filter-ui/src/locale/es-ES.ts
index 9d3b3bee56..ae4fc790d5 100644
--- a/packages/sheets-filter-ui/src/locale/es-ES.ts
+++ b/packages/sheets-filter-ui/src/locale/es-ES.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Alternar filtro',
},
+ permission: {
+ filterErr: 'No tiene permiso para usar el filtro.',
+ },
panel: {
'clear-filter': 'Borrar filtro',
cancel: 'Cancelar',
diff --git a/packages/sheets-filter-ui/src/locale/fa-IR.ts b/packages/sheets-filter-ui/src/locale/fa-IR.ts
index f96e1fb0ce..9daa8dcedc 100644
--- a/packages/sheets-filter-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-filter-ui/src/locale/fa-IR.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'تغییر حالت فیلتر',
},
+ permission: {
+ filterErr: 'شما مجوز استفاده از فیلتر را ندارید.',
+ },
panel: {
'clear-filter': 'پاک کردن فیلتر',
cancel: 'انصراف',
diff --git a/packages/sheets-filter-ui/src/locale/fr-FR.ts b/packages/sheets-filter-ui/src/locale/fr-FR.ts
index 7bf634a6f1..92e47e5f6c 100644
--- a/packages/sheets-filter-ui/src/locale/fr-FR.ts
+++ b/packages/sheets-filter-ui/src/locale/fr-FR.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Inverser le filtre',
},
+ permission: {
+ filterErr: 'Vous n’avez pas l’autorisation d’utiliser le filtre.',
+ },
panel: {
'clear-filter': 'Effacer le filtre',
cancel: 'Annuler',
diff --git a/packages/sheets-filter-ui/src/locale/id-ID.ts b/packages/sheets-filter-ui/src/locale/id-ID.ts
index 5829a25478..ddac148926 100644
--- a/packages/sheets-filter-ui/src/locale/id-ID.ts
+++ b/packages/sheets-filter-ui/src/locale/id-ID.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Aktifkan/Nonaktifkan Filter',
},
+ permission: {
+ filterErr: 'Anda tidak memiliki izin untuk menggunakan filter.',
+ },
panel: {
'clear-filter': 'Hapus Filter',
cancel: 'Batal',
diff --git a/packages/sheets-filter-ui/src/locale/it-IT.ts b/packages/sheets-filter-ui/src/locale/it-IT.ts
index a74434b6cf..2787990bd3 100644
--- a/packages/sheets-filter-ui/src/locale/it-IT.ts
+++ b/packages/sheets-filter-ui/src/locale/it-IT.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Attiva/disattiva filtro',
},
+ permission: {
+ filterErr: 'Non hai l’autorizzazione per usare il filtro.',
+ },
panel: {
'clear-filter': 'Cancella filtro',
cancel: 'Annulla',
diff --git a/packages/sheets-filter-ui/src/locale/ja-JP.ts b/packages/sheets-filter-ui/src/locale/ja-JP.ts
index e67f9af6d5..65cbd3e24c 100644
--- a/packages/sheets-filter-ui/src/locale/ja-JP.ts
+++ b/packages/sheets-filter-ui/src/locale/ja-JP.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'フィルタの切替',
},
+ permission: {
+ filterErr: 'フィルタを使用する権限がありません。',
+ },
panel: {
'clear-filter': 'フィルタをクリア',
cancel: 'キャンセル',
diff --git a/packages/sheets-filter-ui/src/locale/ko-KR.ts b/packages/sheets-filter-ui/src/locale/ko-KR.ts
index 69918f671e..447ee3036e 100644
--- a/packages/sheets-filter-ui/src/locale/ko-KR.ts
+++ b/packages/sheets-filter-ui/src/locale/ko-KR.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': '필터 토글',
},
+ permission: {
+ filterErr: '필터를 사용할 권한이 없습니다.',
+ },
panel: {
'clear-filter': '필터 지우기',
cancel: '취소',
diff --git a/packages/sheets-filter-ui/src/locale/pl-PL.ts b/packages/sheets-filter-ui/src/locale/pl-PL.ts
index 4b98a6f6c7..175b87bc00 100644
--- a/packages/sheets-filter-ui/src/locale/pl-PL.ts
+++ b/packages/sheets-filter-ui/src/locale/pl-PL.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Przełącz filtr',
},
+ permission: {
+ filterErr: 'Nie masz uprawnień do używania filtra.',
+ },
panel: {
'clear-filter': 'Wyczyść filtr',
cancel: 'Anuluj',
diff --git a/packages/sheets-filter-ui/src/locale/pt-BR.ts b/packages/sheets-filter-ui/src/locale/pt-BR.ts
index cb368a792f..5f4e191bb4 100644
--- a/packages/sheets-filter-ui/src/locale/pt-BR.ts
+++ b/packages/sheets-filter-ui/src/locale/pt-BR.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Alternar Filtro',
},
+ permission: {
+ filterErr: 'Você não tem permissão para usar o filtro.',
+ },
panel: {
'clear-filter': 'Limpar Filtro',
cancel: 'Cancelar',
diff --git a/packages/sheets-filter-ui/src/locale/ru-RU.ts b/packages/sheets-filter-ui/src/locale/ru-RU.ts
index 2b524deea8..04bd6addda 100644
--- a/packages/sheets-filter-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-filter-ui/src/locale/ru-RU.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Переключить фильтр',
},
+ permission: {
+ filterErr: 'У вас нет разрешения на использование фильтра.',
+ },
panel: {
'clear-filter': 'Очистить фильтр',
cancel: 'Отмена',
diff --git a/packages/sheets-filter-ui/src/locale/sk-SK.ts b/packages/sheets-filter-ui/src/locale/sk-SK.ts
index 88362cff7d..c529591c2b 100644
--- a/packages/sheets-filter-ui/src/locale/sk-SK.ts
+++ b/packages/sheets-filter-ui/src/locale/sk-SK.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Prepnúť filter',
},
+ permission: {
+ filterErr: 'Nemáte povolenie používať filter.',
+ },
panel: {
'clear-filter': 'Vymazať filter',
cancel: 'Zrušiť',
diff --git a/packages/sheets-filter-ui/src/locale/vi-VN.ts b/packages/sheets-filter-ui/src/locale/vi-VN.ts
index 5290b617fc..3298f5630f 100644
--- a/packages/sheets-filter-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-filter-ui/src/locale/vi-VN.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': 'Chuyển đổi lọc',
},
+ permission: {
+ filterErr: 'Bạn không có quyền sử dụng bộ lọc.',
+ },
panel: {
'clear-filter': 'Xóa lọc',
cancel: 'Hủy bỏ',
diff --git a/packages/sheets-filter-ui/src/locale/zh-CN.ts b/packages/sheets-filter-ui/src/locale/zh-CN.ts
index bf776bb18d..4813294155 100644
--- a/packages/sheets-filter-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-filter-ui/src/locale/zh-CN.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': '切换筛选',
},
+ permission: {
+ filterErr: '你没有权限使用筛选。',
+ },
panel: {
'clear-filter': '清除筛选',
cancel: '取消',
diff --git a/packages/sheets-filter-ui/src/locale/zh-HK.ts b/packages/sheets-filter-ui/src/locale/zh-HK.ts
index 774648209a..30409edf3c 100644
--- a/packages/sheets-filter-ui/src/locale/zh-HK.ts
+++ b/packages/sheets-filter-ui/src/locale/zh-HK.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': '切換篩選',
},
+ permission: {
+ filterErr: '你沒有權限使用篩選。',
+ },
panel: {
'clear-filter': '清除篩選',
cancel: '取消',
diff --git a/packages/sheets-filter-ui/src/locale/zh-TW.ts b/packages/sheets-filter-ui/src/locale/zh-TW.ts
index 774648209a..30409edf3c 100644
--- a/packages/sheets-filter-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-filter-ui/src/locale/zh-TW.ts
@@ -26,6 +26,9 @@ const locale: typeof enUS = {
shortcut: {
'smart-toggle-filter': '切換篩選',
},
+ permission: {
+ filterErr: '你沒有權限使用篩選。',
+ },
panel: {
'clear-filter': '清除篩選',
cancel: '取消',
diff --git a/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx b/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx
index 3a32efe48b..e0a3b92552 100644
--- a/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx
+++ b/packages/sheets-filter-ui/src/views/components/SheetsFilterByConditionsPanel.tsx
@@ -15,6 +15,7 @@
*/
import type { ISelectProps } from '@univerjs/design';
+import type { LocaleKey } from '../../locale/types';
import type { FilterOperator, IFilterConditionFormParams } from '../../models/conditions';
import type { ByConditionsModel } from '../../services/sheets-filter-panel.service';
import { LocaleService } from '@univerjs/core';
@@ -50,15 +51,15 @@ export function FilterByCondition(props: { model: ByConditionsModel }) {
model.onConditionFormChange(diffParams);
}, [model]);
- const placeholder = localeService.t('sheets-filter-ui.panel.input-values-placeholder');
+ const placeholder = localeService.t<LocaleKey>('sheets-filter-ui.panel.input-values-placeholder');
function renderSecondaryCondition(operator: FilterOperator, val: string, name: 'operator1' | 'operator2') {
const shouldRenderInput = FilterConditionItems.getItemByOperator(operator).numOfParameters === 1;
return (
<>
{name === 'operator2' && (
<RadioGroup value={radioValue} onChange={onRadioChange}>
- <Radio value="AND">{localeService.t('sheets-filter-ui.panel.and')}</Radio>
- <Radio value="OR">{localeService.t('sheets-filter-ui.panel.or')}</Radio>
+ <Radio value="AND">{localeService.t<LocaleKey>('sheets-filter-ui.panel.and')}</Radio>
+ <Radio value="OR">{localeService.t<LocaleKey>('sheets-filter-ui.panel.or')}</Radio>
</RadioGroup>
)}
<Select
@@ -103,9 +104,9 @@ export function FilterByCondition(props: { model: ByConditionsModel }) {
data-u-comp="sheets-filter-panel-conditions-desc"
className="univer-mt-2 univer-text-xs univer-text-gray-500"
>
- {localeService.t('sheets-filter-ui.panel.?')}
+ {localeService.t<LocaleKey>('sheets-filter-ui.panel.?')}
<br />
- {localeService.t('sheets-filter-ui.panel.*')}
+ {localeService.t<LocaleKey>('sheets-filter-ui.panel.*')}
</div>
</div>
)
diff --git a/packages/sheets-filter-ui/src/worker/generate-filter-values.service.ts b/packages/sheets-filter-ui/src/worker/generate-filter-values.service.ts
index d08cca7ca9..e798d2e4c4 100644
--- a/packages/sheets-filter-ui/src/worker/generate-filter-values.service.ts
+++ b/packages/sheets-filter-ui/src/worker/generate-filter-values.service.ts
@@ -16,6 +16,7 @@
import type { IRange, Nullable, Styles, Workbook, Worksheet } from '@univerjs/core';
import type { FilterColumn } from '@univerjs/sheets-filter';
+import type { LocaleKey } from '../locale/types';
import type { IFilterByValueItem, IFilterByValueWithTreeItem } from '../services/sheets-filter-panel.service';
import {
createIdentifier,
@@ -145,7 +146,7 @@ export function getFilterByValueItems(
const initialBlankChecked = filters ? blankChecked : true;
if (emptyCount > 0) {
const item: IFilterByValueItem = {
- value: localeService.t('sheets-filter-ui.panel.empty'),
+ value: localeService.t<LocaleKey>('sheets-filter-ui.panel.empty'),
checked: initialBlankChecked,
count: emptyCount,
index,
@@ -304,7 +305,7 @@ export function getFilterTreeByValueItems(
: true;
if (emptyCount > 0) {
const item: IFilterByValueWithTreeItem = {
- title: localeService.t('sheets-filter-ui.panel.empty'),
+ title: localeService.t<LocaleKey>('sheets-filter-ui.panel.empty'),
count: emptyCount,
leaf: true,
checked: initialBlankChecked,
diff --git a/packages/sheets-formula-ui/src/controllers/formula-alert-render.controller.ts b/packages/sheets-formula-ui/src/controllers/formula-alert-render.controller.ts
index ed6f8c145b..3de43371d6 100644
--- a/packages/sheets-formula-ui/src/controllers/formula-alert-render.controller.ts
+++ b/packages/sheets-formula-ui/src/controllers/formula-alert-render.controller.ts
@@ -16,6 +16,7 @@
import type { Workbook } from '@univerjs/core';
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
+import type { LocaleKey } from '../locale/types';
import { Disposable, Inject, isICellData, LocaleService } from '@univerjs/core';
import { ErrorType, extractFormulaError, FormulaDataModel } from '@univerjs/engine-formula';
import { CellAlertManagerService, CellAlertType, HoverManagerService } from '@univerjs/sheets-ui';
@@ -95,7 +96,7 @@ export class FormulaAlertRenderController extends Disposable implements IRenderM
this._cellAlertManagerService.showAlert({
type: CellAlertType.ERROR,
- title: this._localeService.t('sheets-formula-ui.error.title'),
+ title: this._localeService.t<LocaleKey>('sheets-formula-ui.error.title'),
message: this._localeService.t(`sheets-formula-ui.error.${ErrorTypeToMessageMap[errorType]}`),
location: cellPos.location,
width: 200,
diff --git a/packages/sheets-hyper-link-ui/src/controllers/hyper-link-permission.controller.ts b/packages/sheets-hyper-link-ui/src/controllers/hyper-link-permission.controller.ts
index 3d1989d444..75de9f7250 100644
--- a/packages/sheets-hyper-link-ui/src/controllers/hyper-link-permission.controller.ts
+++ b/packages/sheets-hyper-link-ui/src/controllers/hyper-link-permission.controller.ts
@@ -15,8 +15,16 @@
*/
import type { ICommandInfo } from '@univerjs/core';
+import type { LocaleKey } from '../locale/types';
import { Disposable, ICommandService, Inject, LocaleService } from '@univerjs/core';
-import { RangeProtectionPermissionEditPoint, SheetPermissionCheckController, WorkbookEditablePermission, WorksheetEditPermission, WorksheetInsertHyperlinkPermission, WorksheetSetCellValuePermission } from '@univerjs/sheets';
+import {
+ RangeProtectionPermissionEditPoint,
+ SheetPermissionCheckController,
+ WorkbookEditablePermission,
+ WorksheetEditPermission,
+ WorksheetInsertHyperlinkPermission,
+ WorksheetSetCellValuePermission,
+} from '@univerjs/sheets';
import { InsertLinkShortcut } from '../menu/menu';
export class SheetsHyperLinkPermissionController extends Disposable {
@@ -40,7 +48,9 @@ export class SheetsHyperLinkPermissionController extends Disposable {
worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission],
});
if (!permission) {
- this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t('sheets-hyper-link-ui.permission.hyperLinkErr'));
+ this._sheetPermissionCheckController.blockExecuteWithoutPermission(
+ this._localeService.t<LocaleKey>('sheets-hyper-link-ui.permission.hyperLinkErr')
+ );
}
}
})
diff --git a/packages/sheets-hyper-link-ui/src/locale/ar-SA.ts b/packages/sheets-hyper-link-ui/src/locale/ar-SA.ts
index 8981afbaf6..3d7f82ea88 100644
--- a/packages/sheets-hyper-link-ui/src/locale/ar-SA.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/ar-SA.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'إدراج ارتباط تشعبي',
},
+ permission: {
+ hyperLinkErr: 'ليس لديك إذن لإدراج رابط.',
+ },
message: {
noSheet: 'تم حذف الورقة المستهدفة',
refError: 'نطاق غير صالح',
diff --git a/packages/sheets-hyper-link-ui/src/locale/ca-ES.ts b/packages/sheets-hyper-link-ui/src/locale/ca-ES.ts
index 7022d1b201..6bf69d519f 100644
--- a/packages/sheets-hyper-link-ui/src/locale/ca-ES.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/ca-ES.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Insereix enllaç',
},
+ permission: {
+ hyperLinkErr: 'No teniu permís per inserir un enllaç.',
+ },
message: {
noSheet: 'El full de destinació ha estat eliminat',
refError: 'Interval no vàlid',
diff --git a/packages/sheets-hyper-link-ui/src/locale/de-DE.ts b/packages/sheets-hyper-link-ui/src/locale/de-DE.ts
index 9c34c03ab6..fbb4e4494c 100644
--- a/packages/sheets-hyper-link-ui/src/locale/de-DE.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/de-DE.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Link einfügen',
},
+ permission: {
+ hyperLinkErr: 'Sie haben keine Berechtigung, einen Link einzufügen.',
+ },
message: {
noSheet: 'Zielblatt wurde gelöscht',
refError: 'Ungültiger Bereich',
diff --git a/packages/sheets-hyper-link-ui/src/locale/en-US.ts b/packages/sheets-hyper-link-ui/src/locale/en-US.ts
index 04664e6875..4e289187b6 100644
--- a/packages/sheets-hyper-link-ui/src/locale/en-US.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/en-US.ts
@@ -36,6 +36,9 @@ const locale = {
menu: {
add: 'Insert Link',
},
+ permission: {
+ hyperLinkErr: 'You do not have permission to insert a link.',
+ },
message: {
noSheet: 'Target sheet has been delete',
refError: 'Invalid Range',
diff --git a/packages/sheets-hyper-link-ui/src/locale/es-ES.ts b/packages/sheets-hyper-link-ui/src/locale/es-ES.ts
index 3f704df095..382448e62a 100644
--- a/packages/sheets-hyper-link-ui/src/locale/es-ES.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/es-ES.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Insertar enlace',
},
+ permission: {
+ hyperLinkErr: 'No tiene permiso para insertar un enlace.',
+ },
message: {
noSheet: 'La hoja de destino ha sido eliminada',
refError: 'Rango no válido',
diff --git a/packages/sheets-hyper-link-ui/src/locale/fa-IR.ts b/packages/sheets-hyper-link-ui/src/locale/fa-IR.ts
index dc7b09924e..832f168c95 100644
--- a/packages/sheets-hyper-link-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/fa-IR.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'درج لینک',
},
+ permission: {
+ hyperLinkErr: 'شما مجوز درج لینک را ندارید.',
+ },
message: {
noSheet: 'برگ هدف حذف شده است',
refError: 'محدوده نامعتبر',
diff --git a/packages/sheets-hyper-link-ui/src/locale/fr-FR.ts b/packages/sheets-hyper-link-ui/src/locale/fr-FR.ts
index 5b84540cc8..0f59b0dc7e 100644
--- a/packages/sheets-hyper-link-ui/src/locale/fr-FR.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/fr-FR.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Insérer un lien',
},
+ permission: {
+ hyperLinkErr: 'Vous n’avez pas l’autorisation d’insérer un lien.',
+ },
message: {
noSheet: 'La feuille cible a été supprimée',
refError: 'Plage invalide',
diff --git a/packages/sheets-hyper-link-ui/src/locale/id-ID.ts b/packages/sheets-hyper-link-ui/src/locale/id-ID.ts
index 68c3e35135..5281e7eb3c 100644
--- a/packages/sheets-hyper-link-ui/src/locale/id-ID.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/id-ID.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Sisipkan Tautan',
},
+ permission: {
+ hyperLinkErr: 'Anda tidak memiliki izin untuk menyisipkan tautan.',
+ },
message: {
noSheet: 'Lembar target telah dihapus',
refError: 'Rentang Tidak Valid',
diff --git a/packages/sheets-hyper-link-ui/src/locale/it-IT.ts b/packages/sheets-hyper-link-ui/src/locale/it-IT.ts
index a3c4f9dc8c..ca14fa593a 100644
--- a/packages/sheets-hyper-link-ui/src/locale/it-IT.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/it-IT.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Inserisci collegamento',
},
+ permission: {
+ hyperLinkErr: 'Non hai l’autorizzazione per inserire un collegamento.',
+ },
message: {
noSheet: 'Il foglio di destinazione è stato eliminato',
refError: 'Intervallo non valido',
diff --git a/packages/sheets-hyper-link-ui/src/locale/ja-JP.ts b/packages/sheets-hyper-link-ui/src/locale/ja-JP.ts
index f4dd70d283..6cad4dfab7 100644
--- a/packages/sheets-hyper-link-ui/src/locale/ja-JP.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/ja-JP.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'リンクの挿入',
},
+ permission: {
+ hyperLinkErr: 'リンクを挿入する権限がありません。',
+ },
message: {
noSheet: '対象のワークシートが削除されました',
refError: '無効な範囲です',
diff --git a/packages/sheets-hyper-link-ui/src/locale/ko-KR.ts b/packages/sheets-hyper-link-ui/src/locale/ko-KR.ts
index b11f3e5c55..566aab30fc 100644
--- a/packages/sheets-hyper-link-ui/src/locale/ko-KR.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/ko-KR.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: '링크 삽입',
},
+ permission: {
+ hyperLinkErr: '링크를 삽입할 권한이 없습니다.',
+ },
message: {
noSheet: '대상 워크시트가 삭제되었습니다',
refError: '잘못된 범위입니다',
diff --git a/packages/sheets-hyper-link-ui/src/locale/pl-PL.ts b/packages/sheets-hyper-link-ui/src/locale/pl-PL.ts
index 1d3f1d612f..9fb4d47e37 100644
--- a/packages/sheets-hyper-link-ui/src/locale/pl-PL.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/pl-PL.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Wstaw łącze',
},
+ permission: {
+ hyperLinkErr: 'Nie masz uprawnień do wstawiania łącza.',
+ },
message: {
noSheet: 'Arkusz docelowy został usunięty',
refError: 'Nieprawidłowy zakres',
diff --git a/packages/sheets-hyper-link-ui/src/locale/pt-BR.ts b/packages/sheets-hyper-link-ui/src/locale/pt-BR.ts
index 11fb10e30d..c8986a15bc 100644
--- a/packages/sheets-hyper-link-ui/src/locale/pt-BR.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/pt-BR.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Inserir Link',
},
+ permission: {
+ hyperLinkErr: 'Você não tem permissão para inserir um link.',
+ },
message: {
noSheet: 'A planilha de destino foi excluída',
refError: 'Intervalo Inválido',
diff --git a/packages/sheets-hyper-link-ui/src/locale/ru-RU.ts b/packages/sheets-hyper-link-ui/src/locale/ru-RU.ts
index 3c474c80b8..39a8b0ae0c 100644
--- a/packages/sheets-hyper-link-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/ru-RU.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Вставить ссылку',
},
+ permission: {
+ hyperLinkErr: 'У вас нет разрешения на вставку ссылки.',
+ },
message: {
noSheet: 'Целевой лист был удален',
refError: 'Недопустимый диапазон',
diff --git a/packages/sheets-hyper-link-ui/src/locale/sk-SK.ts b/packages/sheets-hyper-link-ui/src/locale/sk-SK.ts
index 8e923e4c8f..64c728cd95 100644
--- a/packages/sheets-hyper-link-ui/src/locale/sk-SK.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/sk-SK.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Vložiť odkaz',
},
+ permission: {
+ hyperLinkErr: 'Nemáte povolenie vložiť odkaz.',
+ },
message: {
noSheet: 'Cieľový hárok bol odstránený',
refError: 'Neplatný rozsah',
diff --git a/packages/sheets-hyper-link-ui/src/locale/vi-VN.ts b/packages/sheets-hyper-link-ui/src/locale/vi-VN.ts
index 9a706a5477..5314b3f51d 100644
--- a/packages/sheets-hyper-link-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/vi-VN.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: 'Thêm liên kết',
},
+ permission: {
+ hyperLinkErr: 'Bạn không có quyền chèn liên kết.',
+ },
message: {
noSheet: 'Bảng con này đã bị xóa',
refError: 'Tham chiếu lỗi',
diff --git a/packages/sheets-hyper-link-ui/src/locale/zh-CN.ts b/packages/sheets-hyper-link-ui/src/locale/zh-CN.ts
index 627c01f991..7ed6a4c52b 100644
--- a/packages/sheets-hyper-link-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/zh-CN.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: '添加链接',
},
+ permission: {
+ hyperLinkErr: '你没有权限插入链接。',
+ },
message: {
noSheet: '该子表已被删除',
refError: '错误的引用',
diff --git a/packages/sheets-hyper-link-ui/src/locale/zh-HK.ts b/packages/sheets-hyper-link-ui/src/locale/zh-HK.ts
index 4b960d62aa..a6f22082d1 100644
--- a/packages/sheets-hyper-link-ui/src/locale/zh-HK.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/zh-HK.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: '新增連結',
},
+ permission: {
+ hyperLinkErr: '你沒有權限插入連結。',
+ },
message: {
noSheet: '該子表已被刪除',
refError: '錯誤的引用',
diff --git a/packages/sheets-hyper-link-ui/src/locale/zh-TW.ts b/packages/sheets-hyper-link-ui/src/locale/zh-TW.ts
index 4b960d62aa..a6f22082d1 100644
--- a/packages/sheets-hyper-link-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-hyper-link-ui/src/locale/zh-TW.ts
@@ -38,6 +38,9 @@ const locale: typeof enUS = {
menu: {
add: '新增連結',
},
+ permission: {
+ hyperLinkErr: '你沒有權限插入連結。',
+ },
message: {
noSheet: '該子表已被刪除',
refError: '錯誤的引用',
diff --git a/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.ts b/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.ts
index 34f27df192..904612f216 100644
--- a/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.ts
+++ b/packages/sheets-sort-ui/src/services/sheets-sort-ui.service.ts
@@ -17,6 +17,7 @@
import type { IRange, Nullable, Workbook, Worksheet } from '@univerjs/core';
import type { ISheetRangeLocation } from '@univerjs/sheets';
import type { ISortOption } from '@univerjs/sheets-sort';
+import type { LocaleKey } from '../locale/types';
import {
Disposable,
ICommandService,
@@ -157,13 +158,13 @@ export class SheetsSortUIService extends Disposable {
return await this._confirmService.confirm({
id: 'sort-range-check-error',
title: {
- title: this._localeService.t('sheets-sort-ui.info.tooltip'),
+ title: this._localeService.t<LocaleKey>('sheets-sort-ui.info.tooltip'),
},
children: {
title: createSortCheckError(this._localeService.t(content)),
},
- cancelText: this._localeService.t('sheets-sort-ui.dialog.cancel'),
- confirmText: this._localeService.t('sheets-sort-ui.dialog.confirm'),
+ cancelText: this._localeService.t<LocaleKey>('sheets-sort-ui.dialog.cancel'),
+ confirmText: this._localeService.t<LocaleKey>('sheets-sort-ui.dialog.confirm'),
});
}
@@ -172,7 +173,7 @@ export class SheetsSortUIService extends Disposable {
const confirm = await this._confirmService.confirm({
id: 'extend-sort-range-dialog',
title: {
- title: this._localeService.t('sheets-sort-ui.dialog.sort-reminder'),
+ title: this._localeService.t<LocaleKey>('sheets-sort-ui.dialog.sort-reminder'),
},
children: {
title: createExtendConfirm((value: string) => {
@@ -180,8 +181,8 @@ export class SheetsSortUIService extends Disposable {
}),
},
width: 400,
- cancelText: this._localeService.t('sheets-sort-ui.dialog.cancel'),
- confirmText: this._localeService.t('sheets-sort-ui.dialog.confirm'),
+ cancelText: this._localeService.t<LocaleKey>('sheets-sort-ui.dialog.cancel'),
+ confirmText: this._localeService.t<LocaleKey>('sheets-sort-ui.dialog.confirm'),
});
if (confirm) {
return shouldExtend ? EXTEND_TYPE.EXTEND : EXTEND_TYPE.KEEP;
diff --git a/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-permission.controller.ts b/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-permission.controller.ts
index 84a7772ab7..5167faa2cd 100644
--- a/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-permission.controller.ts
+++ b/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-permission.controller.ts
@@ -15,12 +15,30 @@
*/
import type { ICommandInfo } from '@univerjs/core';
-import type { IAddCommentCommandParams, IDeleteCommentCommandParams, IDeleteCommentTreeCommandParams, IResolveCommentCommandParams, IUpdateCommentCommandParams } from '@univerjs/thread-comment';
+import type {
+ IAddCommentCommandParams,
+ IDeleteCommentCommandParams,
+ IDeleteCommentTreeCommandParams,
+ IResolveCommentCommandParams,
+ IUpdateCommentCommandParams,
+} from '@univerjs/thread-comment';
+import type { LocaleKey } from '../locale/types';
import { Disposable, ICommandService, Inject, LocaleService } from '@univerjs/core';
import { singleReferenceToGrid } from '@univerjs/engine-formula';
-import { RangeProtectionPermissionViewPoint, SheetPermissionCheckController, WorkbookCommentPermission, WorksheetViewPermission } from '@univerjs/sheets';
+import {
+ RangeProtectionPermissionViewPoint,
+ SheetPermissionCheckController,
+ WorkbookCommentPermission,
+ WorksheetViewPermission,
+} from '@univerjs/sheets';
import { SheetsThreadCommentModel } from '@univerjs/sheets-thread-comment';
-import { AddCommentCommand, DeleteCommentCommand, DeleteCommentTreeCommand, ResolveCommentCommand, UpdateCommentCommand } from '@univerjs/thread-comment';
+import {
+ AddCommentCommand,
+ DeleteCommentCommand,
+ DeleteCommentTreeCommand,
+ ResolveCommentCommand,
+ UpdateCommentCommand,
+} from '@univerjs/thread-comment';
import { ShowAddSheetCommentModalOperation, ToggleSheetCommentPanelOperation } from '../commands/operations/comment.operation';
export class SheetsThreadCommentPermissionController extends Disposable {
@@ -46,7 +64,7 @@ export class SheetsThreadCommentPermissionController extends Disposable {
worksheetTypes: [WorksheetViewPermission],
});
if (!permission) {
- this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t('sheets-thread-comment-ui.permission.commentErr'));
+ this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t<LocaleKey>('sheets-thread-comment-ui.permission.commentErr'));
}
} else if (id === AddCommentCommand.id) {
const params = command.params as IAddCommentCommandParams;
@@ -60,7 +78,7 @@ export class SheetsThreadCommentPermissionController extends Disposable {
rangeTypes: [RangeProtectionPermissionViewPoint],
}, [{ startRow: row, startColumn: column, endRow: row, endColumn: column }], unitId, subUnitId);
if (!permission) {
- this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t('sheets-thread-comment-ui.permission.commentErr'));
+ this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t<LocaleKey>('sheets-thread-comment-ui.permission.commentErr'));
}
} else if (id === UpdateCommentCommand.id) {
const params = command.params as IUpdateCommentCommandParams;
@@ -78,7 +96,7 @@ export class SheetsThreadCommentPermissionController extends Disposable {
rangeTypes: [RangeProtectionPermissionViewPoint],
}, [{ startRow: row, startColumn: column, endRow: row, endColumn: column }], unitId, subUnitId);
if (!permission) {
- this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t('sheets-thread-comment-ui.permission.commentErr'));
+ this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t<LocaleKey>('sheets-thread-comment-ui.permission.commentErr'));
}
}
} else if (id === ResolveCommentCommand.id || id === DeleteCommentCommand.id || id === DeleteCommentTreeCommand.id) {
@@ -96,7 +114,7 @@ export class SheetsThreadCommentPermissionController extends Disposable {
rangeTypes: [RangeProtectionPermissionViewPoint],
}, [{ startRow: row, startColumn: column, endRow: row, endColumn: column }], unitId, subUnitId);
if (!permission) {
- this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t('sheets-thread-comment-ui.permission.commentErr'));
+ this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t<LocaleKey>('sheets-thread-comment-ui.permission.commentErr'));
}
}
}
diff --git a/packages/sheets-thread-comment-ui/src/locale/ar-SA.ts b/packages/sheets-thread-comment-ui/src/locale/ar-SA.ts
index 8a771b8e92..3f17e95d45 100644
--- a/packages/sheets-thread-comment-ui/src/locale/ar-SA.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/ar-SA.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'إدارة التعليقات',
},
+ permission: {
+ commentErr: 'ليس لديك إذن لاستخدام التعليقات.',
+ },
menu: {
addComment: 'إضافة تعليق',
commentManagement: 'إدارة التعليقات',
diff --git a/packages/sheets-thread-comment-ui/src/locale/ca-ES.ts b/packages/sheets-thread-comment-ui/src/locale/ca-ES.ts
index 0e6da0ce61..9f31cdc5ce 100644
--- a/packages/sheets-thread-comment-ui/src/locale/ca-ES.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/ca-ES.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Gestió de comentaris',
},
+ permission: {
+ commentErr: 'No teniu permís per utilitzar comentaris.',
+ },
menu: {
addComment: 'Afegeix un comentari',
commentManagement: 'Gestió de comentaris',
diff --git a/packages/sheets-thread-comment-ui/src/locale/de-DE.ts b/packages/sheets-thread-comment-ui/src/locale/de-DE.ts
index a62e3d21a5..5262889f58 100644
--- a/packages/sheets-thread-comment-ui/src/locale/de-DE.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/de-DE.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Kommentarverwaltung',
},
+ permission: {
+ commentErr: 'Sie haben keine Berechtigung, Kommentare zu verwenden.',
+ },
menu: {
addComment: 'Kommentar hinzufügen',
commentManagement: 'Kommentarverwaltung',
diff --git a/packages/sheets-thread-comment-ui/src/locale/en-US.ts b/packages/sheets-thread-comment-ui/src/locale/en-US.ts
index 8ca8d21e72..6978c0cfd4 100644
--- a/packages/sheets-thread-comment-ui/src/locale/en-US.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/en-US.ts
@@ -19,6 +19,9 @@ const locale = {
panel: {
title: 'Comment Management',
},
+ permission: {
+ commentErr: 'You do not have permission to use comments.',
+ },
menu: {
addComment: 'Add Comment',
commentManagement: 'Comment Management',
diff --git a/packages/sheets-thread-comment-ui/src/locale/es-ES.ts b/packages/sheets-thread-comment-ui/src/locale/es-ES.ts
index 18df80823b..c9520a5d48 100644
--- a/packages/sheets-thread-comment-ui/src/locale/es-ES.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/es-ES.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Gestión de comentarios',
},
+ permission: {
+ commentErr: 'No tiene permiso para usar comentarios.',
+ },
menu: {
addComment: 'Añadir comentario',
commentManagement: 'Gestión de comentarios',
diff --git a/packages/sheets-thread-comment-ui/src/locale/fa-IR.ts b/packages/sheets-thread-comment-ui/src/locale/fa-IR.ts
index 888fa3af26..7514c96649 100644
--- a/packages/sheets-thread-comment-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/fa-IR.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'مدیریت نظر',
},
+ permission: {
+ commentErr: 'شما مجوز استفاده از نظرات را ندارید.',
+ },
menu: {
addComment: 'افزودن نظر',
commentManagement: 'مدیریت نظر',
diff --git a/packages/sheets-thread-comment-ui/src/locale/fr-FR.ts b/packages/sheets-thread-comment-ui/src/locale/fr-FR.ts
index f5a0e13079..1d1749041e 100644
--- a/packages/sheets-thread-comment-ui/src/locale/fr-FR.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/fr-FR.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Gestion des commentaires',
},
+ permission: {
+ commentErr: 'Vous n’avez pas l’autorisation d’utiliser les commentaires.',
+ },
menu: {
addComment: 'Ajouter un commentaire',
commentManagement: 'Gestion des commentaires',
diff --git a/packages/sheets-thread-comment-ui/src/locale/id-ID.ts b/packages/sheets-thread-comment-ui/src/locale/id-ID.ts
index 727575726f..419c88ba19 100644
--- a/packages/sheets-thread-comment-ui/src/locale/id-ID.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/id-ID.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Manajemen Komentar',
},
+ permission: {
+ commentErr: 'Anda tidak memiliki izin untuk menggunakan komentar.',
+ },
menu: {
addComment: 'Tambah Komentar',
commentManagement: 'Manajemen Komentar',
diff --git a/packages/sheets-thread-comment-ui/src/locale/it-IT.ts b/packages/sheets-thread-comment-ui/src/locale/it-IT.ts
index 277aa7d09e..99438ae275 100644
--- a/packages/sheets-thread-comment-ui/src/locale/it-IT.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/it-IT.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Gestione commenti',
},
+ permission: {
+ commentErr: 'Non hai l’autorizzazione per usare i commenti.',
+ },
menu: {
addComment: 'Aggiungi commento',
commentManagement: 'Gestione commenti',
diff --git a/packages/sheets-thread-comment-ui/src/locale/ja-JP.ts b/packages/sheets-thread-comment-ui/src/locale/ja-JP.ts
index 8b4530658e..2919ed0e8d 100644
--- a/packages/sheets-thread-comment-ui/src/locale/ja-JP.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/ja-JP.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'コメント管理',
},
+ permission: {
+ commentErr: 'コメントを使用する権限がありません。',
+ },
menu: {
addComment: 'コメントを追加',
commentManagement: 'コメント管理',
diff --git a/packages/sheets-thread-comment-ui/src/locale/ko-KR.ts b/packages/sheets-thread-comment-ui/src/locale/ko-KR.ts
index 82d3d14152..d49394967a 100644
--- a/packages/sheets-thread-comment-ui/src/locale/ko-KR.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/ko-KR.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: '댓글 관리',
},
+ permission: {
+ commentErr: '댓글을 사용할 권한이 없습니다.',
+ },
menu: {
addComment: '댓글 추가',
commentManagement: '댓글 관리',
diff --git a/packages/sheets-thread-comment-ui/src/locale/pl-PL.ts b/packages/sheets-thread-comment-ui/src/locale/pl-PL.ts
index ecac4d38f8..d7da9623b5 100644
--- a/packages/sheets-thread-comment-ui/src/locale/pl-PL.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/pl-PL.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Zarządzanie komentarzami',
},
+ permission: {
+ commentErr: 'Nie masz uprawnień do używania komentarzy.',
+ },
menu: {
addComment: 'Dodaj komentarz',
commentManagement: 'Zarządzanie komentarzami',
diff --git a/packages/sheets-thread-comment-ui/src/locale/pt-BR.ts b/packages/sheets-thread-comment-ui/src/locale/pt-BR.ts
index 00373a91c2..40a04b7ba2 100644
--- a/packages/sheets-thread-comment-ui/src/locale/pt-BR.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/pt-BR.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Gerenciamento de Comentários',
},
+ permission: {
+ commentErr: 'Você não tem permissão para usar comentários.',
+ },
menu: {
addComment: 'Adicionar Comentário',
commentManagement: 'Gerenciamento de Comentários',
diff --git a/packages/sheets-thread-comment-ui/src/locale/ru-RU.ts b/packages/sheets-thread-comment-ui/src/locale/ru-RU.ts
index e63e974f6f..04c5e68c6e 100644
--- a/packages/sheets-thread-comment-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/ru-RU.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Управление комментариями',
},
+ permission: {
+ commentErr: 'У вас нет разрешения на использование комментариев.',
+ },
menu: {
addComment: 'Добавить комментарий',
commentManagement: 'Управление комментариями',
diff --git a/packages/sheets-thread-comment-ui/src/locale/sk-SK.ts b/packages/sheets-thread-comment-ui/src/locale/sk-SK.ts
index 6e1cdfd00f..92fc5fa882 100644
--- a/packages/sheets-thread-comment-ui/src/locale/sk-SK.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/sk-SK.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Správa komentárov',
},
+ permission: {
+ commentErr: 'Nemáte povolenie používať komentáre.',
+ },
menu: {
addComment: 'Pridať komentár',
commentManagement: 'Správa komentárov',
diff --git a/packages/sheets-thread-comment-ui/src/locale/vi-VN.ts b/packages/sheets-thread-comment-ui/src/locale/vi-VN.ts
index f844fbf5c4..5e90ed9602 100644
--- a/packages/sheets-thread-comment-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/vi-VN.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: 'Quản lý bình luận',
},
+ permission: {
+ commentErr: 'Bạn không có quyền sử dụng bình luận.',
+ },
menu: {
addComment: 'Thêm bình luận',
commentManagement: 'Quản lý bình luận',
diff --git a/packages/sheets-thread-comment-ui/src/locale/zh-CN.ts b/packages/sheets-thread-comment-ui/src/locale/zh-CN.ts
index 3e0339eea9..b10833a874 100644
--- a/packages/sheets-thread-comment-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/zh-CN.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: '评论管理',
},
+ permission: {
+ commentErr: '你没有权限使用评论。',
+ },
menu: {
addComment: '添加评论',
commentManagement: '评论管理',
diff --git a/packages/sheets-thread-comment-ui/src/locale/zh-HK.ts b/packages/sheets-thread-comment-ui/src/locale/zh-HK.ts
index dbd834b9fe..734aa56628 100644
--- a/packages/sheets-thread-comment-ui/src/locale/zh-HK.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/zh-HK.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: '評論管理',
},
+ permission: {
+ commentErr: '你沒有權限使用評論。',
+ },
menu: {
addComment: '新增評論',
commentManagement: '評論管理',
diff --git a/packages/sheets-thread-comment-ui/src/locale/zh-TW.ts b/packages/sheets-thread-comment-ui/src/locale/zh-TW.ts
index dbd834b9fe..734aa56628 100644
--- a/packages/sheets-thread-comment-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-thread-comment-ui/src/locale/zh-TW.ts
@@ -21,6 +21,9 @@ const locale: typeof enUS = {
panel: {
title: '評論管理',
},
+ permission: {
+ commentErr: '你沒有權限使用評論。',
+ },
menu: {
addComment: '新增評論',
commentManagement: '評論管理',
diff --git a/packages/sheets-ui/src/commands/commands/delete-range-move-left-confirm.command.ts b/packages/sheets-ui/src/commands/commands/delete-range-move-left-confirm.command.ts
index b8da254d03..31186b239d 100644
--- a/packages/sheets-ui/src/commands/commands/delete-range-move-left-confirm.command.ts
+++ b/packages/sheets-ui/src/commands/commands/delete-range-move-left-confirm.command.ts
@@ -15,6 +15,7 @@
*/
import type { ICommand, IRange } from '@univerjs/core';
+import type { LocaleKey } from '../../locale/types';
import { CommandType, ICommandService, IConfirmService, IUniverInstanceService, LocaleService, Rectangle } from '@univerjs/core';
import { DeleteRangeMoveLeftCommand, getSheetCommandTarget, SheetsSelectionsService } from '@univerjs/sheets';
@@ -56,10 +57,10 @@ export const DeleteRangeMoveLeftConfirmCommand: ICommand = {
const result = await confirmService.confirm({
id: DeleteRangeMoveLeftConfirmCommand.id,
- title: { title: localeService.t('sheets-ui.merge.confirm.warning') },
- children: { title: localeService.t('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
- cancelText: localeService.t('sheets-ui.button.cancel'),
- confirmText: localeService.t('sheets-ui.button.confirm'),
+ title: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.warning') },
+ children: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
+ cancelText: localeService.t<LocaleKey>('sheets-ui.button.cancel'),
+ confirmText: localeService.t<LocaleKey>('sheets-ui.button.confirm'),
});
if (result) {
return commandService.executeCommand(DeleteRangeMoveLeftCommand.id);
diff --git a/packages/sheets-ui/src/commands/commands/delete-range-move-up-confirm.command.ts b/packages/sheets-ui/src/commands/commands/delete-range-move-up-confirm.command.ts
index 060c34eecc..7e869d62a5 100644
--- a/packages/sheets-ui/src/commands/commands/delete-range-move-up-confirm.command.ts
+++ b/packages/sheets-ui/src/commands/commands/delete-range-move-up-confirm.command.ts
@@ -15,6 +15,7 @@
*/
import type { ICommand, IRange } from '@univerjs/core';
+import type { LocaleKey } from '../../locale/types';
import { CommandType, ICommandService, IConfirmService, IUniverInstanceService, LocaleService, Rectangle } from '@univerjs/core';
import { DeleteRangeMoveUpCommand, getSheetCommandTarget, SheetsSelectionsService } from '@univerjs/sheets';
@@ -44,9 +45,9 @@ export const DeleteRangeMoveUpConfirmCommand: ICommand = {
if (worksheet.getRowFiltered(i)) {
const result = await confirmService.confirm({
id: DeleteRangeMoveUpConfirmCommand.id,
- title: { title: localeService.t('sheets-ui.filter.confirm.error') },
- children: { title: localeService.t('sheets-ui.filter.confirm.notAllowedToInsertRange') },
- confirmText: localeService.t('sheets-ui.button.confirm'),
+ title: { title: localeService.t<LocaleKey>('sheets-ui.filter.confirm.error') },
+ children: { title: localeService.t<LocaleKey>('sheets-ui.filter.confirm.notAllowedToInsertRange') },
+ confirmText: localeService.t<LocaleKey>('sheets-ui.button.confirm'),
});
if (result) {
return false;
@@ -66,10 +67,10 @@ export const DeleteRangeMoveUpConfirmCommand: ICommand = {
const result = await confirmService.confirm({
id: DeleteRangeMoveUpConfirmCommand.id,
- title: { title: localeService.t('sheets-ui.merge.confirm.warning') },
- children: { title: localeService.t('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
- cancelText: localeService.t('sheets-ui.button.cancel'),
- confirmText: localeService.t('sheets-ui.button.confirm'),
+ title: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.warning') },
+ children: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
+ cancelText: localeService.t<LocaleKey>('sheets-ui.button.cancel'),
+ confirmText: localeService.t<LocaleKey>('sheets-ui.button.confirm'),
});
if (result) {
return commandService.executeCommand(DeleteRangeMoveUpCommand.id);
diff --git a/packages/sheets-ui/src/commands/commands/insert-range-move-down-confirm.command.ts b/packages/sheets-ui/src/commands/commands/insert-range-move-down-confirm.command.ts
index e4544c87a8..a1c2d90c89 100644
--- a/packages/sheets-ui/src/commands/commands/insert-range-move-down-confirm.command.ts
+++ b/packages/sheets-ui/src/commands/commands/insert-range-move-down-confirm.command.ts
@@ -15,6 +15,7 @@
*/
import type { ICommand, IRange } from '@univerjs/core';
+import type { LocaleKey } from '../../locale/types';
import { CommandType, ICommandService, IConfirmService, IUniverInstanceService, LocaleService, Rectangle } from '@univerjs/core';
import { getSheetCommandTarget, InsertRangeMoveDownCommand, SheetsSelectionsService } from '@univerjs/sheets';
@@ -48,9 +49,9 @@ export const InsertRangeMoveDownConfirmCommand: ICommand = {
if (worksheet.getRowFiltered(i)) {
const result = await confirmService.confirm({
id: InsertRangeMoveDownConfirmCommand.id,
- title: { title: localeService.t('sheets-ui.filter.confirm.error') },
- children: { title: localeService.t('sheets-ui.filter.confirm.notAllowedToInsertRange') },
- confirmText: localeService.t('sheets-ui.button.confirm'),
+ title: { title: localeService.t<LocaleKey>('sheets-ui.filter.confirm.error') },
+ children: { title: localeService.t<LocaleKey>('sheets-ui.filter.confirm.notAllowedToInsertRange') },
+ confirmText: localeService.t<LocaleKey>('sheets-ui.button.confirm'),
});
if (result) {
return false;
@@ -70,10 +71,10 @@ export const InsertRangeMoveDownConfirmCommand: ICommand = {
const result = await confirmService.confirm({
id: InsertRangeMoveDownConfirmCommand.id,
- title: { title: localeService.t('sheets-ui.merge.confirm.warning') },
- children: { title: localeService.t('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
- cancelText: localeService.t('sheets-ui.button.cancel'),
- confirmText: localeService.t('sheets-ui.button.confirm'),
+ title: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.warning') },
+ children: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
+ cancelText: localeService.t<LocaleKey>('sheets-ui.button.cancel'),
+ confirmText: localeService.t<LocaleKey>('sheets-ui.button.confirm'),
});
if (result) {
return commandService.executeCommand(InsertRangeMoveDownCommand.id);
diff --git a/packages/sheets-ui/src/commands/commands/insert-range-move-right-confirm.command.ts b/packages/sheets-ui/src/commands/commands/insert-range-move-right-confirm.command.ts
index aee89ff845..9de79a416b 100644
--- a/packages/sheets-ui/src/commands/commands/insert-range-move-right-confirm.command.ts
+++ b/packages/sheets-ui/src/commands/commands/insert-range-move-right-confirm.command.ts
@@ -15,6 +15,7 @@
*/
import type { ICommand, IRange } from '@univerjs/core';
+import type { LocaleKey } from '../../locale/types';
import { CommandType, ICommandService, IConfirmService, IUniverInstanceService, LocaleService, Rectangle } from '@univerjs/core';
import { getSheetCommandTarget, InsertRangeMoveRightCommand, SheetsSelectionsService } from '@univerjs/sheets';
@@ -58,10 +59,10 @@ export const InsertRangeMoveRightConfirmCommand: ICommand = {
const result = await confirmService.confirm({
id: InsertRangeMoveRightConfirmCommand.id,
- title: { title: localeService.t('sheets-ui.merge.confirm.warning') },
- children: { title: localeService.t('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
- cancelText: localeService.t('sheets-ui.button.cancel'),
- confirmText: localeService.t('sheets-ui.button.confirm'),
+ title: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.warning') },
+ children: { title: localeService.t<LocaleKey>('sheets-ui.merge.confirm.dismantleMergeCellWarning') },
+ cancelText: localeService.t<LocaleKey>('sheets-ui.button.cancel'),
+ confirmText: localeService.t<LocaleKey>('sheets-ui.button.confirm'),
});
if (result) {
return commandService.executeCommand(InsertRangeMoveRightCommand.id);
diff --git a/packages/sheets-ui/src/locale/ar-SA.ts b/packages/sheets-ui/src/locale/ar-SA.ts
index 255ac5fec7..4f849ce565 100644
--- a/packages/sheets-ui/src/locale/ar-SA.ts
+++ b/packages/sheets-ui/src/locale/ar-SA.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'إلغاء الدمج',
overlappingError: 'لا يمكن دمج المناطق المتداخلة',
partiallyError: 'لا يمكن إجراء هذه العملية على خلايا مدموجة جزئياً',
+ confirm: {
+ warning: 'تحذير',
+ dismantleMergeCellWarning: 'ستؤدي هذه العملية إلى إلغاء دمج الخلايا المدمجة. هل تريد المتابعة؟',
+ },
},
filter: {
+ confirm: {
+ error: 'لا يمكن تنفيذ هذه العملية',
+ notAllowedToInsertRange: 'هذه العملية غير مسموح بها لأن النطاق يحتوي على صفوف تمت تصفيتها.',
+ },
},
textWrap: {
overflow: 'تجاوز',
diff --git a/packages/sheets-ui/src/locale/ca-ES.ts b/packages/sheets-ui/src/locale/ca-ES.ts
index c244c2e839..13f122ddea 100644
--- a/packages/sheets-ui/src/locale/ca-ES.ts
+++ b/packages/sheets-ui/src/locale/ca-ES.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Descombinar cel·les',
overlappingError: 'No es poden combinar àrees superposades',
partiallyError: 'No es pot realitzar aquesta operació en cel·les parcialment combinades',
+ confirm: {
+ warning: 'Avís',
+ dismantleMergeCellWarning: 'Aquesta operació descombinarà les cel·les combinades. Voleu continuar?',
+ },
},
filter: {
+ confirm: {
+ error: 'No es pot realitzar aquesta operació',
+ notAllowedToInsertRange: 'Aquesta operació no està permesa perquè l’interval conté files filtrades.',
+ },
},
textWrap: {
overflow: 'Desbordament',
diff --git a/packages/sheets-ui/src/locale/de-DE.ts b/packages/sheets-ui/src/locale/de-DE.ts
index 24d43451fd..23bf06f753 100644
--- a/packages/sheets-ui/src/locale/de-DE.ts
+++ b/packages/sheets-ui/src/locale/de-DE.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Verbindung aufheben',
overlappingError: 'Überlappende Bereiche können nicht verbunden werden',
partiallyError: 'Dieser Vorgang kann nicht für teilweise verbundene Zellen ausgeführt werden',
+ confirm: {
+ warning: 'Warnung',
+ dismantleMergeCellWarning: 'Dieser Vorgang hebt verbundene Zellen auf. Fortfahren?',
+ },
},
filter: {
+ confirm: {
+ error: 'Dieser Vorgang kann nicht ausgeführt werden',
+ notAllowedToInsertRange: 'Dieser Vorgang ist nicht erlaubt, da der Bereich gefilterte Zeilen enthält.',
+ },
},
textWrap: {
overflow: 'Überlauf',
diff --git a/packages/sheets-ui/src/locale/en-US.ts b/packages/sheets-ui/src/locale/en-US.ts
index 8dbdc9215b..2e109d3bf4 100644
--- a/packages/sheets-ui/src/locale/en-US.ts
+++ b/packages/sheets-ui/src/locale/en-US.ts
@@ -106,8 +106,16 @@ const locale = {
cancel: 'Cancel merge',
overlappingError: 'Cannot merge overlapping areas',
partiallyError: 'Cannot perform this operation on partially merged cells',
+ confirm: {
+ warning: 'Warning',
+ dismantleMergeCellWarning: 'This operation will unmerge merged cells. Continue?',
+ },
},
filter: {
+ confirm: {
+ error: 'Cannot perform this operation',
+ notAllowedToInsertRange: 'This operation is not allowed because the range contains filtered rows.',
+ },
},
textWrap: {
overflow: 'Overflow',
diff --git a/packages/sheets-ui/src/locale/es-ES.ts b/packages/sheets-ui/src/locale/es-ES.ts
index 38f15d06d5..7e6aba533d 100644
--- a/packages/sheets-ui/src/locale/es-ES.ts
+++ b/packages/sheets-ui/src/locale/es-ES.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Separar celdas',
overlappingError: 'No se pueden combinar áreas superpuestas',
partiallyError: 'No se puede realizar esta operación en celdas parcialmente combinadas',
+ confirm: {
+ warning: 'Advertencia',
+ dismantleMergeCellWarning: 'Esta operación separará las celdas combinadas. ¿Desea continuar?',
+ },
},
filter: {
+ confirm: {
+ error: 'No se puede realizar esta operación',
+ notAllowedToInsertRange: 'Esta operación no está permitida porque el rango contiene filas filtradas.',
+ },
},
textWrap: {
overflow: 'Desbordamiento',
diff --git a/packages/sheets-ui/src/locale/fa-IR.ts b/packages/sheets-ui/src/locale/fa-IR.ts
index a4f9016921..5725348e3f 100644
--- a/packages/sheets-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-ui/src/locale/fa-IR.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'لغو ادغام',
overlappingError: 'نمی‌توان نواحی هم‌پوشان را ادغام کرد',
partiallyError: 'نمی‌توان این عملیات را روی سلول‌های ادغام‌شده جزئی انجام داد',
+ confirm: {
+ warning: 'هشدار',
+ dismantleMergeCellWarning: 'این عملیات سلول‌های ادغام‌شده را از حالت ادغام خارج می‌کند. ادامه می‌دهید؟',
+ },
},
filter: {
+ confirm: {
+ error: 'نمی‌توان این عملیات را انجام داد',
+ notAllowedToInsertRange: 'این عملیات مجاز نیست زیرا محدوده شامل ردیف‌های فیلترشده است.',
+ },
},
textWrap: {
overflow: 'سرریز',
diff --git a/packages/sheets-ui/src/locale/fr-FR.ts b/packages/sheets-ui/src/locale/fr-FR.ts
index b9df7be455..765cb379b8 100644
--- a/packages/sheets-ui/src/locale/fr-FR.ts
+++ b/packages/sheets-ui/src/locale/fr-FR.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Annuler la fusion',
overlappingError: 'Impossible de fusionner des zones qui se chevauchent',
partiallyError: 'Impossible d\'effectuer cette opération sur des cellules partiellement fusionnées',
+ confirm: {
+ warning: 'Avertissement',
+ dismantleMergeCellWarning: 'Cette opération annulera la fusion des cellules fusionnées. Continuer ?',
+ },
},
filter: {
+ confirm: {
+ error: 'Impossible d’effectuer cette opération',
+ notAllowedToInsertRange: 'Cette opération n’est pas autorisée, car la plage contient des lignes filtrées.',
+ },
},
textWrap: {
overflow: 'Débordement',
diff --git a/packages/sheets-ui/src/locale/id-ID.ts b/packages/sheets-ui/src/locale/id-ID.ts
index 49b78424c2..769f38fc58 100644
--- a/packages/sheets-ui/src/locale/id-ID.ts
+++ b/packages/sheets-ui/src/locale/id-ID.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Batalkan penggabungan',
overlappingError: 'Tidak dapat menggabungkan area yang tumpang tindih',
partiallyError: 'Tidak dapat melakukan operasi ini pada sel yang digabungkan sebagian',
+ confirm: {
+ warning: 'Peringatan',
+ dismantleMergeCellWarning: 'Operasi ini akan membatalkan penggabungan sel. Lanjutkan?',
+ },
},
filter: {
+ confirm: {
+ error: 'Tidak dapat melakukan operasi ini',
+ notAllowedToInsertRange: 'Operasi ini tidak diizinkan karena rentang berisi baris yang difilter.',
+ },
},
textWrap: {
overflow: 'Meluap',
diff --git a/packages/sheets-ui/src/locale/it-IT.ts b/packages/sheets-ui/src/locale/it-IT.ts
index 975dab9d3c..959a39c11b 100644
--- a/packages/sheets-ui/src/locale/it-IT.ts
+++ b/packages/sheets-ui/src/locale/it-IT.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Annulla unione',
overlappingError: 'Impossibile unire aree sovrapposte',
partiallyError: 'Impossibile eseguire questa operazione su celle parzialmente unite',
+ confirm: {
+ warning: 'Avviso',
+ dismantleMergeCellWarning: 'Questa operazione annullerà l’unione delle celle unite. Continuare?',
+ },
},
filter: {
+ confirm: {
+ error: 'Impossibile eseguire questa operazione',
+ notAllowedToInsertRange: 'Questa operazione non è consentita perché l’intervallo contiene righe filtrate.',
+ },
},
textWrap: {
overflow: 'Trabocca',
diff --git a/packages/sheets-ui/src/locale/ja-JP.ts b/packages/sheets-ui/src/locale/ja-JP.ts
index 7fba80f0fd..4e8ccc328e 100644
--- a/packages/sheets-ui/src/locale/ja-JP.ts
+++ b/packages/sheets-ui/src/locale/ja-JP.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: '結合解除',
overlappingError: '重なっている範囲は結合できません',
partiallyError: '部分的に結合されたセルには操作できません',
+ confirm: {
+ warning: '警告',
+ dismantleMergeCellWarning: 'この操作により結合セルが解除されます。続行しますか?',
+ },
},
filter: {
+ confirm: {
+ error: 'この操作は実行できません',
+ notAllowedToInsertRange: '範囲にフィルターされた行が含まれているため、この操作は許可されていません。',
+ },
},
textWrap: {
overflow: 'オーバーフロー',
diff --git a/packages/sheets-ui/src/locale/ko-KR.ts b/packages/sheets-ui/src/locale/ko-KR.ts
index 8797a3fbfd..1de0bb1a92 100644
--- a/packages/sheets-ui/src/locale/ko-KR.ts
+++ b/packages/sheets-ui/src/locale/ko-KR.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: '병합 해제',
overlappingError: '겹치는 영역은 병합할 수 없습니다',
partiallyError: '부분 병합된 셀에서는 작업할 수 없습니다',
+ confirm: {
+ warning: '경고',
+ dismantleMergeCellWarning: '이 작업은 병합된 셀을 해제합니다. 계속하시겠습니까?',
+ },
},
filter: {
+ confirm: {
+ error: '이 작업을 수행할 수 없습니다',
+ notAllowedToInsertRange: '범위에 필터링된 행이 포함되어 있어 이 작업을 수행할 수 없습니다.',
+ },
},
textWrap: {
overflow: '넘침',
diff --git a/packages/sheets-ui/src/locale/pl-PL.ts b/packages/sheets-ui/src/locale/pl-PL.ts
index 16aa9baf00..1747d479aa 100644
--- a/packages/sheets-ui/src/locale/pl-PL.ts
+++ b/packages/sheets-ui/src/locale/pl-PL.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Anuluj scalenie',
overlappingError: 'Nie można scalić nakładających się obszarów',
partiallyError: 'Nie można wykonać tej operacji na częściowo scalonych komórkach',
+ confirm: {
+ warning: 'Ostrzeżenie',
+ dismantleMergeCellWarning: 'Ta operacja rozłączy scalone komórki. Kontynuować?',
+ },
},
filter: {
+ confirm: {
+ error: 'Nie można wykonać tej operacji',
+ notAllowedToInsertRange: 'Ta operacja jest niedozwolona, ponieważ zakres zawiera filtrowane wiersze.',
+ },
},
textWrap: {
overflow: 'Przepełnienie',
diff --git a/packages/sheets-ui/src/locale/pt-BR.ts b/packages/sheets-ui/src/locale/pt-BR.ts
index 6a9f05e8f4..5baa03b12a 100644
--- a/packages/sheets-ui/src/locale/pt-BR.ts
+++ b/packages/sheets-ui/src/locale/pt-BR.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Cancelar mesclagem',
overlappingError: 'Não é possível mesclar áreas sobrepostas',
partiallyError: 'Não é possível realizar esta operação em células parcialmente mescladas',
+ confirm: {
+ warning: 'Aviso',
+ dismantleMergeCellWarning: 'Esta operação desfará a mesclagem das células. Continuar?',
+ },
},
filter: {
+ confirm: {
+ error: 'Não é possível realizar esta operação',
+ notAllowedToInsertRange: 'Esta operação não é permitida porque o intervalo contém linhas filtradas.',
+ },
},
textWrap: {
overflow: 'Transbordar',
diff --git a/packages/sheets-ui/src/locale/ru-RU.ts b/packages/sheets-ui/src/locale/ru-RU.ts
index 781eb6662b..794271a023 100644
--- a/packages/sheets-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-ui/src/locale/ru-RU.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Отменить объединение',
overlappingError: 'Невозможно объединить перекрывающиеся области',
partiallyError: 'Невозможно выполнить эту операцию на частично объединенных ячейках',
+ confirm: {
+ warning: 'Предупреждение',
+ dismantleMergeCellWarning: 'Эта операция отменит объединение ячеек. Продолжить?',
+ },
},
filter: {
+ confirm: {
+ error: 'Невозможно выполнить эту операцию',
+ notAllowedToInsertRange: 'Эта операция запрещена, так как диапазон содержит отфильтрованные строки.',
+ },
},
textWrap: {
overflow: 'Переполнение',
diff --git a/packages/sheets-ui/src/locale/sk-SK.ts b/packages/sheets-ui/src/locale/sk-SK.ts
index 3acfc1ffe0..c6f662b702 100644
--- a/packages/sheets-ui/src/locale/sk-SK.ts
+++ b/packages/sheets-ui/src/locale/sk-SK.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Zrušiť zlúčenie',
overlappingError: 'Nedá sa zlúčiť prekrývajúce sa oblasti',
partiallyError: 'Túto operáciu nemožno vykonať na čiastočne zlúčených bunkách',
+ confirm: {
+ warning: 'Upozornenie',
+ dismantleMergeCellWarning: 'Táto operácia zruší zlúčenie buniek. Pokračovať?',
+ },
},
filter: {
+ confirm: {
+ error: 'Túto operáciu nemožno vykonať',
+ notAllowedToInsertRange: 'Táto operácia nie je povolená, pretože rozsah obsahuje filtrované riadky.',
+ },
},
textWrap: {
overflow: 'Pretečenie',
diff --git a/packages/sheets-ui/src/locale/vi-VN.ts b/packages/sheets-ui/src/locale/vi-VN.ts
index 780fa881e4..79c7816dea 100644
--- a/packages/sheets-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-ui/src/locale/vi-VN.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: 'Hủy hợp nhất',
overlappingError: 'Không thể hợp nhất vùng chồng chéo',
partiallyError: 'Không thể thực hiện thao tác này trên ô đã hợp nhất',
+ confirm: {
+ warning: 'Cảnh báo',
+ dismantleMergeCellWarning: 'Thao tác này sẽ bỏ hợp nhất các ô đã hợp nhất. Tiếp tục?',
+ },
},
filter: {
+ confirm: {
+ error: 'Không thể thực hiện thao tác này',
+ notAllowedToInsertRange: 'Thao tác này không được phép vì phạm vi chứa các hàng đã lọc.',
+ },
},
textWrap: {
overflow: 'Tràn',
diff --git a/packages/sheets-ui/src/locale/zh-CN.ts b/packages/sheets-ui/src/locale/zh-CN.ts
index fd0ad08180..6ff5bf5af3 100644
--- a/packages/sheets-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-ui/src/locale/zh-CN.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: '取消合并',
overlappingError: '不能合并重叠区域',
partiallyError: '无法对部分合并单元格执行此操作',
+ confirm: {
+ warning: '警告',
+ dismantleMergeCellWarning: '此操作将取消合并单元格,是否继续?',
+ },
},
filter: {
+ confirm: {
+ error: '无法执行此操作',
+ notAllowedToInsertRange: '该范围包含筛选行,无法执行此操作。',
+ },
},
textWrap: {
overflow: '溢出',
diff --git a/packages/sheets-ui/src/locale/zh-HK.ts b/packages/sheets-ui/src/locale/zh-HK.ts
index 49fd0e53d7..3ea839836a 100644
--- a/packages/sheets-ui/src/locale/zh-HK.ts
+++ b/packages/sheets-ui/src/locale/zh-HK.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: '取消合併',
overlappingError: '不能合併重疊區域',
partiallyError: '無法對部分合併儲存格執行此操作',
+ confirm: {
+ warning: '警告',
+ dismantleMergeCellWarning: '此操作將取消合併儲存格,是否繼續?',
+ },
},
filter: {
+ confirm: {
+ error: '無法執行此操作',
+ notAllowedToInsertRange: '該範圍包含篩選列,無法執行此操作。',
+ },
},
textWrap: {
overflow: '溢出',
diff --git a/packages/sheets-ui/src/locale/zh-TW.ts b/packages/sheets-ui/src/locale/zh-TW.ts
index 49fd0e53d7..3ea839836a 100644
--- a/packages/sheets-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-ui/src/locale/zh-TW.ts
@@ -108,8 +108,16 @@ const locale: typeof enUS = {
cancel: '取消合併',
overlappingError: '不能合併重疊區域',
partiallyError: '無法對部分合併儲存格執行此操作',
+ confirm: {
+ warning: '警告',
+ dismantleMergeCellWarning: '此操作將取消合併儲存格,是否繼續?',
+ },
},
filter: {
+ confirm: {
+ error: '無法執行此操作',
+ notAllowedToInsertRange: '該範圍包含篩選列,無法執行此操作。',
+ },
},
textWrap: {
overflow: '溢出',
diff --git a/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx b/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx
index f99eb653d8..07d172e744 100644
--- a/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx
+++ b/packages/sheets-ui/src/views/defined-name/DefinedNameInput.tsx
@@ -18,6 +18,7 @@ import type { Nullable, Workbook } from '@univerjs/core';
import type { IDefinedNamesServiceParam } from '@univerjs/engine-formula';
import type { ComponentType } from 'react';
import type { IRangeSelectorProps } from '../../basics/editor/range';
+import type { LocaleKey } from '../../locale/types';
import { AbsoluteRefType, IUniverInstanceService, LocaleService, UniverInstanceType } from '@univerjs/core';
import { borderBottomClassName, borderClassName, Button, clsx, Input, Radio, RadioGroup, Select } from '@univerjs/design';
import { IDefinedNamesService, IFunctionService, isReferenceStrings, ISuperTableService, LexerTreeBuilder, operatorToken } from '@univerjs/engine-formula';
@@ -84,7 +85,7 @@ export const DefinedNameInput = (props: IDefinedNameInputProps) => {
const [validFormulaOrRange, setValidFormulaOrRange] = useState(true);
const options = [{
- label: localeService.t('sheets-ui.definedName.scopeWorkbook'),
+ label: localeService.t<LocaleKey>('sheets-ui.definedName.scopeWorkbook'),
value: SCOPE_WORKBOOK_VALUE_DEFINED_NAME,
}];
@@ -145,7 +146,7 @@ export const DefinedNameInput = (props: IDefinedNameInputProps) => {
}
if (!validFormulaOrRange) {
- setValidString(localeService.t('sheets-ui.definedName.formulaOrRefStringInvalid'));
+ setValidString(localeService.t<LocaleKey>('sheets-ui.definedName.formulaOrRefStringInvalid'));
return;
}
@@ -194,7 +195,7 @@ export const DefinedNameInput = (props: IDefinedNameInputProps) => {
<div>
<Input
className="univer-w-full"
- placeholder={localeService.t('sheets-ui.definedName.inputNamePlaceholder')}
+ placeholder={localeService.t<LocaleKey>('sheets-ui.definedName.inputNamePlaceholder')}
value={nameValue}
allowClear
onChange={setNameValue}
@@ -202,8 +203,8 @@ export const DefinedNameInput = (props: IDefinedNameInputProps) => {
</div>
<div>
<RadioGroup value={typeValue} onChange={typeValueChange}>
- <Radio value="range">{localeService.t('sheets-ui.definedName.ratioRange')}</Radio>
- <Radio value="formula">{localeService.t('sheets-ui.definedName.ratioFormula')}</Radio>
+ <Radio value="range">{localeService.t<LocaleKey>('sheets-ui.definedName.ratioRange')}</Radio>
+ <Radio value="formula">{localeService.t<LocaleKey>('sheets-ui.definedName.ratioFormula')}</Radio>
</RadioGroup>
</div>
{typeValue === 'range'
@@ -259,7 +260,7 @@ export const DefinedNameInput = (props: IDefinedNameInputProps) => {
<div>
<Input
className="univer-w-full"
- placeholder={localeService.t('sheets-ui.definedName.inputCommentPlaceholder')}
+ placeholder={localeService.t<LocaleKey>('sheets-ui.definedName.inputCommentPlaceholder')}
value={commentValue}
onChange={setCommentValue}
allowClear
@@ -283,13 +284,13 @@ export const DefinedNameInput = (props: IDefinedNameInputProps) => {
cancel?.();
}}
>
- {localeService.t('sheets-ui.definedName.cancel')}
+ {localeService.t<LocaleKey>('sheets-ui.definedName.cancel')}
</Button>
<Button
variant="primary"
onClick={confirmChange}
>
- {localeService.t('sheets-ui.definedName.confirm')}
+ {localeService.t<LocaleKey>('sheets-ui.definedName.confirm')}
</Button>
</div>
</div>
diff --git a/packages/sheets-ui/src/views/permission/SheetPermissionDialog.tsx b/packages/sheets-ui/src/views/permission/SheetPermissionDialog.tsx
index 4cc8cfb67c..c1456152da 100644
--- a/packages/sheets-ui/src/views/permission/SheetPermissionDialog.tsx
+++ b/packages/sheets-ui/src/views/permission/SheetPermissionDialog.tsx
@@ -16,6 +16,7 @@
import type { Workbook } from '@univerjs/core';
import type { ICollaborator, UnitAction } from '@univerjs/protocol';
+import type { LocaleKey } from '../../locale/types';
import {
IAuthzIoService,
ICommandService,
@@ -225,7 +226,7 @@ export const SheetPermissionDialog = () => {
dialogService.close(UNIVER_SHEET_PERMISSION_DIALOG_ID);
}}
>
- {localeService.t('sheets-ui.permission.button.cancel')}
+ {localeService.t<LocaleKey>('sheets-ui.permission.button.cancel')}
</Button>
<Button
variant="primary"
@@ -234,7 +235,7 @@ export const SheetPermissionDialog = () => {
dialogService.close(UNIVER_SHEET_PERMISSION_DIALOG_ID);
}}
>
- {localeService.t('sheets-ui.permission.button.confirm')}
+ {localeService.t<LocaleKey>('sheets-ui.permission.button.confirm')}
</Button>
</div>
</div>
diff --git a/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx b/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx
index 347d846a14..32e2417e46 100644
--- a/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx
+++ b/packages/sheets-ui/src/views/status-bar/CopyableStatisticItem.tsx
@@ -16,6 +16,7 @@
import type { IFunctionNames } from '@univerjs/engine-formula';
import type { FC } from 'react';
+import type { LocaleKey } from '../../locale/types';
import { LocaleService, numfmt } from '@univerjs/core';
import { MessageType, Tooltip } from '@univerjs/design';
import { FUNCTION_NAMES_MATH, FUNCTION_NAMES_STATISTICAL, FUNCTION_NAMES_TEXT } from '@univerjs/engine-formula';
@@ -61,11 +62,11 @@ export const CopyableStatisticItem: FC<IStatisticItem> = (item: IStatisticItem)
await clipboardService.writeText(item.value.toString());
messageService.show({
type: MessageType.Success,
- content: localeService.t('sheets-ui.statusbar.copied'),
+ content: localeService.t<LocaleKey>('sheets-ui.statusbar.copied'),
});
};
return (
- <Tooltip title={localeService.t('sheets-ui.statusbar.clickToCopy')} placement="top">
+ <Tooltip title={localeService.t<LocaleKey>('sheets-ui.statusbar.clickToCopy')} placement="top">
<div
key={item.name}
className={`
diff --git a/packages/ui/src/views/components/ribbon/Ribbon.tsx b/packages/ui/src/views/components/ribbon/Ribbon.tsx
index 3a6b6316ec..fcb8010019 100644
--- a/packages/ui/src/views/components/ribbon/Ribbon.tsx
+++ b/packages/ui/src/views/components/ribbon/Ribbon.tsx
@@ -16,6 +16,7 @@
import type { ComponentType } from 'react';
import type { RibbonType } from '../../../controllers/ui/ui.controller';
+import type { LocaleKey } from '../../../locale/types';
import type { IMenuSchema } from '../../../services/menu/menu-manager.service';
import { LocaleService, throttle } from '@univerjs/core';
import { borderBottomClassName, clsx, divideXClassName, Dropdown } from '@univerjs/design';
@@ -313,7 +314,7 @@ export function Ribbon(props: IRibbonProps) {
<button
type="button"
className={toolbarButtonClassName}
- aria-label={localeService.t('ui.ribbon.more')}
+ aria-label={localeService.t<LocaleKey>('ui.ribbon.more')}
aria-haspopup="true"
>
<MoreVerticalIcon />
diff --git a/packages/ui/src/views/components/ribbon/ribbon-menu/ClassicMenu.tsx b/packages/ui/src/views/components/ribbon/ribbon-menu/ClassicMenu.tsx
index 92526c62a7..033bc4eae3 100644
--- a/packages/ui/src/views/components/ribbon/ribbon-menu/ClassicMenu.tsx
+++ b/packages/ui/src/views/components/ribbon/ribbon-menu/ClassicMenu.tsx
@@ -37,7 +37,6 @@ export function ClassicMenu({
dark:!univer-bg-gray-900
`}
role="tablist"
- aria-label={localeService.t('ui.ribbon.menu')}
>
{ribbon.map((group) => {
const isActive = activatedTab === group.key;
diff --git a/packages/ui/src/views/font-family/FontFamilyItem.tsx b/packages/ui/src/views/font-family/FontFamilyItem.tsx
index 876339d418..61ed22d07e 100644
--- a/packages/ui/src/views/font-family/FontFamilyItem.tsx
+++ b/packages/ui/src/views/font-family/FontFamilyItem.tsx
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+import type { LocaleKey } from '../../locale/types';
import type { IFontConfig } from '../../services/font.service';
import { ICommandService, LocaleService } from '@univerjs/core';
import { Tooltip } from '@univerjs/design';
@@ -72,7 +73,7 @@ export const FontFamilyItem = ({ id, value }: { id: string; value: string }) =>
{localeService.t(font.label)}
{!fontService.isFontSupported(font.value) && (
- <Tooltip title={localeService.t('ui.fontFamily.not-supported')}>
+ <Tooltip title={localeService.t<LocaleKey>('ui.fontFamily.not-supported')}>
<InfoIcon
className={`
univer-text-gray-300