技能 编程开发 Lokalise 入门示例

Lokalise 入门示例

v20260311
lokalise-hello-world
提供最简 Lokalise 集成示例,展示项目、键与翻译的操作,适合验证配置、入门学习或快速测试 API 流程。
获取技能
442 次下载
概览

Lokalise Hello World

Overview

Minimal working example demonstrating core Lokalise functionality: projects, keys, and translations.

Prerequisites

  • Completed lokalise-install-auth setup
  • Valid API token configured
  • At least one Lokalise project (or we'll create one)

Instructions

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

Output

  • Working TypeScript/JavaScript file with Lokalise client
  • Successfully listed, created projects
  • Added translation keys with multiple languages
  • Retrieved translations

Error Handling

Error Cause Solution
401 Unauthorized Invalid token Check LOKALISE_API_TOKEN
400 Bad Request Invalid project/key params Verify required fields
404 Not Found Project doesn't exist Check project_id
429 Too Many Requests Rate limit hit Wait 1 second, retry

Examples

Using CLI for Quick Test

# List projects
lokalise2 --token $LOKALISE_API_TOKEN project list

# Get project details
lokalise2 --token $LOKALISE_API_TOKEN project --project-id YOUR_PROJECT_ID

# List keys in a project
lokalise2 --token $LOKALISE_API_TOKEN key list --project-id YOUR_PROJECT_ID

Resources

Next Steps

Proceed to lokalise-local-dev-loop for development workflow setup.

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