There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix: some typo and i18n (#3155)
37206ad2d106bc97
diff --git a/apps/web/src/components/pure/workspace-slider-bar/collections/collections-list.tsx b/apps/web/src/components/pure/workspace-slider-bar/collections/collections-list.tsxindex 583a15b8c2..e640f7b9c9 100644--- a/apps/web/src/components/pure/workspace-slider-bar/collections/collections-list.tsx+++ b/apps/web/src/components/pure/workspace-slider-bar/collections/collections-list.tsx@@ -7,6 +7,7 @@ import {} from '@affine/component/page-list';import type { Collection } from '@affine/env/filter';import type { GetPageInfoById } from '@affine/env/page-info';+import { useAFFiNEI18N } from '@affine/i18n/hooks';import {DeleteIcon,FilterIcon,@@ -51,6 +52,7 @@ const CollectionOperations = ({showUpdateCollection: () => void;setting: ReturnType<typeof useCollectionManager>;}) => {+ const t = useAFFiNEI18N();const actions = useMemo<Array<| {@@ -68,12 +70,12 @@ const CollectionOperations = ({() => [{icon: <FilterIcon />,- name: 'Edit Filter',+ name: t['Edit Filter'](),click: showUpdateCollection,},{icon: <UnpinIcon />,- name: 'Unpin',+ name: t['Unpin'](),click: () => {return setting.updateCollection({...view,@@ -86,14 +88,14 @@ const CollectionOperations = ({},{icon: <DeleteIcon style={{ color: 'var(--affine-warning-color)' }} />,- name: 'Delete',+ name: t['Delete'](),click: () => {return setting.deleteCollection(view.id);},className: styles.deleteFolder,},],- [setting, showUpdateCollection, view]+ [setting, showUpdateCollection, t, view]);return (<div style={{ minWidth: 150 }}>diff --git a/apps/web/src/components/pure/workspace-slider-bar/collections/page.tsx b/apps/web/src/components/pure/workspace-slider-bar/collections/page.tsxindex 63c4c42715..6389480740 100644--- a/apps/web/src/components/pure/workspace-slider-bar/collections/page.tsx+++ b/apps/web/src/components/pure/workspace-slider-bar/collections/page.tsx@@ -39,6 +39,7 @@ export const PageOperations = ({addToExcludeList: (id: string) => void;}) => {const { removeToTrash } = useBlockSuiteMetaHelper(workspace);+ const t = useAFFiNEI18N();const actions = useMemo<Array<| {@@ -58,7 +59,7 @@ export const PageOperations = ({? [{icon: <FilterMinusIcon />,- name: 'Remove special filter',+ name: t['Remove special filter'](),click: () => removeFromAllowList(page.id),},]@@ -67,7 +68,7 @@ export const PageOperations = ({? [{icon: <FilterUndoIcon />,- name: 'Exclude from filter',+ name: t['Exclude from filter'](),click: () => addToExcludeList(page.id),},]@@ -77,7 +78,7 @@ export const PageOperations = ({},{icon: <DeleteIcon style={{ color: 'var(--affine-warning-color)' }} />,- name: 'Delete',+ name: t['Delete'](),click: () => {removeToTrash(page.id);},@@ -86,9 +87,10 @@ export const PageOperations = ({],[inAllowList,+ t,inExcludeList,- page.id,removeFromAllowList,+ page.id,addToExcludeList,removeToTrash,]diff --git a/apps/web/src/components/pure/workspace-slider-bar/components/reference-page.tsx b/apps/web/src/components/pure/workspace-slider-bar/components/reference-page.tsxindex 9b249e0195..3e9cdbe6b0 100644--- a/apps/web/src/components/pure/workspace-slider-bar/components/reference-page.tsx+++ b/apps/web/src/components/pure/workspace-slider-bar/components/reference-page.tsx@@ -1,4 +1,5 @@import { MenuLinkItem } from '@affine/component/app-sidebar';+import { useAFFiNEI18N } from '@affine/i18n/hooks';import { EdgelessIcon, PageIcon } from '@blocksuite/icons';import type { PageMeta, Workspace } from '@blocksuite/store';import * as Collapsible from '@radix-ui/react-collapsible';@@ -40,6 +41,7 @@ export const ReferencePage = ({const collapsible = referencesToShow.length > 0;const nestedItem = parentIds.size > 0;const untitled = !metaMapping[pageId]?.title;+ const t = useAFFiNEI18N();return (<Collapsible.RootclassName={styles.favItemWrapper}@@ -56,7 +58,7 @@ export const ReferencePage = ({onCollapsedChange={setCollapsed}><span className={styles.label} data-untitled={untitled}>- {metaMapping[pageId]?.title || 'Untitled'}+ {metaMapping[pageId]?.title || t['Untitled']()}</span></MenuLinkItem>{collapsible && (diff --git a/packages/component/src/components/page-list/filter/filter-tag-translation.ts b/packages/component/src/components/page-list/filter/filter-tag-translation.tsindex 9d4069d9f9..2684d1ed3b 100644--- a/packages/component/src/components/page-list/filter/filter-tag-translation.ts+++ b/packages/component/src/components/page-list/filter/filter-tag-translation.ts@@ -11,6 +11,8 @@ export const FilterTag = ({ name }: FilterTagProps) => {return t['Created']();case 'Updated':return t['Updated']();+ case 'Tags':+ return t['Tags']();case 'Is Favourited':return t['com.affine.filter.is-favourited']();case 'after':@@ -19,6 +21,18 @@ export const FilterTag = ({ name }: FilterTagProps) => {return t['com.affine.filter.before']();case 'is':return t['com.affine.filter.is']();+ case 'is not empty':+ return t['com.affine.filter.is not empty']();+ case 'is empty':+ return t['com.affine.filter.is empty']();+ case 'contains all':+ return t['com.affine.filter.contains all']();+ case 'contains one of':+ return t['com.affine.filter.contains one of']();+ case 'does not contains all':+ return t['com.affine.filter.does not contains all']();+ case 'does not contains one of':+ return t['com.affine.filter.does not contains one of']();case 'true':return t['com.affine.filter.true']();case 'false':diff --git a/packages/component/src/components/page-list/view/collection-bar.tsx b/packages/component/src/components/page-list/view/collection-bar.tsxindex 2634ef9844..c62603c82f 100644--- a/packages/component/src/components/page-list/view/collection-bar.tsx+++ b/packages/component/src/components/page-list/view/collection-bar.tsx@@ -1,6 +1,7 @@import { EditCollectionModel } from '@affine/component/page-list';import type { PropertiesMeta } from '@affine/env/filter';import type { GetPageInfoById } from '@affine/env/page-info';+import { useAFFiNEI18N } from '@affine/i18n/hooks';import {DeleteIcon,FilterIcon,@@ -80,6 +81,7 @@ export const CollectionBar = ({[setting, collection]);const onClose = useCallback(() => setOpen(false), []);+ const t = useAFFiNEI18N();return !setting.isDefault ? (<tr style={{ userSelect: 'none' }}><td>@@ -124,8 +126,11 @@ export const CollectionBar = ({justifyContent: 'end',}}>- <Button style={{ border: 'none' }} onClick={() => setting.backToAll()}>- Back to all+ <Button+ style={{ border: 'none', position: 'static' }}+ onClick={() => setting.backToAll()}+ >+ {t['Back to all']()}</Button></td></tr>diff --git a/packages/component/src/components/page-list/view/create-collection.tsx b/packages/component/src/components/page-list/view/create-collection.tsxindex 39de59b0d6..470dc8f295 100644--- a/packages/component/src/components/page-list/view/create-collection.tsx+++ b/packages/component/src/components/page-list/view/create-collection.tsx@@ -1,6 +1,7 @@import type { Collection } from '@affine/env/filter';import type { PropertiesMeta } from '@affine/env/filter';import type { GetPageInfoById } from '@affine/env/page-info';+import { useAFFiNEI18N } from '@affine/i18n/hooks';import {EdgelessIcon,PageIcon,@@ -35,14 +36,17 @@ export const EditCollectionModel = ({onClose,getPageInfo,propertiesMeta,+ title,}: {init?: Collection;onConfirm: (view: Collection) => void;open: boolean;onClose: () => void;+ title?: string;getPageInfo: GetPageInfoById;propertiesMeta: PropertiesMeta;}) => {+ const t = useAFFiNEI18N();return (<Modal open={open} onClose={onClose}><ModalWrapper@@ -61,8 +65,8 @@ export const EditCollectionModel = ({{init ? (<EditCollectionpropertiesMeta={propertiesMeta}- title="Update Collection"- onConfirmText="Save"+ title={title}+ onConfirmText={t['Save']()}init={init}getPageInfo={getPageInfo}onCancel={onClose}@@ -129,6 +133,7 @@ export const EditCollection = ({}: CreateCollectionProps & {onCancel: () => void;}) => {+ const t = useAFFiNEI18N();const [value, onChange] = useState<Collection>(init);const removeFromExcludeList = useCallback((id: string) => {@@ -157,7 +162,7 @@ export const EditCollection = ({}}><div className={styles.saveTitle}>- {title ?? 'Save As New Collection'}+ {title ?? t['Update Collection']()}</div><ScrollableContainerclassName={styles.scrollContainer}@@ -244,7 +249,7 @@ export const EditCollection = ({}}><Button className={styles.cancelButton} onClick={onCancel}>- Cancel+ {t['Cancel']()}</Button><Buttonstyle={{@@ -259,7 +264,7 @@ export const EditCollection = ({}}}>- {onConfirmText ?? 'Create'}+ {onConfirmText ?? t['Create']()}</Button></div></div>@@ -272,6 +277,7 @@ export const SaveCollectionButton = ({propertiesMeta,}: CreateCollectionProps) => {const [show, changeShow] = useState(false);+ const t = useAFFiNEI18N();return (<><Button@@ -288,6 +294,7 @@ export const SaveCollectionButton = ({</div></Button><EditCollectionModel+ title={t['Save As New Collection']()}propertiesMeta={propertiesMeta}init={init}onConfirm={onConfirm}diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.jsonindex ad1cc3f0b8..ec20b1004b 100644--- a/packages/i18n/src/resources/en.json+++ b/packages/i18n/src/resources/en.json@@ -61,6 +61,12 @@"Export AFFiNE backup file": "Export AFFiNE backup file","com.affine.filter.before": "before","com.affine.filter.is": "is",+ "com.affine.filter.is not empty": "is not empty",+ "com.affine.filter.is empty": "is empty",+ "com.affine.filter.contains all": "contains all",+ "com.affine.filter.contains one of": "contains one of",+ "com.affine.filter.does not contains all": "does not contains all",+ "com.affine.filter.does not contains one of": "does not contains one of","com.affine.filter.true": "true","com.affine.filter.false": "false","com.affine.filter.save-view": "Save View",@@ -364,6 +370,13 @@"Date Format": "Date Format","Select All": "Select All","Collections": "Collections",+ "Save As New Collection": "Save As New Collection",+ "Update Collection": "Update Collection",+ "Back to all": "Back to all",+ "Edit Filter": "Edit Filter",+ "Unpin": "Unpin",+ "Remove special filter": "Remove special filter",+ "Exclude from filter": "Exclude from filter","Customize your date style.": "Customise your date style.","Contact with us": "Contact Us","Terms of Use": "Terms of Use",