Lokalise Hello World
Overview
Minimal working example demonstrating core Lokalise functionality: projects, keys, and translations.
Prerequisites
- Completed
lokalise-install-authsetup - Valid API token configured
- At least one Lokalise project (or we'll create one)
Instructions
- 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.