GitHub Crowdin-handlingen muliggør nem lokaliseringsintegrering af Enterprise-projektet vha. GitHub Actions i den arbejdsgang, der har sat op repo’et. Vha. GitHub Crowdin-handling kan synkning af lokaliseringsressourcer med Crowdin-virksomhedsprojekt automatiseres.
Med denne handling kan flg. ting gøres:
Set up a workflow in .github/workflows/crowdin.yml (or add a job to your existing workflows).
Read the Configuring a workflow article for more details on how to create and set up custom workflows.
name: Crowdin Action
on:
push:
branches: [ master ]
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: crowdin action
uses: crowdin/github-action@1.0.4
with:
upload_translations: true
download_translations: true
env:
GITHUB_TOKEN: $
CROWDIN_PROJECT_ID: $
CROWDIN_PERSONAL_TOKEN: $
The default action is to upload sources. Though, you can set different actions through the with
options. Ønskes kilder ikke uploadet til Enterprise, så sæt blot indstillingen upload_sources
til false.
Som standard uploades kilder og oversættelser til roden af Enterprise-projekt. Still, if you use branches, you can set the preferred source branch.
You can also specify what GitHub branch you’d like to download your translations to (default translation branch is l10n_crowdin_action
).
Ønskes oversættelser ikke downloadet fra Enterprise, er indstillingerne (download_translations: false
), localization_branch_name
og create_pull_request
heller ikke nødvendige.
- name: crowdin action
with:
# upload-muligheder
upload_sources: true
upload_translations: true
# download-muligheder
download_translations: true
language: 'uk'
push_translations: true
# Dette er navnet på den Git-gren, som Enterprise opretter, når en pull request åbnes.
# This branch does NOT need to be manually created. It will be created automatically by the action.
localization_branch_name: l10n_crowdin_action
create_pull_request: true
# globale muligheder
# Dette er navnet på den topniveaumappe, som Enterprise benytter til filer.
# Bemærk, at dette ikke er en "gren" i Git-forstand, men mere en type topniveaumappe i Enterprise-projektet.
# This branch does NOT need to be manually created. It will be created automatically by the action.
crowdin_branch_name: l10n_branch
identitet: '/path/to/your/credentials/file'
config: '/path/to/din/crowdin. ml'
dryrun_action: true
# opsætningsmuligheder
# Dette er et numerisk projekt-ID
# Åbn et projekt og se "Crowdin-API" i Ressourcer > Integrationer & API
project_id: $
# Dette er et personligt adgangstoken
# Åbn et projekt og se "Crowdin-API" i Ressourcer > Integrationer & API > Opret token
token: $
source: '/path/to/to/your/file'
translation: 'file/export/pattern'
base_url: 'https://crowdin. om'
base_path: '/project-base-path'
For more detailed descriptions of these options, see action.yml
.
Indeholder arbejdsgangsfilen config
-egenskaben, skal flg. føjes til Enterprise-opsætningsfilen (f. eks. crowdin.yml
):
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
When the workflow runs, the real values of your token and project ID will be injected into the config using the secrets in the environment.