diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3194a1a3a..7c9450ae1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,36 +202,6 @@ jobs: run: pnpm test:e2e:cli # env: # DEBUG: verdaccio* - sync-translations: - needs: [ci-e2e-cli, ci-e2e-ui] - runs-on: ubuntu-latest - name: synchronize translations - if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' - steps: - - uses: actions/checkout@v2.3.1 - - uses: actions/setup-node@v1 - with: - node-version: 14 - - uses: actions/download-artifact@v2 - with: - name: verdaccio-artifact - - name: untar packages - run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages - - name: Install pnpm - run: npm i pnpm@6.10.3 -g - - uses: actions/cache@v2 - with: - path: ~/.pnpm-store - key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} - - name: Install - ## we need scripts, pupetter downloads aditional content - run: pnpm recursive install --frozen-lockfile - - name: sync - env: - CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }} - CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }} - CONTEXT: production - run: pnpm crowdin:sync test-windows: needs: [format, lint] runs-on: windows-latest @@ -255,3 +225,35 @@ jobs: run: pnpm build - name: Test run: pnpm test + sync-translations: + needs: [ci-e2e-cli, ci-e2e-ui, test-windows] + runs-on: ubuntu-latest + name: synchronize translations + if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' + steps: + - uses: actions/checkout@v2.3.1 + - uses: actions/setup-node@v1 + with: + node-version: 14 + - uses: actions/download-artifact@v2 + with: + name: verdaccio-artifact + - name: untar packages + run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages + - name: Install pnpm + run: npm i pnpm@6.10.3 -g + - uses: actions/cache@v2 + with: + path: ~/.pnpm-store + key: pnpm-${{ hashFiles('pnpm-lock.yaml') }} + - name: Install + ## we need scripts, pupetter downloads aditional content + run: pnpm recursive install --frozen-lockfile + - name: generate website translations + run: pnpm write-translations --filter ...@verdaccio/website + - name: sync + env: + CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }} + CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }} + CONTEXT: production + run: pnpm crowdin:sync diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 521e95fcc..b7a16cc6b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -204,6 +204,15 @@ If you want to contribute by adding translations, create an account (GitHub coul If a language is not listed, ask for it in the [Discord](https://discord.gg/7qWJxBf) channel #contribute channel. +For adding a new **language** on the UI follow these steps: + +1. Ensure the **language** has been enabled, must be visible in the `crowdin` platform. +2. Find in the explorer the file `en.US.json` in the path `packages/plugins/ui-theme/src/i18n/crowdin/en-US.json` and complete the translations, **not need to find approval on this**. +3. Into the project, add a new field into `packages/plugins/ui-theme/src/i18n/crowdin/en-US.json` file, in the section `lng`, the new language, eg: `{ lng: {korean:"한국인"}}`. (_There is an issue, this string won't be available in crowdin until your PR has been merge_) +4. Add the language, [flag icon](https://www.npmjs.com/package/country-flag-icons), and the menu key fort he new language eg: `menuKey: 'lng.korean'` to the file `packages/plugins/ui-theme/src/i18n/enabledLanguages.ts`. +5. For local testing, read `packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md`. +6. Add a `changeset` file, see more info below. + ## Request Features New feature requests are welcome. Analyse whether the idea fits within scope of diff --git a/packages/plugins/ui-theme/src/i18n/crowdin/ABOUT_TRANSLATIONS.md b/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md similarity index 100% rename from packages/plugins/ui-theme/src/i18n/crowdin/ABOUT_TRANSLATIONS.md rename to packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md