From 5cd253d94fe26032a5a7bf9ae7838c74ba5115ed Mon Sep 17 00:00:00 2001 From: qinluhe Date: Wed, 18 Dec 2024 11:14:18 +0800 Subject: [PATCH 1/2] feat: support inlang --- .github/workflows/lint.yml | 23 +++++++++++++++ .github/workflows/ninja_i18n.yml | 21 ++++++++++++++ .gitignore | 2 ++ project.inlang/setting.json | 48 ++++++++++++++++++++++++++++++++ src/locales/ar-SA.json | 0 src/locales/ca-ES.json | 0 src/locales/ckb-KU.json | 0 src/locales/cs-CZ.json | 0 src/locales/de-DE.json | 0 src/locales/es-VE.json | 0 src/locales/eu-ES.json | 0 src/locales/fa.json | 0 src/locales/fr-CA.json | 0 src/locales/fr-FR.json | 0 src/locales/he.json | 0 src/locales/hu-HU.json | 0 src/locales/id-ID.json | 0 src/locales/it-IT.json | 0 src/locales/ja-JP.json | 0 src/locales/ko-KR.json | 0 src/locales/pl-PL.json | 0 src/locales/pt-BR.json | 0 src/locales/pt-PT.json | 0 src/locales/ru-RU.json | 0 src/locales/sv-SE.json | 0 src/locales/th-TH.json | 0 src/locales/tr-TR.json | 0 src/locales/uk-UA.json | 0 src/locales/vi-VN.json | 0 src/locales/vi.json | 0 src/locales/zh-CN.json | 0 src/locales/zh-TW.json | 0 32 files changed, 94 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/ninja_i18n.yml create mode 100644 project.inlang/setting.json create mode 100644 src/locales/ar-SA.json create mode 100644 src/locales/ca-ES.json create mode 100644 src/locales/ckb-KU.json create mode 100644 src/locales/cs-CZ.json create mode 100644 src/locales/de-DE.json create mode 100644 src/locales/es-VE.json create mode 100644 src/locales/eu-ES.json create mode 100644 src/locales/fa.json create mode 100644 src/locales/fr-CA.json create mode 100644 src/locales/fr-FR.json create mode 100644 src/locales/he.json create mode 100644 src/locales/hu-HU.json create mode 100644 src/locales/id-ID.json create mode 100644 src/locales/it-IT.json create mode 100644 src/locales/ja-JP.json create mode 100644 src/locales/ko-KR.json create mode 100644 src/locales/pl-PL.json create mode 100644 src/locales/pt-BR.json create mode 100644 src/locales/pt-PT.json create mode 100644 src/locales/ru-RU.json create mode 100644 src/locales/sv-SE.json create mode 100644 src/locales/th-TH.json create mode 100644 src/locales/tr-TR.json create mode 100644 src/locales/uk-UA.json create mode 100644 src/locales/vi-VN.json create mode 100644 src/locales/vi.json create mode 100644 src/locales/zh-CN.json create mode 100644 src/locales/zh-TW.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..0cc891e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: lint + +on: + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '20' + - uses: pnpm/action-setup@v4 + with: + version: '8.5.0' + run_install: false + - name: Install dependencies + run: pnpm i + - name: Lint + run: pnpm run lint \ No newline at end of file diff --git a/.github/workflows/ninja_i18n.yml b/.github/workflows/ninja_i18n.yml new file mode 100644 index 0000000..cee6f91 --- /dev/null +++ b/.github/workflows/ninja_i18n.yml @@ -0,0 +1,21 @@ +name: Ninja i18n action + +on: pull_request_target + +# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings +permissions: + pull-requests: write # Necessary to comment on PRs + issues: read # Necessary to read issue comments + contents: read # Necessary to access the repo content + +jobs: + ninja-i18n: + name: Ninja i18n - GitHub Lint Action + runs-on: ubuntu-latest + + steps: + - name: Run Ninja i18n + # @main ensures that the latest version of the action is used + uses: opral/ninja-i18n-action@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index a547bf3..58ca57e 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ dist-ssr *.njsproj *.sln *.sw? + +!project.inlang diff --git a/project.inlang/setting.json b/project.inlang/setting.json new file mode 100644 index 0000000..d643820 --- /dev/null +++ b/project.inlang/setting.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://inlang.com/schema/project-settings", + "sourceLanguageTag": "en", + "languageTags": [ + "en", + "ar-SA", + "ca-ES", + "ckb-KU", + "cs-CZ", + "de-DE", + "es-VE", + "eu-ES", + "fa", + "fr-CA", + "fr-FR", + "he", + "hu-HU", + "id-ID", + "it-IT", + "ja-JP", + "ko-KR", + "pl-PL", + "pt-BR", + "pt-PT", + "ru-RU", + "sv-SE", + "th-TH", + "tr-TR", + "uk-UA", + "vi", + "vi-VN", + "zh-CN", + "zh-TW" + ], + "modules": [ + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@1/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@1/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@1/dist/index.js", + "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@1/dist/index.js" + ], + "plugin.inlang.json": { + "pathPattern": "./src/locales/{language}.json", + "variableReferencePattern": [ + "{{", + "}}" + ] + } +} \ No newline at end of file diff --git a/src/locales/ar-SA.json b/src/locales/ar-SA.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/ca-ES.json b/src/locales/ca-ES.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/ckb-KU.json b/src/locales/ckb-KU.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/cs-CZ.json b/src/locales/cs-CZ.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/de-DE.json b/src/locales/de-DE.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/es-VE.json b/src/locales/es-VE.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/eu-ES.json b/src/locales/eu-ES.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/fa.json b/src/locales/fa.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/fr-CA.json b/src/locales/fr-CA.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/fr-FR.json b/src/locales/fr-FR.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/he.json b/src/locales/he.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/hu-HU.json b/src/locales/hu-HU.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/id-ID.json b/src/locales/id-ID.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/it-IT.json b/src/locales/it-IT.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/ja-JP.json b/src/locales/ja-JP.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/ko-KR.json b/src/locales/ko-KR.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/pl-PL.json b/src/locales/pl-PL.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/pt-BR.json b/src/locales/pt-BR.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/pt-PT.json b/src/locales/pt-PT.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/sv-SE.json b/src/locales/sv-SE.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/th-TH.json b/src/locales/th-TH.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/tr-TR.json b/src/locales/tr-TR.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/uk-UA.json b/src/locales/uk-UA.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/vi-VN.json b/src/locales/vi-VN.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/vi.json b/src/locales/vi.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json new file mode 100644 index 0000000..e69de29 diff --git a/src/locales/zh-TW.json b/src/locales/zh-TW.json new file mode 100644 index 0000000..e69de29 From 9c47ca748fa821f2675f70979a93031e0fd4a977 Mon Sep 17 00:00:00 2001 From: qinluhe Date: Wed, 18 Dec 2024 11:34:27 +0800 Subject: [PATCH 2/2] feat: support zh --- .../{setting.json => settings.json} | 0 src/locales/en.json | 3 ++ src/locales/zh-CN.json | 33 +++++++++++++++++++ 3 files changed, 36 insertions(+) rename project.inlang/{setting.json => settings.json} (100%) diff --git a/project.inlang/setting.json b/project.inlang/settings.json similarity index 100% rename from project.inlang/setting.json rename to project.inlang/settings.json diff --git a/src/locales/en.json b/src/locales/en.json index 0b7f450..bbc1f28 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -5,6 +5,9 @@ "italic": "Italic", "underline": "Underline" }, + "button": { + "submit": "Submit" + }, "placeholder": "Write something...", "editor": { "fontColorDefault": "Default", diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index e69de29..6eb9118 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -0,0 +1,33 @@ +{ + "translation": { + "editor": { + "fontColorDefault": "默认", + "fontColorRed": "红色", + "fontColorGreen": "绿色", + "fontColorBlue": "蓝色", + "fontColorYellow": "黄色", + "fontColorOrange": "橙色", + "fontColorPurple": "紫色", + "fontColorPink": "粉色", + "fontColorBrown": "棕色", + "fontColorGray": "灰色", + "backgroundColorDefault": "默认", + "backgroundColorRed": "红色", + "backgroundColorGreen": "绿色", + "backgroundColorBlue": "蓝色", + "backgroundColorYellow": "黄色", + "backgroundColorOrange": "橙色", + "backgroundColorPurple": "紫色", + "backgroundColorPink": "粉色", + "backgroundColorBrown": "棕色", + "backgroundColorGray": "灰色", + "backgroundColorLime": "石灰色", + "backgroundColorAqua": "水蓝色", + "backgroundColor": "背景颜色", + "textColor": "文字颜色", + "heading": "标题 {{level}}", + "paragraph": "段落", + "blockquote": "引用" + } + } +} \ No newline at end of file