技能 编程开发 Lokalise CI 集成流程

Lokalise CI 集成流程

v20260311
lokalise-ci-integration
在 GitHub Actions CI/CD 中自动处理 Lokalise 翻译流程,包括合并时推送源串、构建前拉取翻译、验证完整性和触发部署 webhook,方便集成本地化管理。
获取技能
119 次下载
概览

Lokalise CI Integration

Overview

Automate translation workflows with Lokalise in CI/CD pipelines. Covers pushing source strings on merge, pulling translations before builds, validating translation completeness, and webhook-triggered deployments.

Prerequisites

  • Lokalise API token stored as GitHub secret
  • Lokalise CLI (@lokalise/cli2) or API SDK
  • GitHub Actions configured
  • Project ID identified

Instructions

  1. For full implementation details, load: Read(${CLAUDE_SKILL_DIR}/references/implementation-guide.md)

Error Handling

Issue Cause Solution
Upload fails Invalid JSON Validate locale files before push
Missing translations Download with empty strings Use --export-empty-as skip
Webhook not triggered Dispatcher not configured Set up Lokalise webhook to GitHub
Wrong file structure Prefix mismatch Use --directory-prefix "" in download

Examples

Local Translation Script

#!/bin/bash
# scripts/lokalise-pull.sh
lokalise2 file download \
  --token "$LOKALISE_API_TOKEN" \
  --project-id "$LOKALISE_PROJECT_ID" \
  --format json \
  --unzip-to "src/locales/"
echo "Translations updated"

Resources

Output

  • Configuration files or code changes applied to the project
  • Validation report confirming correct implementation
  • Summary of changes made and their rationale

See CI/CD implementation details for output format specifications.

信息
Category 编程开发
Name lokalise-ci-integration
版本 v20260311
大小 3.23KB
更新时间 2026-03-12
语言