diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4e7450e..4fd648a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,8 @@ on: push: branches: - "master" - +env: + REPOSITORY_PATH: https://${{secrets.ACCESS_TOKEN}}@github.com/ jobs: publish: runs-on: ${{ matrix.os }} @@ -12,6 +13,10 @@ jobs: matrix: os: [ubuntu-latest] steps: + - name: init + run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@gmail.com" - uses: actions/checkout@v4 - name: install-node uses: actions/setup-node@v1 diff --git a/package.json b/package.json index 0ed4d33..085d662 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "@cyia/localize", "version": "0.0.0", "description": "Angular 本地化独立版本;Angular localize standalone version", - "main": "./lib/index.js", "scripts": { "sync:localize": "code-recycle ./script/sync-localize.ts --cwd ./src ", "test": "rimraf ./test/fixture-output && node --import tsx --inspect ./node_modules/.bin/mocha \"test/**/*.ts\"", @@ -11,11 +10,7 @@ "i18n:init": "tsx ./src/bin/index.ts ./src ./i18n-meta --update --name zh-Hans", "i18n:convert": "tsx ./src/bin/index.ts convert ./i18n-meta ./dist/bin/i18n" }, - "bin": { - "i18n": "./lib/bin/index.js", - "l10n": "./lib/bin/index.js" - }, - "author": "", + "author": "wszgrcy", "private": true, "devDependencies": { "@types/chai": "^4.3.14", diff --git a/readme.md b/readme.md index 2a19ad4..7e8b863 100644 --- a/readme.md +++ b/readme.md @@ -64,4 +64,7 @@ loadI18n(); ``` ## Merge other translations -- If other dependency packages also use `@cyia/localize` and the published package contains translated/metadata text, use `i18n merge ./output ./pkg1 ./pkg2` merge multiple and then import them again \ No newline at end of file +- If other dependency packages also use `@cyia/localize` and the published package contains translated/metadata text, use `i18n merge ./output ./pkg1 ./pkg2` merge multiple and then import them again + +## Update existing translations +- `i18n ./src ./i18n-meta --update --name zh-Hans`Extract the content and use `zh-Hans` as the original file (no translation required), while files in other languages will add/remove corresponding text \ No newline at end of file diff --git a/readme.zh-Hans.md b/readme.zh-Hans.md index 7eaddac..76c1bb2 100644 --- a/readme.zh-Hans.md +++ b/readme.zh-Hans.md @@ -65,5 +65,7 @@ loadI18n(); ``` ## 合并其他翻译 - - 如果其他依赖包也使用了`@cyia/localize`并且发布包中含有翻译文本/元数据文本,可以使用`i18n merge ./output ./pkg1 ./pkg2`将多个合并,然后再导入 + +## 更新已有翻译 +- `i18n ./src ./i18n-meta --update --name zh-Hans`提取内容后以`zh-Hans`为原始文件(不需要翻译),其他语言的文件会添加/删除相应文本 diff --git a/src/package.json b/src/package.json index d2e442f..cbd433f 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@cyia/localize", - "version": "1.2.1", + "version": "1.2.2", "description": "Angular 本地化独立版本;Angular localize standalone version", "bin": { "i18n": "./bin/index.js",