번역 확인

번역이 존재하는지 확인하는 방법

소개

리포지토리 구성 방식에 따라 기여자가 번역 프로세스를 우회하거나 번역 파이프라인이 처음부터 트리거되지 않을 수 있습니다.

프로덕션 환경에서 번역을 사용할 수 있도록 보장하려면 배포 프로세스의 일부로 다음 명령을 실행하는 것이 좋습니다.

npx lingo.dev@latest run --frozen

이 명령은 다음을 수행합니다.

  1. 예상되는 모든 콘텐츠가 번역되었는지 확인합니다.
  2. 예상되는 모든 콘텐츠가 번역되지 않은 경우 0이 아닌 상태 코드로 종료합니다.

CI/CD 워크플로 예제

이 섹션에서는 번역 확인을 위한 최소한의 CI/CD 워크플로를 설정하는 방법을 보여줍니다.

Bitbucket Pipelines

다음 구성을 .gitlab-ci.yml 파일에 복사합니다.

check_translations:
  image: node:20-alpine
  script:
    - npx lingo.dev@latest run --frozen

Bitbucket Pipelines 설정에 대한 자세한 내용은 Bitbucket Pipelines를 참조하세요.

GitHub Actions

다음 구성을 .github/workflows/check-translations.yml 파일에 복사합니다.

name: Check translations
on: [push, pull_request]
jobs:
  check_translations:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npx lingo.dev@latest run --frozen

GitHub Actions 설정에 대한 자세한 내용은 GitHub Actions를 참조하세요.

GitLab CI/CD

다음 구성을 bitbucket-pipelines.yml 파일에 복사합니다.

pipelines:
  check_translations:
    - step:
        image: node:20
        script:
          - npx lingo.dev@latest run --frozen

GitLab CI/CD 설정에 대한 자세한 내용은 GitLab CI/CD를 참조하세요.