Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Upload new glossary terms to Crowdin #231

Closed
zeke opened this issue Mar 13, 2020 · 3 comments · Fixed by #240
Closed

Upload new glossary terms to Crowdin #231

zeke opened this issue Mar 13, 2020 · 3 comments · Fixed by #240

Comments

@zeke
Copy link
Contributor

zeke commented Mar 13, 2020

In #91 we introduced a new glossary file! The next step will be to upload these terms to the Crowdin project using Crowdin's API and the https://github.com/crowdin-node/crowdin-glossary npm module.

Details for this process are covered in the OP of this issue: #81

cc @alexandrtovmach @maddhruv

@maddhruv
Copy link
Contributor

The ideal way I see to automate the upload is to listen for changes in the corresponding sources - builtins, crowdin-glossary.json, we would run the upload then - maybe via GitHub Actions and automated.

One problem solution - Use github actions and look for path changes and run the upload script, Ref - #237 (comment)

@zeke if we agree onto this, let's add the CROWDIN_KEY to the GitHub secrets

@nschonni
Copy link
Member

Here is a sample action file glossary.yml

name: Upload Crowdin Glossary

on:
  push:
    branches:
    - master
    paths:
    - "crowdin-glossary.json"
    - "script/upload-crowdin-glossary.js"
    - "package.json"
    - "package-lock.json"

jobs:
  checks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
        with:
          node-version: "12.x"

      - name: Cache node modules
        uses: actions/cache@v1
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Install
        run: npm ci

      - name: Upload Glossary
        run: npm run upload-crowdin-glossary

Don't know enough to see where the Key is needed. You can expose a secret as an environment variable like https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#using-encrypted-secrets-in-a-workflow

@maddhruv
Copy link
Contributor

This action looks good to me, just a note - package-lock.json changes would be for dependency upgrade, and package.json for case when we update our node versions here - https://github.com/nodejs/i18n/blob/master/package.json#L5

@nschonni would you love to raise a PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants