0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

add steps to add new languages to ui contributing guidelines

This commit is contained in:
Juan Picado 2021-09-18 09:43:14 +02:00
parent eb2afc4d6d
commit 1b9bf35c87
3 changed files with 41 additions and 30 deletions

View file

@ -202,36 +202,6 @@ jobs:
run: pnpm test:e2e:cli run: pnpm test:e2e:cli
# env: # env:
# DEBUG: verdaccio* # 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: test-windows:
needs: [format, lint] needs: [format, lint]
runs-on: windows-latest runs-on: windows-latest
@ -255,3 +225,35 @@ jobs:
run: pnpm build run: pnpm build
- name: Test - name: Test
run: pnpm 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

View file

@ -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. 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 ## Request Features
New feature requests are welcome. Analyse whether the idea fits within scope of New feature requests are welcome. Analyse whether the idea fits within scope of