From 807762cf1a6d9ca5d34e1bffd2f3c0aef9aaa1a4 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 14:39:19 +0800 Subject: [PATCH 01/34] feat: add sync scripts --- packages/i18n/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index cc559528e3..2f9cf000e3 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -10,7 +10,10 @@ ".": "./dist/src/index.js" }, "scripts": { - "build": "tsc --project ./tsconfig.json" + "build": "tsc --project ./tsconfig.json", + "sync-languages": "NODE_OPTIONS=--experimental-fetch ts-node src/scripts/sync.ts", + "sync-languages:check": "pnpm run sync-languages --check", + "download-resources": "NODE_OPTIONS=--experimental-fetch ts-node src/scripts/download.ts" }, "keywords": [], "repository": { From 635216194f3a466b46d7a5bc9a2f093d73e9d14d Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 14:39:39 +0800 Subject: [PATCH 02/34] feat: add readme for i18n --- packages/i18n/README.md | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 packages/i18n/README.md diff --git a/packages/i18n/README.md b/packages/i18n/README.md new file mode 100644 index 0000000000..7cd4fba1bf --- /dev/null +++ b/packages/i18n/README.md @@ -0,0 +1,62 @@ +# i18n + +## Usages + +- Update missing translations into the base resources, a.k.a the `src/resources/en.json` +- Replace literal text with translation keys + +```tsx +import { useTranslation } from '@affine/i18n'; + +// src/resources/en.json +// { +// 'Text': 'some text', +// 'Switch to language': 'Switch to {{language}}', // <- you can interpolation by curly brackets +// }; + +const App = () => { + const { t } = useTranslation(); + + const changeLanguage = (language: string) => { + i18n.changeLanguage(language); + }; + + return ( +
+
{t('Text')}
+ + + +
+ ); +}; +``` + +## How the i18n workflow works? + +- When the `src/resources/en.json`(base language) updated and merged to the develop branch, will trigger the `languages-sync` action. +- The `languages-sync` action will check the base language and add missing translations to the Tolgee platform. +- This way, partners from the community can update the translations. +- Finally, the `languages-download` action will regularly download the latest translation resources from the Tolgee platform. + +## How to sync translations manually + +- Set token as environment variable + +```shell +export TOLGEE_API_KEY=tgpak_XXXXXXX +``` + +- Run the `sync-languages:check` to check all languages +- Run the `sync-languages` script to add new keys to the tolgee platform + +## References + +- [AFFiNE | Tolgee](https://i18n.affine.pro/) +- [Tolgee Documentation](https://tolgee.io/docs/) +- [i18next](https://www.i18next.com/) +- [react-i18next](https://react.i18next.com/) From dae7f99fe8c4c51452e4fb4c06684c449b4060c7 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 14:39:57 +0800 Subject: [PATCH 03/34] chore: rename dir --- packages/i18n/src/{script => scripts}/api.ts | 0 packages/i18n/src/{script => scripts}/download.ts | 0 packages/i18n/src/{script => scripts}/request.ts | 0 packages/i18n/src/{script => scripts}/sync.ts | 0 packages/i18n/src/{script => scripts}/utils.ts | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename packages/i18n/src/{script => scripts}/api.ts (100%) rename packages/i18n/src/{script => scripts}/download.ts (100%) rename packages/i18n/src/{script => scripts}/request.ts (100%) rename packages/i18n/src/{script => scripts}/sync.ts (100%) rename packages/i18n/src/{script => scripts}/utils.ts (100%) diff --git a/packages/i18n/src/script/api.ts b/packages/i18n/src/scripts/api.ts similarity index 100% rename from packages/i18n/src/script/api.ts rename to packages/i18n/src/scripts/api.ts diff --git a/packages/i18n/src/script/download.ts b/packages/i18n/src/scripts/download.ts similarity index 100% rename from packages/i18n/src/script/download.ts rename to packages/i18n/src/scripts/download.ts diff --git a/packages/i18n/src/script/request.ts b/packages/i18n/src/scripts/request.ts similarity index 100% rename from packages/i18n/src/script/request.ts rename to packages/i18n/src/scripts/request.ts diff --git a/packages/i18n/src/script/sync.ts b/packages/i18n/src/scripts/sync.ts similarity index 100% rename from packages/i18n/src/script/sync.ts rename to packages/i18n/src/scripts/sync.ts diff --git a/packages/i18n/src/script/utils.ts b/packages/i18n/src/scripts/utils.ts similarity index 100% rename from packages/i18n/src/script/utils.ts rename to packages/i18n/src/scripts/utils.ts From 98692ba790b2bdd7dccad18674f870928c9664ee Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 15:27:45 +0800 Subject: [PATCH 04/34] feat: add ts-node --- packages/i18n/package.json | 5 +- pnpm-lock.yaml | 94 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 2f9cf000e3..eb6c30a1a1 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -11,9 +11,9 @@ }, "scripts": { "build": "tsc --project ./tsconfig.json", - "sync-languages": "NODE_OPTIONS=--experimental-fetch ts-node src/scripts/sync.ts", + "sync-languages": "NODE_OPTIONS=--experimental-fetch ts-node-esm src/scripts/sync.ts", "sync-languages:check": "pnpm run sync-languages --check", - "download-resources": "NODE_OPTIONS=--experimental-fetch ts-node src/scripts/download.ts" + "download-resources": "NODE_OPTIONS=--experimental-fetch ts-node-esm src/scripts/download.ts" }, "keywords": [], "repository": { @@ -27,6 +27,7 @@ }, "devDependencies": { "@types/prettier": "^2.7.2", + "ts-node": "^10.9.1", "typescript": "^4.8.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 722b006877..a6a2417511 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,6 +164,7 @@ importers: i18next: ^21.9.1 prettier: ^2.7.1 react-i18next: ^11.18.4 + ts-node: ^10.9.1 typescript: ^4.8.4 dependencies: i18next: 21.10.0 @@ -171,6 +172,7 @@ importers: react-i18next: 11.18.6_i18next@21.10.0 devDependencies: '@types/prettier': 2.7.2 + ts-node: 10.9.1_typescript@4.9.3 typescript: 4.9.3 packages/logger: @@ -1711,6 +1713,13 @@ packages: prettier: 2.7.1 dev: true + /@cspotcode/source-map-support/0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + /@emotion/babel-plugin/11.10.2: resolution: {integrity: sha512-xNQ57njWTFVfPAc3cjfuaPdsgLp5QOSuRsj9MA6ndEhH/AzuZM86qIQzt6rq+aGBwj3n5/TkLmU5lhAfdRmogA==} peerDependencies: @@ -2481,6 +2490,13 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@jridgewell/trace-mapping/0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + /@lit/reactive-element/1.4.1: resolution: {integrity: sha512-qDv4851VFSaBWzpS02cXHclo40jsbAjRXnebNXpm0uVg32kCneZPo9RYVQtrTNICtZ+1wAYHu1ZtxWSWMbKrBw==} dev: false @@ -3280,6 +3296,22 @@ packages: resolution: {integrity: sha512-GiS5Df3CzXY/fPBFcM0CKFERZfI4Cg1X33VPZX+NLo7Fwm/h9zu/aU24N1mG75Q9LuMnwKm7woxKr8BiUXGYCg==} dev: false + /@tsconfig/node10/1.0.9: + resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + dev: true + + /@tsconfig/node12/1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14/1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16/1.0.3: + resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} + dev: true + /@types/debug/4.1.7: resolution: {integrity: sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==} dependencies: @@ -3616,9 +3648,15 @@ packages: acorn: 8.8.0 dev: true + /acorn-walk/8.2.0: + resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + engines: {node: '>=0.4.0'} + dev: true + /acorn/8.8.0: resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==} engines: {node: '>=0.4.0'} + hasBin: true dev: true /aggregate-error/3.1.0: @@ -3693,6 +3731,10 @@ packages: engines: {node: '>=12'} dev: true + /arg/4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + /argparse/1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -4189,6 +4231,10 @@ packages: yaml: 1.10.2 dev: false + /create-require/1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + /cross-spawn/5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -4368,6 +4414,11 @@ packages: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} dev: false + /diff/4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + /dir-glob/3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -6294,6 +6345,10 @@ packages: semver: 6.3.0 dev: true + /make-error/1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + /map-obj/1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} @@ -7906,6 +7961,36 @@ packages: engines: {node: '>=8'} dev: true + /ts-node/10.9.1_typescript@4.9.3: + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + acorn: 8.8.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.9.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + /tsconfig-paths/3.14.1: resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} dependencies: @@ -8151,6 +8236,10 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: false + /v8-compile-cache-lib/3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + /v8-compile-cache/2.3.0: resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} dev: true @@ -8601,6 +8690,11 @@ packages: lib0: 0.2.52 dev: false + /yn/3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true + /yocto-queue/0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} From bad5dda67e416492fcf1531060f97585a49271c3 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 15:28:34 +0800 Subject: [PATCH 05/34] fix: module not find --- packages/i18n/src/scripts/api.ts | 2 +- packages/i18n/src/scripts/download.ts | 8 ++++---- packages/i18n/src/scripts/sync.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/i18n/src/scripts/api.ts b/packages/i18n/src/scripts/api.ts index ae286fe584..657e3c245c 100644 --- a/packages/i18n/src/scripts/api.ts +++ b/packages/i18n/src/scripts/api.ts @@ -1,5 +1,5 @@ // cSpell:ignore Tolgee -import { fetchTolgee } from './request'; +import { fetchTolgee } from './request.js'; /** * Returns all project languages diff --git a/packages/i18n/src/scripts/download.ts b/packages/i18n/src/scripts/download.ts index a43e84bf22..7aa0740c6e 100644 --- a/packages/i18n/src/scripts/download.ts +++ b/packages/i18n/src/scripts/download.ts @@ -2,8 +2,8 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import { format } from 'prettier'; -import { getAllProjectLanguages, getRemoteTranslations } from './api'; -import type { TranslationRes } from './utils'; +import { getAllProjectLanguages, getRemoteTranslations } from './api.js'; +import type { TranslationRes } from './utils.js'; const RES_DIR = path.resolve(process.cwd(), 'src', 'resources'); @@ -66,7 +66,7 @@ const main = async () => { ); const availableLanguages = languagesWithTranslations.filter( - language => language.completeRate > 0 + language => language.completeRate === 1 ); availableLanguages @@ -90,7 +90,7 @@ const main = async () => { console.log('Generating meta data...'); const code = `// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Run \`pnpm run download-resources\` to regenerate. - // To overwrite this, please overwrite ${path.basename(__filename)} + // To overwrite this, please overwrite download.ts script. ${availableLanguages .map( language => diff --git a/packages/i18n/src/scripts/sync.ts b/packages/i18n/src/scripts/sync.ts index 80b16a5024..b89734e4c4 100644 --- a/packages/i18n/src/scripts/sync.ts +++ b/packages/i18n/src/scripts/sync.ts @@ -1,8 +1,8 @@ // cSpell:ignore Tolgee import { readFile } from 'fs/promises'; import path from 'path'; -import { createsNewKey, getRemoteTranslations } from './api'; -import type { TranslationRes } from './utils'; +import { createsNewKey, getRemoteTranslations } from './api.js'; +import type { TranslationRes } from './utils.js'; const BASE_JSON_PATH = path.resolve( process.cwd(), From 41174c74d762c1d9ed4c1fed3ce89b57a6193659 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 15:29:32 +0800 Subject: [PATCH 06/34] chore: sync resources --- packages/i18n/src/resources/bn.json | 1 - packages/i18n/src/resources/en.json | 30 ++++++------ packages/i18n/src/resources/fr.json | 1 - packages/i18n/src/resources/index.ts | 59 +----------------------- packages/i18n/src/resources/sr.json | 1 - packages/i18n/src/resources/zh-Hans.json | 1 - packages/i18n/src/resources/zh-Hant.json | 1 - 7 files changed, 18 insertions(+), 76 deletions(-) delete mode 100644 packages/i18n/src/resources/bn.json delete mode 100644 packages/i18n/src/resources/fr.json delete mode 100644 packages/i18n/src/resources/sr.json delete mode 100644 packages/i18n/src/resources/zh-Hans.json delete mode 100644 packages/i18n/src/resources/zh-Hant.json diff --git a/packages/i18n/src/resources/bn.json b/packages/i18n/src/resources/bn.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/packages/i18n/src/resources/bn.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index 761f649c18..a331fb89dd 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -1,11 +1,8 @@ { "Quick search": "Quick search", - "Quick search placeholder": "Quick Search...", - "Quick search placeholder2": "Search in {{workspace}}", "All pages": "All pages", "Favourites": "Favourites", "No item": "No item", - "Settings": "Settings", "Import": "Import", "Trash": "Trash", "New Page": "New Page", @@ -14,8 +11,6 @@ "Find results": "Find {{number}} results", "Collapse sidebar": "Collapse sidebar", "Expand sidebar": "Expand sidebar", - "Removed from Favourites": "Removed from Favourites", - "Remove from favourites": "Remove from favourites", "Added to Favourites": "Added to Favourites", "Add to favourites": "Add to favourites", "Paper": "Paper", @@ -37,7 +32,6 @@ "Delete page?": "Delete page?", "Delete permanently?": "Delete permanently?", "will be moved to Trash": "{{title}} will be moved to Trash", - "Once deleted, you can't undo this action.": "Once deleted, you can't undo this action.", "Moved to Trash": "Moved to Trash", "Permanently deleted": "Permanently deleted", "restored": "{{title}} restored", @@ -57,7 +51,6 @@ "Strikethrough": "Strikethrough", "Inline code": "Inline code", "Code block": "Code block", - "Link": "Hyperlink (with selected text)", "Body text": "Body text", "Heading": "Heading {{number}}", "Increase indent": "Increase indent", @@ -65,6 +58,11 @@ "Markdown Syntax": "Markdown Syntax", "Divider": "Divider", "404 - Page Not Found": "404 - Page Not Found", + "Once deleted, you can't undo this action": { + "": "Once deleted, you can't undo this action." + }, + "Remove from favourites": "Remove from favourites", + "Removed from Favourites": "Removed from Favourites", "New Workspace": "New Workspace", "Workspace description": "Workspace is your virtual space to capture, create and plan as just one person or together as a team.", "Create": "Create", @@ -79,6 +77,10 @@ "TrashButtonGroupTitle": "Permanently delete", "TrashButtonGroupDescription": "Once deleted, you can't undo this action. Do you confirm?", "Delete permanently": "Delete permanently", + "Link": "Hyperlink (with selected text)", + "Quick search placeholder": "Quick Search...", + "Quick search placeholder2": "Search in {{workspace}}", + "Settings": "Settings", "recommendBrowser": " We recommend the <1>Chrome browser for optimal experience.", "upgradeBrowser": "Please upgrade to the latest version of Chrome for the best experience.", "Invite Members": "Invite Members", @@ -104,19 +106,15 @@ "Create Or Import": "Create Or Import", "Tips": "Tips: ", "login success": "Login success", - "Sign in": "Sign in AFFiNE Cloud", "Sign out": "Sign out of AFFiNE Cloud", "Delete Workspace": "Delete Workspace", - "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. along with all its content.", "Delete Workspace Description2": "Deleting (<1>{{workspace}}) will delete both local and cloud data, this operation cannot be undone, please proceed with caution.", "Delete Workspace placeholder": "Please type “Delete” to confirm", "Leave Workspace": "Leave Workspace", - "Leave Workspace Description": "After you leave, you will not be able to access all the contents of this workspace.", "Leave": "Leave", "Workspace Icon": "Workspace Icon", "Workspace Name": "Workspace Name", "Workspace Type": "Workspace Type", - "Export Workspace": "Export Workspace <1>{{workspace}} Is Coming", "Users": "Users", "Access level": "Access level", "Pending": "Pending", @@ -132,12 +130,16 @@ "Publishing Description": "After publishing to the web, everyone can view the content of this workspace through the link.", "Stop publishing": "Stop publishing", "Publish to web": "Publish to web", - "Sync Description": "{{workspaceName}} is Local Workspace. All data is stored on the current device. You can enable AFFiNE Cloud for this workspace to keep data in sync with the cloud.", - "Sync Description2": "<1>{{workspaceName}} is Cloud Workspace. All data will be synchronized and saved to the AFFiNE", "Download data to device": "Download {{CoreOrAll}} data to device", "General": "General", "Sync": "Sync", "Collaboration": "Collaboration", "Publish": "Publish", - "Workspace Settings": "Workspace Settings" + "Workspace Settings": "Workspace Settings", + "Export Workspace": "Export Workspace <1>{{workspace}} is coming soon", + "Leave Workspace Description": "After you leave, you will no longer be able to access the contents of this workspace.", + "Sign in": "Sign in to AFFiNE Cloud", + "Sync Description": "{{workspaceName}} is a Local Workspace. All data is stored on the current device. You can enable AFFiNE Cloud for this workspace to keep data in sync with the cloud.", + "Sync Description2": "<1>{{workspaceName}} is a Cloud Workspace. All data will be synchronised and saved to AFFiNE Cloud.", + "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost." } diff --git a/packages/i18n/src/resources/fr.json b/packages/i18n/src/resources/fr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/packages/i18n/src/resources/fr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/i18n/src/resources/index.ts b/packages/i18n/src/resources/index.ts index 329fa9c679..2081ad8aaf 100644 --- a/packages/i18n/src/resources/index.ts +++ b/packages/i18n/src/resources/index.ts @@ -1,16 +1,11 @@ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Run `pnpm run download-resources` to regenerate. -// To overwrite this, please overwrite download.ts +// To overwrite this, please overwrite download.ts script. import en from './en.json'; -import zh_Hans from './zh-Hans.json'; -import zh_Hant from './zh-Hant.json'; -import sr from './sr.json'; -import fr from './fr.json'; -import bn from './bn.json'; export const LOCALES = [ { - id: 1000016008, + id: 1000040001, name: 'English', tag: 'en', originalName: 'English', @@ -19,54 +14,4 @@ export const LOCALES = [ completeRate: 1, res: en, }, - { - id: 1000016009, - name: 'Simplified Chinese', - tag: 'zh-Hans', - originalName: '简体中文', - flagEmoji: '🇨🇳', - base: false, - completeRate: 1, - res: zh_Hans, - }, - { - id: 1000016012, - name: 'Traditional Chinese', - tag: 'zh-Hant', - originalName: '繁體中文', - flagEmoji: '🇭🇰', - base: false, - completeRate: 1, - res: zh_Hant, - }, - { - id: 1000034005, - name: 'Serbian', - tag: 'sr', - originalName: 'српски', - flagEmoji: '🇷🇸', - base: false, - completeRate: 0.9166666666666666, - res: sr, - }, - { - id: 1000034008, - name: 'French', - tag: 'fr', - originalName: 'français', - flagEmoji: '🇫🇷', - base: false, - completeRate: 1, - res: fr, - }, - { - id: 1000034010, - name: 'Bangla', - tag: 'bn', - originalName: 'বাংলা', - flagEmoji: '🇧🇩', - base: false, - completeRate: 0.7083333333333334, - res: bn, - }, ] as const; diff --git a/packages/i18n/src/resources/sr.json b/packages/i18n/src/resources/sr.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/packages/i18n/src/resources/sr.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/i18n/src/resources/zh-Hans.json b/packages/i18n/src/resources/zh-Hans.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/packages/i18n/src/resources/zh-Hans.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/i18n/src/resources/zh-Hant.json b/packages/i18n/src/resources/zh-Hant.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/packages/i18n/src/resources/zh-Hant.json +++ /dev/null @@ -1 +0,0 @@ -{} From ad73c414837a07d8337a2627c04cc7a20c017a5c Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 15:46:43 +0800 Subject: [PATCH 07/34] feat: add workflow to auto update i18n json --- .github/workflows/languages-download.yml.bak | 89 ++++++++++++++++++++ .github/workflows/languages-sync.yml.bak | 63 ++++++++++++++ packages/i18n/src/resources/en.json | 3 +- 3 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/languages-download.yml.bak create mode 100644 .github/workflows/languages-sync.yml.bak diff --git a/.github/workflows/languages-download.yml.bak b/.github/workflows/languages-download.yml.bak new file mode 100644 index 0000000000..570d3bd8ed --- /dev/null +++ b/.github/workflows/languages-download.yml.bak @@ -0,0 +1,89 @@ +name: Download Languages Resources + +on: + # schedule: + # - cron: "0 0 * * 5" # At 00:00(UTC) on Friday. + workflow_dispatch: + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +# This action need write permission to create pull requests +# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions +permissions: + contents: write + pull-requests: write + +jobs: + main: + strategy: + matrix: + node-version: [18] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Use Node.js ${{ matrix.node-version }} + # https://github.com/actions/setup-node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install node modules + run: pnpm install + + - name: Sync Languages + working-directory: ./packages/i18n + run: pnpm run download-resources + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} + + - name: Push Branch + id: push + run: | + git add packages/i18n + # Do not proceed if there are no file differences + COMMIT=$(git rev-parse --verify origin/$TARGET_BRANCH || echo HEAD) + FILES_CHANGED=$(git diff-index --name-only --cached $COMMIT | wc -l) + if [[ "$FILES_CHANGED" = "0" ]]; then + echo "No file changes detected." + echo "::set-output name=skipPR::true" + exit 0 + fi + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git commit --message 'feat(i18n): new translations' --no-verify + git remote set-url origin "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" + git push --force origin HEAD:$TARGET_BRANCH + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TARGET_BRANCH: bot/new-translations + + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + # see https://github.com/repo-sync/pull-request + - name: Create Pull Request + if: steps.push.outputs.skipPR != 'true' + uses: repo-sync/pull-request@v2 + with: + source_branch: 'bot/new-translations' # If blank, default: triggered branch + destination_branch: "master" + pr_title: Update i18n (${{ steps.date.outputs.date }}) # Title of pull request + pr_label: 'data,bot' # Comma-separated list (no spaces) + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/languages-sync.yml.bak b/.github/workflows/languages-sync.yml.bak new file mode 100644 index 0000000000..2a62fdd8ff --- /dev/null +++ b/.github/workflows/languages-sync.yml.bak @@ -0,0 +1,63 @@ +name: Languages Sync + +on: + # push: + # branches: [ "feat/sync-languages" ] + # paths: + # - 'packages/i18n/**' + # - '.github/workflows/languages-sync.yml' + # pull_request: + # branches: [ "feat/sync-languages" ] + # paths: + # - 'packages/i18n/**' + # - '.github/workflows/languages-sync.yml' + workflow_dispatch: + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + main: + strategy: + matrix: + node-version: [18] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Use Node.js ${{ matrix.node-version }} + # https://github.com/actions/setup-node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install node modules + run: pnpm install + + - name: Check Language Key + if: github.ref != 'feat/sync-languages' + working-directory: ./packages/i18n + run: pnpm run sync-languages:check + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} + + - name: Sync Languages + if: github.ref == 'feat/sync-languages' + working-directory: ./packages/i18n + run: pnpm run sync-languages + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} \ No newline at end of file diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index a331fb89dd..61fb5c2ba4 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -141,5 +141,6 @@ "Sign in": "Sign in to AFFiNE Cloud", "Sync Description": "{{workspaceName}} is a Local Workspace. All data is stored on the current device. You can enable AFFiNE Cloud for this workspace to keep data in sync with the cloud.", "Sync Description2": "<1>{{workspaceName}} is a Cloud Workspace. All data will be synchronised and saved to AFFiNE Cloud.", - "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost." + "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost.", + "test auto update": "test" } From abc749458635b25b0c570a1a20cf025330ad2d21 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 15:55:50 +0800 Subject: [PATCH 08/34] chore: test workflow --- .github/workflows/languages-download.yml | 89 ++++++++++++++++++++ .github/workflows/languages-download.yml.bak | 89 -------------------- .github/workflows/languages-sync.yml | 63 ++++++++++++++ .github/workflows/languages-sync.yml.bak | 63 -------------- 4 files changed, 152 insertions(+), 152 deletions(-) create mode 100644 .github/workflows/languages-download.yml delete mode 100644 .github/workflows/languages-download.yml.bak create mode 100644 .github/workflows/languages-sync.yml delete mode 100644 .github/workflows/languages-sync.yml.bak diff --git a/.github/workflows/languages-download.yml b/.github/workflows/languages-download.yml new file mode 100644 index 0000000000..a3f8469038 --- /dev/null +++ b/.github/workflows/languages-download.yml @@ -0,0 +1,89 @@ +name: Download Languages Resources + +on: + # schedule: + # - cron: "0 0 * * 5" # At 00:00(UTC) on Friday. + workflow_dispatch: + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +# This action need write permission to create pull requests +# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions +permissions: + contents: write + pull-requests: write + +jobs: + main: + strategy: + matrix: + node-version: [18] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Use Node.js ${{ matrix.node-version }} + # https://github.com/actions/setup-node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install node modules + run: pnpm install + + - name: Sync Languages + working-directory: ./packages/i18n + run: pnpm run download-resources + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} + + - name: Push Branch + id: push + run: | + git add packages/i18n + # Do not proceed if there are no file differences + COMMIT=$(git rev-parse --verify origin/$TARGET_BRANCH || echo HEAD) + FILES_CHANGED=$(git diff-index --name-only --cached $COMMIT | wc -l) + if [[ "$FILES_CHANGED" = "0" ]]; then + echo "No file changes detected." + echo "::set-output name=skipPR::true" + exit 0 + fi + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git commit --message 'feat(i18n): new translations' --no-verify + git remote set-url origin "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" + git push --force origin HEAD:$TARGET_BRANCH + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TARGET_BRANCH: bot/new-translations + + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + # see https://github.com/repo-sync/pull-request + - name: Create Pull Request + if: steps.push.outputs.skipPR != 'true' + uses: repo-sync/pull-request@v2 + with: + source_branch: 'bot/new-translations' # If blank, default: triggered branch + destination_branch: 'master' + pr_title: Update i18n (${{ steps.date.outputs.date }}) # Title of pull request + pr_label: 'data,bot' # Comma-separated list (no spaces) + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/languages-download.yml.bak b/.github/workflows/languages-download.yml.bak deleted file mode 100644 index 570d3bd8ed..0000000000 --- a/.github/workflows/languages-download.yml.bak +++ /dev/null @@ -1,89 +0,0 @@ -name: Download Languages Resources - -on: - # schedule: - # - cron: "0 0 * * 5" # At 00:00(UTC) on Friday. - workflow_dispatch: - -# Cancels all previous workflow runs for pull requests that have not completed. -# See https://docs.github.com/en/actions/using-jobs/using-concurrency -concurrency: - # The concurrency group contains the workflow name and the branch name for - # pull requests or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -# This action need write permission to create pull requests -# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions -permissions: - contents: write - pull-requests: write - -jobs: - main: - strategy: - matrix: - node-version: [18] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Use pnpm - uses: pnpm/action-setup@v2 - with: - version: 7 - - - name: Use Node.js ${{ matrix.node-version }} - # https://github.com/actions/setup-node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - - name: Install node modules - run: pnpm install - - - name: Sync Languages - working-directory: ./packages/i18n - run: pnpm run download-resources - env: - TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} - - - name: Push Branch - id: push - run: | - git add packages/i18n - # Do not proceed if there are no file differences - COMMIT=$(git rev-parse --verify origin/$TARGET_BRANCH || echo HEAD) - FILES_CHANGED=$(git diff-index --name-only --cached $COMMIT | wc -l) - if [[ "$FILES_CHANGED" = "0" ]]; then - echo "No file changes detected." - echo "::set-output name=skipPR::true" - exit 0 - fi - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git commit --message 'feat(i18n): new translations' --no-verify - git remote set-url origin "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" - git push --force origin HEAD:$TARGET_BRANCH - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TARGET_BRANCH: bot/new-translations - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - # see https://github.com/repo-sync/pull-request - - name: Create Pull Request - if: steps.push.outputs.skipPR != 'true' - uses: repo-sync/pull-request@v2 - with: - source_branch: 'bot/new-translations' # If blank, default: triggered branch - destination_branch: "master" - pr_title: Update i18n (${{ steps.date.outputs.date }}) # Title of pull request - pr_label: 'data,bot' # Comma-separated list (no spaces) - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/languages-sync.yml b/.github/workflows/languages-sync.yml new file mode 100644 index 0000000000..50fe3dbec1 --- /dev/null +++ b/.github/workflows/languages-sync.yml @@ -0,0 +1,63 @@ +name: Languages Sync + +on: + # push: + # branches: [ "feat/sync-languages" ] + # paths: + # - 'packages/i18n/**' + # - '.github/workflows/languages-sync.yml' + # pull_request: + # branches: [ "feat/sync-languages" ] + # paths: + # - 'packages/i18n/**' + # - '.github/workflows/languages-sync.yml' + workflow_dispatch: + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + main: + strategy: + matrix: + node-version: [18] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Use Node.js ${{ matrix.node-version }} + # https://github.com/actions/setup-node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install node modules + run: pnpm install + + - name: Check Language Key + if: github.ref != 'feat/sync-languages' + working-directory: ./packages/i18n + run: pnpm run sync-languages:check + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} + + - name: Sync Languages + if: github.ref == 'feat/sync-languages' + working-directory: ./packages/i18n + run: pnpm run sync-languages + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} diff --git a/.github/workflows/languages-sync.yml.bak b/.github/workflows/languages-sync.yml.bak deleted file mode 100644 index 2a62fdd8ff..0000000000 --- a/.github/workflows/languages-sync.yml.bak +++ /dev/null @@ -1,63 +0,0 @@ -name: Languages Sync - -on: - # push: - # branches: [ "feat/sync-languages" ] - # paths: - # - 'packages/i18n/**' - # - '.github/workflows/languages-sync.yml' - # pull_request: - # branches: [ "feat/sync-languages" ] - # paths: - # - 'packages/i18n/**' - # - '.github/workflows/languages-sync.yml' - workflow_dispatch: - -# Cancels all previous workflow runs for pull requests that have not completed. -# See https://docs.github.com/en/actions/using-jobs/using-concurrency -concurrency: - # The concurrency group contains the workflow name and the branch name for - # pull requests or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - main: - strategy: - matrix: - node-version: [18] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Use pnpm - uses: pnpm/action-setup@v2 - with: - version: 7 - - - name: Use Node.js ${{ matrix.node-version }} - # https://github.com/actions/setup-node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - - name: Install node modules - run: pnpm install - - - name: Check Language Key - if: github.ref != 'feat/sync-languages' - working-directory: ./packages/i18n - run: pnpm run sync-languages:check - env: - TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} - - - name: Sync Languages - if: github.ref == 'feat/sync-languages' - working-directory: ./packages/i18n - run: pnpm run sync-languages - env: - TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} \ No newline at end of file From 93ef92e15bc3d113e0ed14b7b87a7164832531c7 Mon Sep 17 00:00:00 2001 From: x1a0t <405028157@qq.com> Date: Wed, 11 Jan 2023 16:01:27 +0800 Subject: [PATCH 09/34] chore: adding code block background color, line number color, fixing landing page case sensitivity --- packages/app/src/styles/theme.ts | 6 ++++++ packages/app/src/styles/types.ts | 5 +++++ packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/app/src/styles/theme.ts b/packages/app/src/styles/theme.ts index 1412e00285..f317397fae 100644 --- a/packages/app/src/styles/theme.ts +++ b/packages/app/src/styles/theme.ts @@ -20,6 +20,7 @@ export const getLightTheme = ( popoverBackground: '#fff', tooltipBackground: '#6880FF', codeBackground: '#f2f5f9', + codeBlockBackground: '#fafbfd', warningBackground: '#FFF9C7', errorBackground: '#FFDED8', @@ -40,6 +41,7 @@ export const getLightTheme = ( disableColor: '#C0C0C0', warningColor: '#906616', errorColor: '#EB4335', + lineNumberColor: '#888A9E', }, font: { xs: '12px', @@ -96,6 +98,7 @@ export const getDarkTheme = ( editorMode === 'edgeless' ? lightTheme.colors.codeBackground : '#505662', + codeBlockBackground: '#36383D', warningBackground: '#FFF9C7', errorBackground: '#FFDED8', @@ -117,6 +120,7 @@ export const getDarkTheme = ( disableColor: '#4b4b4b', warningColor: '#906616', errorColor: '#EB4335', + lineNumberColor: '#888A9E', }, shadow: { popover: @@ -154,12 +158,14 @@ export const globalThemeVariables: ( '--affine-popover-color': theme.colors.popoverColor, '--affine-input-color': theme.colors.inputColor, '--affine-code-color': theme.colors.codeColor, + '--affine-code-block-background': theme.colors.codeBlockBackground, '--affine-quote-color': theme.colors.quoteColor, '--affine-selected-color': theme.colors.selectedColor, '--affine-placeholder-color': theme.colors.placeHolderColor, '--affine-border-color': theme.colors.borderColor, '--affine-disable-color': theme.colors.disableColor, '--affine-tooltip-color': theme.colors.tooltipColor, + '--affine-line-number-color': theme.colors.lineNumberColor, '--affine-modal-shadow': theme.shadow.modal, '--affine-popover-shadow': theme.shadow.popover, diff --git a/packages/app/src/styles/types.ts b/packages/app/src/styles/types.ts index 85b12df586..81816ad611 100644 --- a/packages/app/src/styles/types.ts +++ b/packages/app/src/styles/types.ts @@ -25,6 +25,7 @@ export interface AffineTheme { hoverBackground: string; innerHoverBackground: string; codeBackground: string; + codeBlockBackground: string; warningBackground: string; errorBackground: string; // Use for the page`s text @@ -47,6 +48,7 @@ export interface AffineTheme { disableColor: string; warningColor: string; errorColor: string; + lineNumberColor: string; }; font: { xs: string; // tiny @@ -90,6 +92,8 @@ export interface AffineThemeCSSVariables { '--affine-popover-background': AffineTheme['colors']['popoverBackground']; '--affine-hover-background': AffineTheme['colors']['hoverBackground']; '--affine-code-background': AffineTheme['colors']['codeBackground']; + + '--affine-code-block-background': AffineTheme['colors']['codeBlockBackground']; '--affine-tooltip-background': AffineTheme['colors']['tooltipBackground']; '--affine-text-color': AffineTheme['colors']['textColor']; @@ -107,6 +111,7 @@ export interface AffineThemeCSSVariables { '--affine-border-color': AffineTheme['colors']['borderColor']; '--affine-disable-color': AffineTheme['colors']['disableColor']; '--affine-tooltip-color': AffineTheme['colors']['tooltipColor']; + '--affine-line-number-color': AffineTheme['colors']['lineNumberColor']; '--affine-modal-shadow': AffineTheme['shadow']['modal']; '--affine-popover-shadow': AffineTheme['shadow']['popover']; diff --git a/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md b/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md index 130b2918b8..91e2fe48c0 100644 --- a/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md +++ b/packages/app/src/templates/Welcome-to-AFFiNE-Alpha-v2.0.md @@ -39,7 +39,7 @@ docker run -it --name affine -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/to [] What about a code block? ````` -```javascript +```JavaScript console.log('Hello world'); ``` From e3469b435f83c5b36d6b3fe5f0036b16e142af47 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 16:19:46 +0800 Subject: [PATCH 10/34] chore: update workflow --- .github/workflows/languages-sync.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/languages-sync.yml b/.github/workflows/languages-sync.yml index 50fe3dbec1..3cacc35749 100644 --- a/.github/workflows/languages-sync.yml +++ b/.github/workflows/languages-sync.yml @@ -1,16 +1,16 @@ name: Languages Sync on: - # push: - # branches: [ "feat/sync-languages" ] - # paths: - # - 'packages/i18n/**' - # - '.github/workflows/languages-sync.yml' - # pull_request: - # branches: [ "feat/sync-languages" ] - # paths: - # - 'packages/i18n/**' - # - '.github/workflows/languages-sync.yml' + push: + branches: ['master'] + paths: + - 'packages/i18n/**' + - '.github/workflows/languages-sync.yml' + pull_request: + branches: ['master'] + paths: + - 'packages/i18n/**' + - '.github/workflows/languages-sync.yml' workflow_dispatch: # Cancels all previous workflow runs for pull requests that have not completed. @@ -49,14 +49,14 @@ jobs: run: pnpm install - name: Check Language Key - if: github.ref != 'feat/sync-languages' + if: github.ref != 'refs/heads/master' working-directory: ./packages/i18n run: pnpm run sync-languages:check env: TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} - name: Sync Languages - if: github.ref == 'feat/sync-languages' + if: github.ref == 'refs/heads/master' working-directory: ./packages/i18n run: pnpm run sync-languages env: From 4e25fa3054b39add45c849efb3b7ac69ca6efcd4 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Wed, 11 Jan 2023 16:40:46 +0800 Subject: [PATCH 11/34] chore: disable outdated feature --- packages/app/src/components/header/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/components/header/Header.tsx b/packages/app/src/components/header/Header.tsx index 9db8149d5e..51c462907d 100644 --- a/packages/app/src/components/header/Header.tsx +++ b/packages/app/src/components/header/Header.tsx @@ -40,7 +40,7 @@ const HeaderRightItems: Record = { editorOptionMenu: , trashButtonGroup: , themeModeSwitch: , - syncUser: , + syncUser: null, //, }; export const Header = ({ From 9c2afb2a7b9f0d00544e3fc30f294e6fb0962fd5 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 16:51:45 +0800 Subject: [PATCH 12/34] feat: add auto download --- .github/workflows/languages-download.yml | 4 ++-- packages/i18n/src/resources/en.json | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/languages-download.yml b/.github/workflows/languages-download.yml index a3f8469038..c7292bd917 100644 --- a/.github/workflows/languages-download.yml +++ b/.github/workflows/languages-download.yml @@ -1,8 +1,8 @@ name: Download Languages Resources on: - # schedule: - # - cron: "0 0 * * 5" # At 00:00(UTC) on Friday. + schedule: + - cron: '0 0 * * 5' # At 00:00(UTC) on Friday. workflow_dispatch: # Cancels all previous workflow runs for pull requests that have not completed. diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index 61fb5c2ba4..a331fb89dd 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -141,6 +141,5 @@ "Sign in": "Sign in to AFFiNE Cloud", "Sync Description": "{{workspaceName}} is a Local Workspace. All data is stored on the current device. You can enable AFFiNE Cloud for this workspace to keep data in sync with the cloud.", "Sync Description2": "<1>{{workspaceName}} is a Cloud Workspace. All data will be synchronised and saved to AFFiNE Cloud.", - "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost.", - "test auto update": "test" + "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost." } From 0be59eef607762bccb1692d182fab7d5298bdf6c Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 17:25:16 +0800 Subject: [PATCH 13/34] test: skip searchArrowButton test case --- tests/quick-search.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/quick-search.spec.ts b/tests/quick-search.spec.ts index 9d4dbf2add..b1049acce9 100644 --- a/tests/quick-search.spec.ts +++ b/tests/quick-search.spec.ts @@ -32,7 +32,7 @@ test.describe('Open quick search', () => { await expect(quickSearch).toBeVisible(); }); - test('Click arrowDown icon after title', async ({ page }) => { + test.skip('Click arrowDown icon after title', async ({ page }) => { await newPage(page); const quickSearchButton = page.locator( '[data-testid=header-quickSearchButton]' From 18ecf52f622300e055c52a413edbe05885dfb24d Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 17:26:06 +0800 Subject: [PATCH 14/34] chore: remove searchArrowButton --- packages/app/src/components/header/EditorHeader.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/app/src/components/header/EditorHeader.tsx b/packages/app/src/components/header/EditorHeader.tsx index b343179496..491174f578 100644 --- a/packages/app/src/components/header/EditorHeader.tsx +++ b/packages/app/src/components/header/EditorHeader.tsx @@ -1,14 +1,8 @@ import React, { useEffect, useState } from 'react'; -import { - StyledSearchArrowWrapper, - StyledSwitchWrapper, - StyledTitle, - StyledTitleWrapper, -} from './styles'; +import { StyledSwitchWrapper, StyledTitle, StyledTitleWrapper } from './styles'; import { Content } from '@/ui/layout'; import { useAppState } from '@/providers/app-state-provider/context'; import EditorModeSwitch from '@/components/editor-mode-switch'; -import QuickSearchButton from './QuickSearchButton'; import Header from './Header'; import usePropsUpdated from '@/hooks/use-props-updated'; import useCurrentPageMeta from '@/hooks/use-current-page-meta'; @@ -64,9 +58,9 @@ export const EditorHeader = () => { /> {title} - + {/* - + */} )} From 2c32d4614f3d6be4b2e776ee1c157f98e3e49083 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 17:26:39 +0800 Subject: [PATCH 15/34] chore: update words --- packages/app/src/components/header/QuickSearchButton.tsx | 2 +- packages/app/src/components/quick-search/Results.tsx | 2 +- packages/i18n/src/resources/en.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/header/QuickSearchButton.tsx b/packages/app/src/components/header/QuickSearchButton.tsx index 0b28e43b09..f5d2023500 100644 --- a/packages/app/src/components/header/QuickSearchButton.tsx +++ b/packages/app/src/components/header/QuickSearchButton.tsx @@ -11,7 +11,7 @@ export const QuickSearchButton = ({ const { triggerQuickSearchModal } = useModal(); const { t } = useTranslation(); return ( - + ) ) : ( - + {List.map(link => { return ( Date: Wed, 11 Jan 2023 17:39:14 +0800 Subject: [PATCH 16/34] chore: remove unused import --- packages/app/src/components/header/Header.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/app/src/components/header/Header.tsx b/packages/app/src/components/header/Header.tsx index 51c462907d..4b7a6fcf73 100644 --- a/packages/app/src/components/header/Header.tsx +++ b/packages/app/src/components/header/Header.tsx @@ -11,7 +11,6 @@ import { getWarningMessage, shouldShowWarning } from './utils'; import EditorOptionMenu from './header-right-items/EditorOptionMenu'; import TrashButtonGroup from './header-right-items/TrashButtonGroup'; import ThemeModeSwitch from './header-right-items/theme-mode-switch'; -import SyncUser from './header-right-items/SyncUser'; const BrowserWarning = ({ show, From a7e6d16930e2348610299cf667901d2db10b4d53 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 17:43:14 +0800 Subject: [PATCH 17/34] chore: add date --- packages/app/src/components/contact-modal/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app/src/components/contact-modal/index.tsx b/packages/app/src/components/contact-modal/index.tsx index 3cd4d04f85..6ec64fc144 100644 --- a/packages/app/src/components/contact-modal/index.tsx +++ b/packages/app/src/components/contact-modal/index.tsx @@ -76,6 +76,8 @@ export const ContactModal = ({ link: 'https://community.affine.pro', }, ]; + const date = new Date(); + const year = date.getFullYear(); return (

-

Copyright © 2022 Toeverything

+

Copyright © {year} Toeverything

From fe189e383bf50f9d8d4fcf3737684d13d8b27de1 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 17:44:21 +0800 Subject: [PATCH 18/34] chore: remove unused import --- packages/app/src/components/header/Header.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/app/src/components/header/Header.tsx b/packages/app/src/components/header/Header.tsx index 51c462907d..4b7a6fcf73 100644 --- a/packages/app/src/components/header/Header.tsx +++ b/packages/app/src/components/header/Header.tsx @@ -11,7 +11,6 @@ import { getWarningMessage, shouldShowWarning } from './utils'; import EditorOptionMenu from './header-right-items/EditorOptionMenu'; import TrashButtonGroup from './header-right-items/TrashButtonGroup'; import ThemeModeSwitch from './header-right-items/theme-mode-switch'; -import SyncUser from './header-right-items/SyncUser'; const BrowserWarning = ({ show, From 3357c3d43b1d487bc6983f2fde78332c8406ade1 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 18:03:29 +0800 Subject: [PATCH 19/34] test: skip cloud sync --- tests/libs/page-logic.ts | 13 ++++++++----- tests/login.spec.ts | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/libs/page-logic.ts b/tests/libs/page-logic.ts index 09385a4cb0..4ee958d7e7 100644 --- a/tests/libs/page-logic.ts +++ b/tests/libs/page-logic.ts @@ -5,9 +5,12 @@ export async function newPage(page: Page) { } export async function clickPageMoreActions(page: Page) { - return page - .getByTestId('editor-header-items') - .getByRole('button') - .nth(2) - .click(); + return ( + page + .getByTestId('editor-header-items') + .getByRole('button') + //FIXME: temporary change due to cloud sync icon being hidden + .nth(1) + .click() + ); } diff --git a/tests/login.spec.ts b/tests/login.spec.ts index ed7185259f..f5feb9d9c5 100644 --- a/tests/login.spec.ts +++ b/tests/login.spec.ts @@ -15,7 +15,7 @@ test.describe('Login Flow', () => { .click(); }); - test('Open login modal by click cloud-unsync-icon', async ({ page }) => { + test.skip('Open login modal by click cloud-unsync-icon', async ({ page }) => { await page.getByTestId('cloud-unsync-icon').click(); await page.waitForTimeout(800); From 8cdfb2edba4cf132cd7517a1387ed433b143b22f Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 18:19:01 +0800 Subject: [PATCH 20/34] chore: update json --- packages/i18n/src/resources/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index a331fb89dd..2831a8aafe 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -15,7 +15,7 @@ "Add to favourites": "Add to favourites", "Paper": "Paper", "Edgeless": "Edgeless", - "Switch to": "Switch to", + "Jump to": "Jump to", "Convert to ": "Convert to ", "Page": "Page", "Export": "Export", From 5749b5f71197df7ddd030b527c141c1c4b7da8fe Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 18:26:58 +0800 Subject: [PATCH 21/34] test: skip cloud sync --- tests/libs/page-logic.ts | 13 ++++++++----- tests/login.spec.ts | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/libs/page-logic.ts b/tests/libs/page-logic.ts index 09385a4cb0..bb6c71d2ba 100644 --- a/tests/libs/page-logic.ts +++ b/tests/libs/page-logic.ts @@ -5,9 +5,12 @@ export async function newPage(page: Page) { } export async function clickPageMoreActions(page: Page) { - return page - .getByTestId('editor-header-items') - .getByRole('button') - .nth(2) - .click(); + return ( + page + .getByTestId('editor-header-items') + .getByRole('button') + //FIXME: temporary change due to cloud sync icon being hidden + .nth(0) + .click() + ); } diff --git a/tests/login.spec.ts b/tests/login.spec.ts index ed7185259f..f5feb9d9c5 100644 --- a/tests/login.spec.ts +++ b/tests/login.spec.ts @@ -15,7 +15,7 @@ test.describe('Login Flow', () => { .click(); }); - test('Open login modal by click cloud-unsync-icon', async ({ page }) => { + test.skip('Open login modal by click cloud-unsync-icon', async ({ page }) => { await page.getByTestId('cloud-unsync-icon').click(); await page.waitForTimeout(800); From af92417c817f18a3e0c18ac86c4c0f96dc504569 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 18:43:19 +0800 Subject: [PATCH 22/34] chore: delete workflow action --- .github/workflows/languages-download.yml | 89 ------------------------ .github/workflows/languages-sync.yml | 63 ----------------- 2 files changed, 152 deletions(-) delete mode 100644 .github/workflows/languages-download.yml delete mode 100644 .github/workflows/languages-sync.yml diff --git a/.github/workflows/languages-download.yml b/.github/workflows/languages-download.yml deleted file mode 100644 index c7292bd917..0000000000 --- a/.github/workflows/languages-download.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Download Languages Resources - -on: - schedule: - - cron: '0 0 * * 5' # At 00:00(UTC) on Friday. - workflow_dispatch: - -# Cancels all previous workflow runs for pull requests that have not completed. -# See https://docs.github.com/en/actions/using-jobs/using-concurrency -concurrency: - # The concurrency group contains the workflow name and the branch name for - # pull requests or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -# This action need write permission to create pull requests -# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions -permissions: - contents: write - pull-requests: write - -jobs: - main: - strategy: - matrix: - node-version: [18] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Use pnpm - uses: pnpm/action-setup@v2 - with: - version: 7 - - - name: Use Node.js ${{ matrix.node-version }} - # https://github.com/actions/setup-node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - - name: Install node modules - run: pnpm install - - - name: Sync Languages - working-directory: ./packages/i18n - run: pnpm run download-resources - env: - TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} - - - name: Push Branch - id: push - run: | - git add packages/i18n - # Do not proceed if there are no file differences - COMMIT=$(git rev-parse --verify origin/$TARGET_BRANCH || echo HEAD) - FILES_CHANGED=$(git diff-index --name-only --cached $COMMIT | wc -l) - if [[ "$FILES_CHANGED" = "0" ]]; then - echo "No file changes detected." - echo "::set-output name=skipPR::true" - exit 0 - fi - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git commit --message 'feat(i18n): new translations' --no-verify - git remote set-url origin "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" - git push --force origin HEAD:$TARGET_BRANCH - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TARGET_BRANCH: bot/new-translations - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - # see https://github.com/repo-sync/pull-request - - name: Create Pull Request - if: steps.push.outputs.skipPR != 'true' - uses: repo-sync/pull-request@v2 - with: - source_branch: 'bot/new-translations' # If blank, default: triggered branch - destination_branch: 'master' - pr_title: Update i18n (${{ steps.date.outputs.date }}) # Title of pull request - pr_label: 'data,bot' # Comma-separated list (no spaces) - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/languages-sync.yml b/.github/workflows/languages-sync.yml deleted file mode 100644 index 3cacc35749..0000000000 --- a/.github/workflows/languages-sync.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Languages Sync - -on: - push: - branches: ['master'] - paths: - - 'packages/i18n/**' - - '.github/workflows/languages-sync.yml' - pull_request: - branches: ['master'] - paths: - - 'packages/i18n/**' - - '.github/workflows/languages-sync.yml' - workflow_dispatch: - -# Cancels all previous workflow runs for pull requests that have not completed. -# See https://docs.github.com/en/actions/using-jobs/using-concurrency -concurrency: - # The concurrency group contains the workflow name and the branch name for - # pull requests or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - main: - strategy: - matrix: - node-version: [18] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Use pnpm - uses: pnpm/action-setup@v2 - with: - version: 7 - - - name: Use Node.js ${{ matrix.node-version }} - # https://github.com/actions/setup-node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - - name: Install node modules - run: pnpm install - - - name: Check Language Key - if: github.ref != 'refs/heads/master' - working-directory: ./packages/i18n - run: pnpm run sync-languages:check - env: - TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} - - - name: Sync Languages - if: github.ref == 'refs/heads/master' - working-directory: ./packages/i18n - run: pnpm run sync-languages - env: - TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} From 7831a65cbeeb22b1086388f8714dcf709e20fe1c Mon Sep 17 00:00:00 2001 From: JimmFly Date: Wed, 11 Jan 2023 19:35:11 +0800 Subject: [PATCH 23/34] chore: update readme --- packages/i18n/README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/i18n/README.md b/packages/i18n/README.md index 7cd4fba1bf..f8ad64372a 100644 --- a/packages/i18n/README.md +++ b/packages/i18n/README.md @@ -36,13 +36,6 @@ const App = () => { }; ``` -## How the i18n workflow works? - -- When the `src/resources/en.json`(base language) updated and merged to the develop branch, will trigger the `languages-sync` action. -- The `languages-sync` action will check the base language and add missing translations to the Tolgee platform. -- This way, partners from the community can update the translations. -- Finally, the `languages-download` action will regularly download the latest translation resources from the Tolgee platform. - ## How to sync translations manually - Set token as environment variable From 1d3dd8aa7713e7a75bb1ce7851513cf1f97edb87 Mon Sep 17 00:00:00 2001 From: himself65 Date: Thu, 12 Jan 2023 00:53:53 +0800 Subject: [PATCH 24/34] feat: support flags in workspace --- packages/app/package.json | 6 +- packages/data-center/package.json | 4 +- packages/data-center/src/datacenter.ts | 7 ++- pnpm-lock.yaml | 78 +++++++++++++++++--------- 4 files changed, 61 insertions(+), 34 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 9bc91a9259..b68de96c0b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -11,10 +11,10 @@ "dependencies": { "@affine/datacenter": "workspace:*", "@affine/i18n": "workspace:*", - "@blocksuite/blocks": "0.4.0-20230110112105-ef07332", - "@blocksuite/editor": "0.4.0-20230110112105-ef07332", + "@blocksuite/blocks": "0.4.0-20230111164952-fea266a", + "@blocksuite/editor": "0.4.0-20230111164952-fea266a", "@blocksuite/icons": "^2.0.2", - "@blocksuite/store": "0.4.0-20230110112105-ef07332", + "@blocksuite/store": "0.4.0-20230111164952-fea266a", "@emotion/css": "^11.10.0", "@emotion/react": "^11.10.4", "@emotion/server": "^11.10.0", diff --git a/packages/data-center/package.json b/packages/data-center/package.json index 606f6e196c..597e9e46a7 100644 --- a/packages/data-center/package.json +++ b/packages/data-center/package.json @@ -26,8 +26,8 @@ "typescript": "^4.8.4" }, "dependencies": { - "@blocksuite/blocks": "0.4.0-20230110112105-ef07332", - "@blocksuite/store": "0.4.0-20230110112105-ef07332", + "@blocksuite/blocks": "0.4.0-20230111164952-fea266a", + "@blocksuite/store": "0.4.0-20230111164952-fea266a", "debug": "^4.3.4", "encoding": "^0.1.13", "firebase": "^9.15.0", diff --git a/packages/data-center/src/datacenter.ts b/packages/data-center/src/datacenter.ts index 59f72b6afc..079a766c73 100644 --- a/packages/data-center/src/datacenter.ts +++ b/packages/data-center/src/datacenter.ts @@ -102,7 +102,12 @@ export class DataCenter { const providerId = await this._getProvider(id, params.providerId); // init workspace & register block schema - const workspace = new Workspace({ room: id }).register(BlockSchema); + const workspace = new Workspace({ + room: id, + defaultFlags: { + enable_drag_handle: false, + }, + }).register(BlockSchema); const Provider = this._providers.get(providerId); assert(Provider); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a6a2417511..f1d36703e2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,10 +40,10 @@ importers: specifiers: '@affine/datacenter': workspace:* '@affine/i18n': workspace:* - '@blocksuite/blocks': 0.4.0-20230110112105-ef07332 - '@blocksuite/editor': 0.4.0-20230110112105-ef07332 + '@blocksuite/blocks': 0.4.0-20230111164952-fea266a + '@blocksuite/editor': 0.4.0-20230111164952-fea266a '@blocksuite/icons': ^2.0.2 - '@blocksuite/store': 0.4.0-20230110112105-ef07332 + '@blocksuite/store': 0.4.0-20230111164952-fea266a '@emotion/css': ^11.10.0 '@emotion/react': ^11.10.4 '@emotion/server': ^11.10.0 @@ -81,10 +81,10 @@ importers: dependencies: '@affine/datacenter': link:../data-center '@affine/i18n': link:../i18n - '@blocksuite/blocks': 0.4.0-20230110112105-ef07332_yjs@13.5.44 - '@blocksuite/editor': 0.4.0-20230110112105-ef07332_yjs@13.5.44 + '@blocksuite/blocks': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/editor': 0.4.0-20230111164952-fea266a_yjs@13.5.44 '@blocksuite/icons': 2.0.4_w5j4k42lgipnm43s3brx6h3c34 - '@blocksuite/store': 0.4.0-20230110112105-ef07332_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 '@emotion/css': 11.10.0 '@emotion/react': 11.10.4_w5j4k42lgipnm43s3brx6h3c34 '@emotion/server': 11.10.0_@emotion+css@11.10.0 @@ -123,8 +123,8 @@ importers: packages/data-center: specifiers: - '@blocksuite/blocks': 0.4.0-20230110112105-ef07332 - '@blocksuite/store': 0.4.0-20230110112105-ef07332 + '@blocksuite/blocks': 0.4.0-20230111164952-fea266a + '@blocksuite/store': 0.4.0-20230111164952-fea266a '@playwright/test': ^1.29.1 '@types/debug': ^4.1.7 debug: ^4.3.4 @@ -140,8 +140,8 @@ importers: y-protocols: ^1.0.5 yjs: ^13.5.44 dependencies: - '@blocksuite/blocks': 0.4.0-20230110112105-ef07332_yjs@13.5.44 - '@blocksuite/store': 0.4.0-20230110112105-ef07332_yjs@13.5.44 + '@blocksuite/blocks': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 debug: 4.3.4 encoding: 0.1.13 firebase: 9.15.0_encoding@0.1.13 @@ -1455,16 +1455,17 @@ packages: to-fast-properties: 2.0.0 dev: true - /@blocksuite/blocks/0.4.0-20230110112105-ef07332_yjs@13.5.44: - resolution: {integrity: sha512-dtwZRCWtirmheRQaITPOC/D9LZ3yFuYztqL/y2mz/BRSfHj8I71OVcX0HjFXx2TUdzhkea1GNYbp4226zZIiRA==} + /@blocksuite/blocks/0.4.0-20230111164952-fea266a_yjs@13.5.44: + resolution: {integrity: sha512-bphgTV5YkEfsqkvRJdbH8TevG6l9b9WHTliETJ4UksX4sxOsRDJk0v4XcluIDZXDv4TQ8fc45d5s5uaab48xQQ==} dependencies: - '@blocksuite/phasor': 0.4.0-20230110112105-ef07332_yjs@13.5.44 - '@blocksuite/store': 0.4.0-20230110112105-ef07332_yjs@13.5.44 + '@blocksuite/global': 0.4.0-20230111164952-fea266a + '@blocksuite/phasor': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 '@tldraw/intersect': 1.8.0 autosize: 5.0.2 highlight.js: 11.7.0 hotkeys-js: 3.10.1 - lit: 2.5.0 + lit: 2.6.0 perfect-freehand: 1.2.0 quill: 1.3.7 quill-cursors: 4.0.0 @@ -1475,12 +1476,12 @@ packages: - yjs dev: false - /@blocksuite/editor/0.4.0-20230110112105-ef07332_yjs@13.5.44: - resolution: {integrity: sha512-UqLVEZq/bKRJfe3e/Teur7grlnSo6oG55s00WSWu+nTIHnvgasIePJ6rpGC/pXwYdsuvVQnQzGesnrapNVtXqA==} + /@blocksuite/editor/0.4.0-20230111164952-fea266a_yjs@13.5.44: + resolution: {integrity: sha512-pVHH9nu9FwQErrPI6dHfMUCVtPEaNuB4PhHmyrcrVIgTGaGKdAQZ7PrsEqvjeWnIoX2l6s4u9XCFgdAsxybSfQ==} dependencies: - '@blocksuite/blocks': 0.4.0-20230110112105-ef07332_yjs@13.5.44 - '@blocksuite/store': 0.4.0-20230110112105-ef07332_yjs@13.5.44 - lit: 2.5.0 + '@blocksuite/blocks': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + lit: 2.6.0 marked: 4.2.5 turndown: 7.1.1 transitivePeerDependencies: @@ -1490,6 +1491,10 @@ packages: - yjs dev: false + /@blocksuite/global/0.4.0-20230111164952-fea266a: + resolution: {integrity: sha512-R2nXYIfyBaSMbLGF/aOUgRPFpWYs+bbK1/E9wChQGvC1D8UhQ6WRUt/khzM/GpdvnmIhmMyolJZ6LjEjGAo6Wg==} + dev: false + /@blocksuite/icons/2.0.4_w5j4k42lgipnm43s3brx6h3c34: resolution: {integrity: sha512-Ewx30d3W6MXJGPXYvv48UpvAVfDB+gIVu90sHZX5curnSn+e1DdpCVfL0DeZA7Iyq6aLbxnKVzOAewlfoP8kDQ==} peerDependencies: @@ -1500,19 +1505,20 @@ packages: react: 18.2.0 dev: false - /@blocksuite/phasor/0.4.0-20230110112105-ef07332_yjs@13.5.44: - resolution: {integrity: sha512-R5j/iK7WBFSk7vSk8HEAsxDwr+xDeY7JuzdGzzwnkcOaxuM6Eea6g0vMw7DPuWDAkvlcP7JsgXLnzWgFZh7qmA==} + /@blocksuite/phasor/0.4.0-20230111164952-fea266a_yjs@13.5.44: + resolution: {integrity: sha512-AHxLIHi2s3fcfzbx8URVer3LGlZnVKvW+ttpRKIm8a3vkZqaXwb9+8gL8Ajh6YkOvf9Nb1Y5471978284BwCfw==} peerDependencies: yjs: ^13 dependencies: yjs: 13.5.44 dev: false - /@blocksuite/store/0.4.0-20230110112105-ef07332_yjs@13.5.44: - resolution: {integrity: sha512-NisHLf0uSyFu5DUZD13QSsp33C9vnd7Jf7jdLOAPztQ2U05NcGFopjM2InhwBmtmQSHrd/qi25PjgnAJ7/HSNQ==} + /@blocksuite/store/0.4.0-20230111164952-fea266a_yjs@13.5.44: + resolution: {integrity: sha512-2iMDGtbrFK2AO8+j17Z1kpsVzpkFY91+IMD2lorqlGrK8zj2Ane8JypcARFXJJ6rG8yRbB+P8GDLTXXvj+ZgmQ==} peerDependencies: yjs: ^13 dependencies: + '@blocksuite/global': 0.4.0-20230111164952-fea266a '@types/flexsearch': 0.7.3 '@types/quill': 1.3.10 buffer: 6.0.3 @@ -2497,6 +2503,10 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@lit-labs/ssr-dom-shim/1.0.0: + resolution: {integrity: sha512-ic93MBXfApIFTrup4a70M/+ddD8xdt2zxxj9sRwHQzhS9ag/syqkD8JPdTXsc1gUy2K8TTirhlCqyTEM/sifNw==} + dev: false + /@lit/reactive-element/1.4.1: resolution: {integrity: sha512-qDv4851VFSaBWzpS02cXHclo40jsbAjRXnebNXpm0uVg32kCneZPo9RYVQtrTNICtZ+1wAYHu1ZtxWSWMbKrBw==} dev: false @@ -2505,6 +2515,12 @@ packages: resolution: {integrity: sha512-fQh9FDK0LPTwDk+0HhSZEtb8K0LTN1wXerwpGrWA+a8tWulYRDLI4vQDWp4GOIsewn0572KYV/oZ3+492D7osA==} dev: false + /@lit/reactive-element/1.6.0: + resolution: {integrity: sha512-33H04h4tx9NVEADti0haZTNxssCnqZlMlyjri5k9kwDWAe2W1iENroZt7VWwmsPhlWUD8sSoPXSHqd0DdL29Pw==} + dependencies: + '@lit-labs/ssr-dom-shim': 1.0.0 + dev: false + /@manypkg/find-root/1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: @@ -6212,6 +6228,12 @@ packages: '@types/trusted-types': 2.0.2 dev: false + /lit-html/2.6.0: + resolution: {integrity: sha512-slNAAYfvC7LxeryDOnPFl5uTpxGYGJ6UR9SFmfY+gQ+sf30z1atDPXlgjcSTtwymNdlwDhfGjq+EemQRXp9z1g==} + dependencies: + '@types/trusted-types': 2.0.2 + dev: false + /lit/2.4.0: resolution: {integrity: sha512-fdgzxEtLrZFQU/BqTtxFQCLwlZd9bdat+ltzSFjvWkZrs7eBmeX0L5MHUMb3kYIkuS8Xlfnii/iI5klirF8/Xg==} dependencies: @@ -6220,12 +6242,12 @@ packages: lit-html: 2.4.0 dev: false - /lit/2.5.0: - resolution: {integrity: sha512-DtnUP6vR3l4Q8nRPPNBD+UxbAhwJPeky+OVbi3pdgMqm0g57xFSl1Sj64D1rIB+nVNdiVVg8YxB0hqKjvdadZA==} + /lit/2.6.0: + resolution: {integrity: sha512-GUKVozhomdYlFVuB4UNipbPB5RcXNX4ns43uDA1gSTZN1oHe7mnj05fpYbESxXfxg/Gn905HTIzymCFrr/cn3A==} dependencies: - '@lit/reactive-element': 1.5.0 + '@lit/reactive-element': 1.6.0 lit-element: 3.2.2 - lit-html: 2.5.0 + lit-html: 2.6.0 dev: false /load-yaml-file/0.2.0: From 89866378ef1a3e18c29911cf863940b4603ec766 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 13:02:32 +0800 Subject: [PATCH 25/34] feat: add i18n keys auto sync --- .github/workflows/languages-sync.yml | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/languages-sync.yml diff --git a/.github/workflows/languages-sync.yml b/.github/workflows/languages-sync.yml new file mode 100644 index 0000000000..1bb8049e66 --- /dev/null +++ b/.github/workflows/languages-sync.yml @@ -0,0 +1,63 @@ +name: Languages Sync + +on: + # push: + # branches: [ "develop", "master" ] + # paths: + # - 'libs/datasource/i18n/**' + # - '.github/workflows/languages-sync.yml' + # pull_request: + # branches: [ "develop", "master" ] + # paths: + # - 'libs/datasource/i18n/**' + # - '.github/workflows/languages-sync.yml' + workflow_dispatch: + +# Cancels all previous workflow runs for pull requests that have not completed. +# See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + # The concurrency group contains the workflow name and the branch name for + # pull requests or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + main: + strategy: + matrix: + node-version: [18] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 + + - name: Use Node.js ${{ matrix.node-version }} + # https://github.com/actions/setup-node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install node modules + run: pnpm install + + - name: Check Language Key + if: github.ref != 'refs/heads/master' + working-directory: ./packages/i18n + run: pnpm run sync-languages:check + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} + + - name: Sync Languages + if: github.ref == 'refs/heads/master' + working-directory: ./packages/i18n + run: pnpm run sync-languages + env: + TOLGEE_API_KEY: ${{ secrets.TOLGEE_API_KEY }} From 2867cb07c5bf5e52a5e76a2b8bf053c790439781 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 14:16:49 +0800 Subject: [PATCH 26/34] feat: add push and pr events --- .github/workflows/languages-sync.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/languages-sync.yml b/.github/workflows/languages-sync.yml index 1bb8049e66..3cacc35749 100644 --- a/.github/workflows/languages-sync.yml +++ b/.github/workflows/languages-sync.yml @@ -1,16 +1,16 @@ name: Languages Sync on: - # push: - # branches: [ "develop", "master" ] - # paths: - # - 'libs/datasource/i18n/**' - # - '.github/workflows/languages-sync.yml' - # pull_request: - # branches: [ "develop", "master" ] - # paths: - # - 'libs/datasource/i18n/**' - # - '.github/workflows/languages-sync.yml' + push: + branches: ['master'] + paths: + - 'packages/i18n/**' + - '.github/workflows/languages-sync.yml' + pull_request: + branches: ['master'] + paths: + - 'packages/i18n/**' + - '.github/workflows/languages-sync.yml' workflow_dispatch: # Cancels all previous workflow runs for pull requests that have not completed. From b2f44f9fab9c720adc7119ae54b271d63f3a264b Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 14:29:18 +0800 Subject: [PATCH 27/34] chore: update readme --- packages/i18n/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/i18n/README.md b/packages/i18n/README.md index f8ad64372a..ec443f6fc8 100644 --- a/packages/i18n/README.md +++ b/packages/i18n/README.md @@ -36,6 +36,12 @@ const App = () => { }; ``` +## How the i18n workflow works? + +- When the `src/resources/en.json`(base language) updated and merged to the develop branch, will trigger the `languages-sync` action. +- The `languages-sync` action will check the base language and add missing translations to the Tolgee platform. +- This way, partners from the community can update the translations. + ## How to sync translations manually - Set token as environment variable @@ -45,7 +51,8 @@ export TOLGEE_API_KEY=tgpak_XXXXXXX ``` - Run the `sync-languages:check` to check all languages -- Run the `sync-languages` script to add new keys to the tolgee platform +- Run the `sync-languages` script to add new keys to the Tolgee platform +- Run the `download-resources` script to download the latest full-translation translation resources from the Tolgee platform ## References From b855f71ebfcfc990cf90d118d689c3429a831658 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 14:32:45 +0800 Subject: [PATCH 28/34] test: test ci --- packages/i18n/src/resources/en.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index 2831a8aafe..4dd82e101e 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -141,5 +141,6 @@ "Sign in": "Sign in to AFFiNE Cloud", "Sync Description": "{{workspaceName}} is a Local Workspace. All data is stored on the current device. You can enable AFFiNE Cloud for this workspace to keep data in sync with the cloud.", "Sync Description2": "<1>{{workspaceName}} is a Cloud Workspace. All data will be synchronised and saved to AFFiNE Cloud.", - "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost." + "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost", + "test case": "test case" } From 082894d08cf24902eefc36958fec1f7738bd4dff Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 14:52:07 +0800 Subject: [PATCH 29/34] chore: restore en.json --- packages/i18n/src/resources/en.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index 4dd82e101e..2831a8aafe 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -141,6 +141,5 @@ "Sign in": "Sign in to AFFiNE Cloud", "Sync Description": "{{workspaceName}} is a Local Workspace. All data is stored on the current device. You can enable AFFiNE Cloud for this workspace to keep data in sync with the cloud.", "Sync Description2": "<1>{{workspaceName}} is a Cloud Workspace. All data will be synchronised and saved to AFFiNE Cloud.", - "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost", - "test case": "test case" + "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost." } From 13de557d24c6afdb0689a3ec7da76d476de6530a Mon Sep 17 00:00:00 2001 From: x1a0t <405028157@qq.com> Date: Thu, 12 Jan 2023 14:59:44 +0800 Subject: [PATCH 30/34] chore: update BlockSuite version including introducing feature flag, adding upgrade npm script --- package.json | 3 +- packages/app/package.json | 6 +-- packages/data-center/package.json | 9 ++-- pnpm-lock.yaml | 68 ++++++++++++++----------------- update-dep.sh | 5 +++ 5 files changed, 45 insertions(+), 46 deletions(-) create mode 100755 update-dep.sh diff --git a/package.json b/package.json index b5b2f829d5..ff238c9c08 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "test:unit": "playwright test --config=playwright.config.unit.ts", "postinstall": "husky install", "notify": "node --experimental-modules scripts/notify.mjs", - "check:ci": "pnpm lint & pnpm test" + "check:ci": "pnpm lint & pnpm test", + "update:blocksuite": "chmod 755 update-dep.sh && sh update-dep.sh" }, "lint-staged": { "*": "prettier --write --ignore-unknown", diff --git a/packages/app/package.json b/packages/app/package.json index b68de96c0b..31fa964621 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -11,10 +11,10 @@ "dependencies": { "@affine/datacenter": "workspace:*", "@affine/i18n": "workspace:*", - "@blocksuite/blocks": "0.4.0-20230111164952-fea266a", - "@blocksuite/editor": "0.4.0-20230111164952-fea266a", + "@blocksuite/blocks": "0.4.0-20230111171650-bc63456", + "@blocksuite/editor": "0.4.0-20230111171650-bc63456", "@blocksuite/icons": "^2.0.2", - "@blocksuite/store": "0.4.0-20230111164952-fea266a", + "@blocksuite/store": "0.4.0-20230111171650-bc63456", "@emotion/css": "^11.10.0", "@emotion/react": "^11.10.4", "@emotion/server": "^11.10.0", diff --git a/packages/data-center/package.json b/packages/data-center/package.json index 597e9e46a7..f97871413a 100644 --- a/packages/data-center/package.json +++ b/packages/data-center/package.json @@ -26,8 +26,9 @@ "typescript": "^4.8.4" }, "dependencies": { - "@blocksuite/blocks": "0.4.0-20230111164952-fea266a", - "@blocksuite/store": "0.4.0-20230111164952-fea266a", + "@blocksuite/blocks": "0.4.0-20230111171650-bc63456", + "@blocksuite/editor": "0.4.0-20230111171650-bc63456", + "@blocksuite/store": "0.4.0-20230111171650-bc63456", "debug": "^4.3.4", "encoding": "^0.1.13", "firebase": "^9.15.0", @@ -36,8 +37,8 @@ "ky-universal": "^0.11.0", "lib0": "^0.2.58", "swr": "^2.0.0", - "yjs": "^13.5.44", - "y-protocols": "^1.0.5" + "y-protocols": "^1.0.5", + "yjs": "^13.5.44" }, "peerDependencies": { "@blocksuite/blocks": "0.3.1-*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f1d36703e2..a7f96d5abe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,10 +40,10 @@ importers: specifiers: '@affine/datacenter': workspace:* '@affine/i18n': workspace:* - '@blocksuite/blocks': 0.4.0-20230111164952-fea266a - '@blocksuite/editor': 0.4.0-20230111164952-fea266a + '@blocksuite/blocks': 0.4.0-20230111171650-bc63456 + '@blocksuite/editor': 0.4.0-20230111171650-bc63456 '@blocksuite/icons': ^2.0.2 - '@blocksuite/store': 0.4.0-20230111164952-fea266a + '@blocksuite/store': 0.4.0-20230111171650-bc63456 '@emotion/css': ^11.10.0 '@emotion/react': ^11.10.4 '@emotion/server': ^11.10.0 @@ -81,10 +81,10 @@ importers: dependencies: '@affine/datacenter': link:../data-center '@affine/i18n': link:../i18n - '@blocksuite/blocks': 0.4.0-20230111164952-fea266a_yjs@13.5.44 - '@blocksuite/editor': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/blocks': 0.4.0-20230111171650-bc63456_yjs@13.5.44 + '@blocksuite/editor': 0.4.0-20230111171650-bc63456_yjs@13.5.44 '@blocksuite/icons': 2.0.4_w5j4k42lgipnm43s3brx6h3c34 - '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111171650-bc63456_yjs@13.5.44 '@emotion/css': 11.10.0 '@emotion/react': 11.10.4_w5j4k42lgipnm43s3brx6h3c34 '@emotion/server': 11.10.0_@emotion+css@11.10.0 @@ -123,8 +123,9 @@ importers: packages/data-center: specifiers: - '@blocksuite/blocks': 0.4.0-20230111164952-fea266a - '@blocksuite/store': 0.4.0-20230111164952-fea266a + '@blocksuite/blocks': 0.4.0-20230111171650-bc63456 + '@blocksuite/editor': 0.4.0-20230111171650-bc63456 + '@blocksuite/store': 0.4.0-20230111171650-bc63456 '@playwright/test': ^1.29.1 '@types/debug': ^4.1.7 debug: ^4.3.4 @@ -140,8 +141,9 @@ importers: y-protocols: ^1.0.5 yjs: ^13.5.44 dependencies: - '@blocksuite/blocks': 0.4.0-20230111164952-fea266a_yjs@13.5.44 - '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/blocks': 0.4.0-20230111171650-bc63456_yjs@13.5.44 + '@blocksuite/editor': 0.4.0-20230111171650-bc63456_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111171650-bc63456_yjs@13.5.44 debug: 4.3.4 encoding: 0.1.13 firebase: 9.15.0_encoding@0.1.13 @@ -1455,12 +1457,12 @@ packages: to-fast-properties: 2.0.0 dev: true - /@blocksuite/blocks/0.4.0-20230111164952-fea266a_yjs@13.5.44: - resolution: {integrity: sha512-bphgTV5YkEfsqkvRJdbH8TevG6l9b9WHTliETJ4UksX4sxOsRDJk0v4XcluIDZXDv4TQ8fc45d5s5uaab48xQQ==} + /@blocksuite/blocks/0.4.0-20230111171650-bc63456_yjs@13.5.44: + resolution: {integrity: sha512-7fpb++pT9laoyLFWl4h09v7TUqZ/9udMrC1qxdX2XFgMPJjg3MJ9RG+Ud2s/zqZ1SkU1+0hMBvJP5ci9vV44gw==} dependencies: - '@blocksuite/global': 0.4.0-20230111164952-fea266a - '@blocksuite/phasor': 0.4.0-20230111164952-fea266a_yjs@13.5.44 - '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/global': 0.4.0-20230111171650-bc63456 + '@blocksuite/phasor': 0.4.0-20230111171650-bc63456_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111171650-bc63456_yjs@13.5.44 '@tldraw/intersect': 1.8.0 autosize: 5.0.2 highlight.js: 11.7.0 @@ -1476,11 +1478,11 @@ packages: - yjs dev: false - /@blocksuite/editor/0.4.0-20230111164952-fea266a_yjs@13.5.44: - resolution: {integrity: sha512-pVHH9nu9FwQErrPI6dHfMUCVtPEaNuB4PhHmyrcrVIgTGaGKdAQZ7PrsEqvjeWnIoX2l6s4u9XCFgdAsxybSfQ==} + /@blocksuite/editor/0.4.0-20230111171650-bc63456_yjs@13.5.44: + resolution: {integrity: sha512-NbghDNWDGHXXfEqgnNhbw7zewGRyx9LUzOv1FmY2WVhzDu02MSrTWxMduChH1/tfLHRLe6jusmZKS9BNSUPynA==} dependencies: - '@blocksuite/blocks': 0.4.0-20230111164952-fea266a_yjs@13.5.44 - '@blocksuite/store': 0.4.0-20230111164952-fea266a_yjs@13.5.44 + '@blocksuite/blocks': 0.4.0-20230111171650-bc63456_yjs@13.5.44 + '@blocksuite/store': 0.4.0-20230111171650-bc63456_yjs@13.5.44 lit: 2.6.0 marked: 4.2.5 turndown: 7.1.1 @@ -1491,8 +1493,8 @@ packages: - yjs dev: false - /@blocksuite/global/0.4.0-20230111164952-fea266a: - resolution: {integrity: sha512-R2nXYIfyBaSMbLGF/aOUgRPFpWYs+bbK1/E9wChQGvC1D8UhQ6WRUt/khzM/GpdvnmIhmMyolJZ6LjEjGAo6Wg==} + /@blocksuite/global/0.4.0-20230111171650-bc63456: + resolution: {integrity: sha512-/Kqg73vPLzxiWp6UqRmRoKfYmH4Sij3mU52RJf9adyywZOdM5e9E1gvPP+Eruz/x2jJ1uzR5/ivFqp5t688/tg==} dev: false /@blocksuite/icons/2.0.4_w5j4k42lgipnm43s3brx6h3c34: @@ -1505,20 +1507,20 @@ packages: react: 18.2.0 dev: false - /@blocksuite/phasor/0.4.0-20230111164952-fea266a_yjs@13.5.44: - resolution: {integrity: sha512-AHxLIHi2s3fcfzbx8URVer3LGlZnVKvW+ttpRKIm8a3vkZqaXwb9+8gL8Ajh6YkOvf9Nb1Y5471978284BwCfw==} + /@blocksuite/phasor/0.4.0-20230111171650-bc63456_yjs@13.5.44: + resolution: {integrity: sha512-fzmrG8KVJXkm5YyvHpPG1RRFhXjzuOey8OIoDu+/z87n9HJc4SkOd9JKH6wEL37F7P5ZoEM9Yl9YHxQjUc4/CA==} peerDependencies: yjs: ^13 dependencies: yjs: 13.5.44 dev: false - /@blocksuite/store/0.4.0-20230111164952-fea266a_yjs@13.5.44: - resolution: {integrity: sha512-2iMDGtbrFK2AO8+j17Z1kpsVzpkFY91+IMD2lorqlGrK8zj2Ane8JypcARFXJJ6rG8yRbB+P8GDLTXXvj+ZgmQ==} + /@blocksuite/store/0.4.0-20230111171650-bc63456_yjs@13.5.44: + resolution: {integrity: sha512-f/PKFPadA0KZq/wSLxxlS29c4SDuMfzHN1/gdrxFEIY0gC8caK2jZnT4K62R9Nquik/mXL60h8fBVAkQ0KbHzg==} peerDependencies: yjs: ^13 dependencies: - '@blocksuite/global': 0.4.0-20230111164952-fea266a + '@blocksuite/global': 0.4.0-20230111171650-bc63456 '@types/flexsearch': 0.7.3 '@types/quill': 1.3.10 buffer: 6.0.3 @@ -2511,10 +2513,6 @@ packages: resolution: {integrity: sha512-qDv4851VFSaBWzpS02cXHclo40jsbAjRXnebNXpm0uVg32kCneZPo9RYVQtrTNICtZ+1wAYHu1ZtxWSWMbKrBw==} dev: false - /@lit/reactive-element/1.5.0: - resolution: {integrity: sha512-fQh9FDK0LPTwDk+0HhSZEtb8K0LTN1wXerwpGrWA+a8tWulYRDLI4vQDWp4GOIsewn0572KYV/oZ3+492D7osA==} - dev: false - /@lit/reactive-element/1.6.0: resolution: {integrity: sha512-33H04h4tx9NVEADti0haZTNxssCnqZlMlyjri5k9kwDWAe2W1iENroZt7VWwmsPhlWUD8sSoPXSHqd0DdL29Pw==} dependencies: @@ -6212,8 +6210,8 @@ packages: /lit-element/3.2.2: resolution: {integrity: sha512-6ZgxBR9KNroqKb6+htkyBwD90XGRiqKDHVrW/Eh0EZ+l+iC+u+v+w3/BA5NGi4nizAVHGYvQBHUDuSmLjPp7NQ==} dependencies: - '@lit/reactive-element': 1.5.0 - lit-html: 2.5.0 + '@lit/reactive-element': 1.6.0 + lit-html: 2.6.0 dev: false /lit-html/2.4.0: @@ -6222,12 +6220,6 @@ packages: '@types/trusted-types': 2.0.2 dev: false - /lit-html/2.5.0: - resolution: {integrity: sha512-bLHosg1XL3JRUcKdSVI0sLCs0y1wWrj2sqqAN3cZ7bDDPNgmDHH29RV48x6Wz3ZmkxIupaE+z7uXSZ/pXWAO1g==} - dependencies: - '@types/trusted-types': 2.0.2 - dev: false - /lit-html/2.6.0: resolution: {integrity: sha512-slNAAYfvC7LxeryDOnPFl5uTpxGYGJ6UR9SFmfY+gQ+sf30z1atDPXlgjcSTtwymNdlwDhfGjq+EemQRXp9z1g==} dependencies: diff --git a/update-dep.sh b/update-dep.sh new file mode 100755 index 0000000000..3c9e1cd39a --- /dev/null +++ b/update-dep.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd packages/app +pnpm i @blocksuite/store@nightly @blocksuite/blocks@nightly @blocksuite/editor@nightly +cd ../data-center +pnpm i @blocksuite/store@nightly @blocksuite/blocks@nightly @blocksuite/editor@nightly From 3d6361ba3d566f84b76fffc74dcd866dcf5c3446 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 15:02:23 +0800 Subject: [PATCH 31/34] feat: add en.json codeOwners --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f80d334591..98be545ece 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,3 @@ **/project.json @darkskygit **/pnpm-lock.yaml @darkskygit +**/en.json @JimmFly \ No newline at end of file From a45040a95649fa56c9ecc6ddedcd868c7dc07037 Mon Sep 17 00:00:00 2001 From: x1a0t <405028157@qq.com> Date: Thu, 12 Jan 2023 16:13:26 +0800 Subject: [PATCH 32/34] fix: deleting bash script, using npm script to be cross platform compatible --- package.json | 2 +- update-dep.sh | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100755 update-dep.sh diff --git a/package.json b/package.json index ff238c9c08..43d76b7e12 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "postinstall": "husky install", "notify": "node --experimental-modules scripts/notify.mjs", "check:ci": "pnpm lint & pnpm test", - "update:blocksuite": "chmod 755 update-dep.sh && sh update-dep.sh" + "update:blocksuite": "pnpm i --filter @affine/app --filter @affine/datacenter @blocksuite/blocks@nightly @blocksuite/store@nightly @blocksuite/editor@nightly" }, "lint-staged": { "*": "prettier --write --ignore-unknown", diff --git a/update-dep.sh b/update-dep.sh deleted file mode 100755 index 3c9e1cd39a..0000000000 --- a/update-dep.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -cd packages/app -pnpm i @blocksuite/store@nightly @blocksuite/blocks@nightly @blocksuite/editor@nightly -cd ../data-center -pnpm i @blocksuite/store@nightly @blocksuite/blocks@nightly @blocksuite/editor@nightly From 69e30ba8884e6f95e45215d942202be42420b256 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 17:02:45 +0800 Subject: [PATCH 33/34] chore: remove hover tip --- .../src/components/header/EditorHeader.tsx | 12 ++++++--- .../components/header/QuickSearchButton.tsx | 25 ++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/packages/app/src/components/header/EditorHeader.tsx b/packages/app/src/components/header/EditorHeader.tsx index 491174f578..7662eccbae 100644 --- a/packages/app/src/components/header/EditorHeader.tsx +++ b/packages/app/src/components/header/EditorHeader.tsx @@ -1,11 +1,17 @@ import React, { useEffect, useState } from 'react'; -import { StyledSwitchWrapper, StyledTitle, StyledTitleWrapper } from './styles'; +import { + StyledSearchArrowWrapper, + StyledSwitchWrapper, + StyledTitle, + StyledTitleWrapper, +} from './styles'; import { Content } from '@/ui/layout'; import { useAppState } from '@/providers/app-state-provider/context'; import EditorModeSwitch from '@/components/editor-mode-switch'; import Header from './Header'; import usePropsUpdated from '@/hooks/use-props-updated'; import useCurrentPageMeta from '@/hooks/use-current-page-meta'; +import QuickSearchButton from './QuickSearchButton'; export const EditorHeader = () => { const [title, setTitle] = useState(''); @@ -58,9 +64,9 @@ export const EditorHeader = () => { /> {title} - {/* + - */} + )} diff --git a/packages/app/src/components/header/QuickSearchButton.tsx b/packages/app/src/components/header/QuickSearchButton.tsx index f5d2023500..64e3657448 100644 --- a/packages/app/src/components/header/QuickSearchButton.tsx +++ b/packages/app/src/components/header/QuickSearchButton.tsx @@ -1,28 +1,23 @@ import React from 'react'; import { IconButton, IconButtonProps } from '@/ui/button'; -import { Tooltip } from '@/ui/tooltip'; import { ArrowDownIcon } from '@blocksuite/icons'; import { useModal } from '@/providers/GlobalModalProvider'; -import { useTranslation } from '@affine/i18n'; export const QuickSearchButton = ({ onClick, ...props }: Omit) => { const { triggerQuickSearchModal } = useModal(); - const { t } = useTranslation(); return ( - - { - onClick?.(e); - triggerQuickSearchModal(); - }} - > - - - + { + onClick?.(e); + triggerQuickSearchModal(); + }} + > + + ); }; From cf6b1731b02c50bcf9a208aa961babfca9a4bddd Mon Sep 17 00:00:00 2001 From: JimmFly Date: Thu, 12 Jan 2023 17:53:11 +0800 Subject: [PATCH 34/34] chore: update translation --- packages/i18n/src/resources/en.json | 8 +- packages/i18n/src/resources/index.ts | 11 ++ packages/i18n/src/resources/zh-Hans.json | 148 +++++++++++++++++++++++ 3 files changed, 164 insertions(+), 3 deletions(-) create mode 100644 packages/i18n/src/resources/zh-Hans.json diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index 2831a8aafe..6886bbacb5 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -15,7 +15,6 @@ "Add to favourites": "Add to favourites", "Paper": "Paper", "Edgeless": "Edgeless", - "Jump to": "Jump to", "Convert to ": "Convert to ", "Page": "Page", "Export": "Export", @@ -57,12 +56,13 @@ "Reduce indent": "Reduce indent", "Markdown Syntax": "Markdown Syntax", "Divider": "Divider", - "404 - Page Not Found": "404 - Page Not Found", "Once deleted, you can't undo this action": { "": "Once deleted, you can't undo this action." }, "Remove from favourites": "Remove from favourites", "Removed from Favourites": "Removed from Favourites", + "Jump to": "Jump to", + "404 - Page Not Found": "404 - Page Not Found", "New Workspace": "New Workspace", "Workspace description": "Workspace is your virtual space to capture, create and plan as just one person or together as a team.", "Create": "Create", @@ -141,5 +141,7 @@ "Sign in": "Sign in to AFFiNE Cloud", "Sync Description": "{{workspaceName}} is a Local Workspace. All data is stored on the current device. You can enable AFFiNE Cloud for this workspace to keep data in sync with the cloud.", "Sync Description2": "<1>{{workspaceName}} is a Cloud Workspace. All data will be synchronised and saved to AFFiNE Cloud.", - "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost." + "Delete Workspace Description": "Deleting (<1>{{workspace}}) cannot be undone, please proceed with caution. All contents will be lost.", + "core": "core", + "all": "all" } diff --git a/packages/i18n/src/resources/index.ts b/packages/i18n/src/resources/index.ts index 2081ad8aaf..cf5c5fc729 100644 --- a/packages/i18n/src/resources/index.ts +++ b/packages/i18n/src/resources/index.ts @@ -2,6 +2,7 @@ // Run `pnpm run download-resources` to regenerate. // To overwrite this, please overwrite download.ts script. import en from './en.json'; +import zh_Hans from './zh-Hans.json'; export const LOCALES = [ { @@ -14,4 +15,14 @@ export const LOCALES = [ completeRate: 1, res: en, }, + { + id: 1000040004, + name: 'Simplified Chinese', + tag: 'zh-Hans', + originalName: '简体中文', + flagEmoji: '🇨🇳', + base: false, + completeRate: 1, + res: zh_Hans, + }, ] as const; diff --git a/packages/i18n/src/resources/zh-Hans.json b/packages/i18n/src/resources/zh-Hans.json new file mode 100644 index 0000000000..2a2e17c660 --- /dev/null +++ b/packages/i18n/src/resources/zh-Hans.json @@ -0,0 +1,148 @@ +{ + "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.": "", + "Quick search": "快速搜索", + "All pages": "全部页面", + "Favourites": "收藏夹", + "No item": "无项目", + "Import": "导入", + "Trash": "垃圾箱", + "New Page": "新建页面", + "New Keyword Page": "新建 “{{query}}“ 为标题的页面 ", + "Find 0 result": "找到 0 个结果", + "Find results": "找到 {{number}} 个结果", + "Collapse sidebar": "折叠侧边栏", + "Expand sidebar": "展开侧边栏", + "Added to Favourites": "已收藏", + "Add to favourites": "加入收藏", + "Paper": "文档", + "Edgeless": "无界", + "Convert to ": "转换为", + "Page": "页面", + "Export": "导出", + "Export to HTML": "导出为 HTML", + "Export to Markdown": "导出为 Markdown", + "Delete": "删除", + "Title": "标题", + "Untitled": "未命名", + "Created": "已创建", + "Updated": "已更新", + "Open in new tab": "在新标签页打开", + "Favourite": "收藏", + "Favourited": "已收藏", + "Delete page?": "确定要删除页面?", + "Delete permanently?": "是否永久删除?", + "will be moved to Trash": "{{title}} 将被移到垃圾箱", + "Once deleted, you can't undo this action": { + "": "一旦删除,将无法撤销!" + }, + "Moved to Trash": "已移到垃圾箱", + "Permanently deleted": "已永久删除", + "restored": "{{title}} 已恢复", + "Cancel": "取消", + "Keyboard Shortcuts": "键盘快捷键", + "Contact Us": "联系我们", + "Official Website": "官网", + "Get in touch!": "保持联络!", + "AFFiNE Community": "AFFiNE 社区", + "How is AFFiNE Alpha different?": "AFFiNE Alpha有何不同?", + "Shortcuts": "快捷键", + "Undo": "撤销", + "Redo": "重做", + "Bold": "粗体", + "Italic": "斜体", + "Underline": "下划线", + "Strikethrough": "删除线", + "Inline code": "行内代码", + "Code block": "代码块", + "Link": "超链接(选定文本)", + "Body text": "正文", + "Heading": "标题 {{number}}", + "Increase indent": "增加缩进", + "Reduce indent": "减少缩进", + "Markdown Syntax": "Markdown 语法", + "Divider": "分割线", + "404 - Page Not Found": "404 - 页面不见了", + "Remove from favourites": "从收藏中移除", + "Removed from Favourites": "已从收藏中移除", + "New Workspace": "新建工作区", + "Workspace description": "工作区是为个人和团队进行引用、创建和规划的虚拟空间。", + "Create": "创建", + "Select": "选择", + "Text": "文本(即将上线)", + "Shape": "图形", + "Sticky": "便利贴(即将上线)", + "Pen": "笔(即将上线)", + "Connector": "链接(即将上线)", + "Upload": "上传", + "Restore it": "恢复TA", + "TrashButtonGroupTitle": "永久删除", + "TrashButtonGroupDescription": "一旦删除,将无法撤消此操作。确定吗?", + "Delete permanently": "永久删除", + "Quick search placeholder": "快速搜索...", + "Quick search placeholder2": "在{{workspace}} 中搜索", + "Settings": "设置", + "recommendBrowser": "建议使用 <1>Chrome 浏览器以获得最佳体验。", + "upgradeBrowser": "请升级到最新版本的 Chrome 以获得最佳体验。", + "Invite Members": "邀请成员", + "Invite placeholder": "搜索邮件(仅支持Gmail)", + "Non-Gmail": "不支持非Gmail邮箱", + "Invite": "邀请", + "Loading": "加载中...", + "NotLoggedIn": "当前未登录", + "ClearData": "清除本地数据", + "Continue with Google": "谷歌登录以继续", + "Set up an AFFiNE account to sync data": "设置AFFiNE帐户以同步数据", + "Stay logged out": "保持登出状态", + "All changes are saved locally": "所有改动已保存到本地", + "Ooops!": "啊哦!", + "mobile device": "貌似你正在移动设备上浏览。", + "mobile device description": "我们仍在进行移动端的支持工作,建议使用桌面设备。", + "Got it": "知道了", + "emptyAllPages": "此工作区为空。创建新页面并开始编辑。", + "emptyFavourite": "单击“添加到收藏夹”,页面将显示在此处。", + "emptyTrash": "单击“添加到垃圾箱”,页面将显示在此处。", + "still designed": "(此页面仍在设计中。)", + "My Workspaces": "我的工作区", + "Create Or Import": "创建或导入", + "Tips": "提示:", + "login success": "登录成功", + "Sign in": "登录 AFFiNE 云", + "Sign out": "登出 AFFiNE 云", + "Delete Workspace": "删除工作空间", + "Delete Workspace Description": "正在删除 (<1>{{workspace}}) ,此操作无法撤销,所有内容将会丢失。", + "Delete Workspace Description2": "正在删除(<1>{{workspace}}),将同时删除本地和云端数据。此操作无法撤消,请谨慎操作。", + "Delete Workspace placeholder": "请输入”Delete“以确认", + "Leave Workspace": "退出工作区", + "Leave Workspace Description": "退出后,您将无法再访问此工作区的内容。", + "Jump to": "跳转到", + "Leave": "退出", + "Workspace Icon": "工作区图标", + "Workspace Name": "工作区名称", + "Workspace Type": "工作区类型", + "Export Workspace": "导出工作区 <1>{{workspace}} 即将上线", + "Users": "用户", + "Access level": "访问权限", + "Pending": "待定", + "Collaboration Description": "与其他成员协作需要AFFiNE云服务支持。", + "Enable AFFiNE Cloud": "启用 AFFiNE 云服务", + "Enable AFFiNE Cloud Description": "如启用,此工作区中的数据将通过AFFiNE Cloud进行备份和同步。", + "Enable": "启动", + "Sign in and Enable": "登录并启用", + "Skip": "跳过", + "Publishing": "发布到web需要AFFiNE云服务。", + "Share with link": "通过链接分享", + "Copy Link": "复制链接", + "Publishing Description": "发布到web后,所有人都可以通过链接查看此工作区的内容。", + "Stop publishing": "中止发布", + "Publish to web": "发布到web", + "Sync Description": "{{workspaceName}}是本地工作区,所有数据都存储在当前设备上。您可以为此工作区启用AFFiNE Cloud,以使数据与云端保持同步。", + "Sync Description2": "<1>{{workspaceName}}是云端工作区。所有数据将同步并保存到AFFiNE Cloud。", + "Download data to device": "下载{{CoreOrAll}}数据到设备", + "General": "常规", + "Sync": "同步", + "Collaboration": "协作", + "Publish": "发布", + "Workspace Settings": "工作区设置", + "core": "核心", + "all": "全部" +}