mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-06 11:59:51 +08:00
refactor: change locale key (#3838)
This commit is contained in:
@@ -67,7 +67,7 @@ export const FilterList = ({
|
||||
iconPosition="end"
|
||||
style={{ fontSize: 'var(--affine-font-xs)', padding: '0 8px' }}
|
||||
>
|
||||
{t['Add Filter']()}
|
||||
{t['com.affine.filterList.button.add']()}
|
||||
</Button>
|
||||
) : (
|
||||
<IconButton size="small">
|
||||
|
||||
@@ -61,7 +61,9 @@ export const OperationCell = ({
|
||||
</MenuIcon>
|
||||
}
|
||||
>
|
||||
{favorite ? t['Remove from favorites']() : t['Add to Favorites']()}
|
||||
{favorite
|
||||
? t['com.affine.favoritePageOperation.remove']()
|
||||
: t['com.affine.favoritePageOperation.add']()}
|
||||
</MenuItem>
|
||||
{!isDesktop && (
|
||||
<MenuItem
|
||||
@@ -72,7 +74,7 @@ export const OperationCell = ({
|
||||
</MenuIcon>
|
||||
}
|
||||
>
|
||||
{t['Open in new tab']()}
|
||||
{t['com.affine.openPageOperation.newTab']()}
|
||||
</MenuItem>
|
||||
)}
|
||||
<MoveToTrash
|
||||
@@ -131,7 +133,7 @@ export const TrashOperationCell = ({
|
||||
const [open, setOpen] = useState(false);
|
||||
return (
|
||||
<FlexWrapper>
|
||||
<Tooltip content={t['Restore it']()} side="top">
|
||||
<Tooltip content={t['com.affine.trashOperation.restoreIt']()} side="top">
|
||||
<IconButton
|
||||
style={{ marginRight: '12px' }}
|
||||
onClick={() => {
|
||||
@@ -141,7 +143,11 @@ export const TrashOperationCell = ({
|
||||
<ResetIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Tooltip content={t['Delete permanently']()} side="top" align="end">
|
||||
<Tooltip
|
||||
content={t['com.affine.trashOperation.deletePermanently']()}
|
||||
side="top"
|
||||
align="end"
|
||||
>
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
setOpen(true);
|
||||
@@ -151,9 +157,9 @@ export const TrashOperationCell = ({
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Confirm
|
||||
title={`${t['Delete permanently']()}?`}
|
||||
content={t['TrashButtonGroupDescription']()}
|
||||
confirmText={t['Delete']()}
|
||||
title={`${t['com.affine.trashOperation.deletePermanently']()}?`}
|
||||
content={t['com.affine.trashOperation.deleteDescription']()}
|
||||
confirmText={t['com.affine.trashOperation.delete']()}
|
||||
confirmType="error"
|
||||
open={open}
|
||||
onConfirm={() => {
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
|
||||
import type { ConfirmProps } from '../../..';
|
||||
import { Confirm } from '../../..';
|
||||
|
||||
export const MoveToTrash = (props: MenuItemProps) => {
|
||||
const t = useAFFiNEI18N();
|
||||
|
||||
@@ -21,7 +22,7 @@ export const MoveToTrash = (props: MenuItemProps) => {
|
||||
type="danger"
|
||||
{...props}
|
||||
>
|
||||
{t['Move to Trash']()}
|
||||
{t['com.affine.moveToTrash.title']()}
|
||||
</MenuItem>
|
||||
);
|
||||
};
|
||||
@@ -36,8 +37,8 @@ const ConfirmModal = ({
|
||||
|
||||
return (
|
||||
<Confirm
|
||||
title={t['Delete page?']()}
|
||||
content={t['will be moved to Trash']({
|
||||
title={t['com.affine.moveToTrash.confirmModal.title']()}
|
||||
content={t['com.affine.moveToTrash.confirmModal.description']({
|
||||
title: title || 'Untitled',
|
||||
})}
|
||||
confirmButtonTestId="confirm-delete-page"
|
||||
|
||||
@@ -96,7 +96,7 @@ export const CollectionBar = (props: CollectionBarProps) => {
|
||||
style={{ border: 'none', position: 'static' }}
|
||||
onClick={() => setting.backToAll()}
|
||||
>
|
||||
{t['Back to all']()}
|
||||
{t['com.affine.collectionBar.backToAll']()}
|
||||
</Button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -68,7 +68,7 @@ export const EditCollectionModel = ({
|
||||
<EditCollection
|
||||
propertiesMeta={propertiesMeta}
|
||||
title={title}
|
||||
onConfirmText={t['Save']()}
|
||||
onConfirmText={t['com.affine.editCollection.save']()}
|
||||
init={init}
|
||||
getPageInfo={getPageInfo}
|
||||
onCancel={onClose}
|
||||
@@ -164,7 +164,7 @@ export const EditCollection = ({
|
||||
}}
|
||||
>
|
||||
<div className={styles.saveTitle}>
|
||||
{title ?? t['Update Collection']()}
|
||||
{title ?? t['com.affine.editCollection.updateCollection']()}
|
||||
</div>
|
||||
<ScrollableContainer
|
||||
className={styles.scrollContainer}
|
||||
@@ -201,7 +201,9 @@ export const EditCollection = ({
|
||||
minHeight: '200px',
|
||||
}}
|
||||
>
|
||||
<div className={styles.filterTitle}>{t['Filters']()}</div>
|
||||
<div className={styles.filterTitle}>
|
||||
{t['com.affine.editCollection.filters']()}
|
||||
</div>
|
||||
<FilterList
|
||||
propertiesMeta={propertiesMeta}
|
||||
value={value.filterList}
|
||||
@@ -228,7 +230,7 @@ export const EditCollection = ({
|
||||
<div style={{ marginTop: 20 }}>
|
||||
<Input
|
||||
data-testid="input-collection-title"
|
||||
placeholder={t['Untitled Collection']()}
|
||||
placeholder={t['com.affine.editCollection.untitledCollection']()}
|
||||
defaultValue={value.name}
|
||||
onChange={name => onChange({ ...value, name })}
|
||||
/>
|
||||
@@ -242,7 +244,7 @@ export const EditCollection = ({
|
||||
}}
|
||||
>
|
||||
<Button size="large" onClick={onCancel}>
|
||||
{t['Cancel']()}
|
||||
{t['com.affine.editCollection.button.cancel']()}
|
||||
</Button>
|
||||
<Button
|
||||
style={{
|
||||
@@ -254,7 +256,7 @@ export const EditCollection = ({
|
||||
disabled={isNameEmpty}
|
||||
onClick={onSaveCollection}
|
||||
>
|
||||
{onConfirmText ?? t['Create']()}
|
||||
{onConfirmText ?? t['com.affine.editCollection.button.create']()}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -297,10 +299,10 @@ export const SaveCollectionButton = ({
|
||||
size="large"
|
||||
style={{ padding: '7px 8px' }}
|
||||
>
|
||||
{t['Save as New Collection']()}
|
||||
{t['com.affine.editCollection.saveCollection']()}
|
||||
</Button>
|
||||
<EditCollectionModel
|
||||
title={t['Save as New Collection']()}
|
||||
title={t['com.affine.editCollection.saveCollection']()}
|
||||
propertiesMeta={propertiesMeta}
|
||||
init={init}
|
||||
onConfirm={onConfirm}
|
||||
|
||||
Reference in New Issue
Block a user