lokalise-core-workflow-b
Manage Lokalise secondary workflow: Download translations and integrate with app. Use when downloading translation files, exporting translations, or integrating Lokalise output into your application. Trigger with phrases like "lokalise download", "lokalise pull translations", "export lokalise", "get translations from lokalise".
Best use case
lokalise-core-workflow-b is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Manage Lokalise secondary workflow: Download translations and integrate with app. Use when downloading translation files, exporting translations, or integrating Lokalise output into your application. Trigger with phrases like "lokalise download", "lokalise pull translations", "export lokalise", "get translations from lokalise".
Teams using lokalise-core-workflow-b should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/lokalise-core-workflow-b/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How lokalise-core-workflow-b Compares
| Feature / Agent | lokalise-core-workflow-b | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Manage Lokalise secondary workflow: Download translations and integrate with app. Use when downloading translation files, exporting translations, or integrating Lokalise output into your application. Trigger with phrases like "lokalise download", "lokalise pull translations", "export lokalise", "get translations from lokalise".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Lokalise Core Workflow B
## Overview
Everything on the "Lokalise to app" side: download translated files, manage translations and review status, leverage translation memory, manage contributors and their language access, and handle format differences across JSON, XLIFF, and PO files.
## Prerequisites
- Lokalise API token exported as `LOKALISE_API_TOKEN`
- Lokalise project ID exported as `LOKALISE_PROJECT_ID`
- `@lokalise/node-api` installed for SDK examples
- `lokalise2` CLI installed for CLI examples
- `unzip` available for extracting download bundles
## Instructions
1. Download translated files. The download endpoint returns an S3 URL to a zip bundle — request the bundle, download the zip, then extract.
**SDK — Download and extract:**
```typescript
import { LokaliseApi } from "@lokalise/node-api";
import { execSync } from "node:child_process";
import { mkdirSync } from "node:fs";
const client = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! });
const PROJECT_ID = process.env.LOKALISE_PROJECT_ID!;
// Request the download bundle
const download = await client.files().download(PROJECT_ID, {
format: "json",
original_filenames: false,
bundle_structure: "%LANG_ISO%.json", // Output: en.json, fr.json, de.json
filter_langs: ["en", "fr", "de", "es"], // Only these languages
export_empty_as: "base", // Use base language for empty translations
include_tags: ["release-3.0"], // Only keys with this tag
replace_breaks: false,
});
const bundleUrl = download.bundle_url;
console.log(`Bundle URL: ${bundleUrl}`);
// Download and extract
mkdirSync("./locales", { recursive: true });
execSync(`curl -sL "${bundleUrl}" -o /tmp/lokalise-bundle.zip`);
execSync(`unzip -o /tmp/lokalise-bundle.zip -d ./locales`);
console.log("Translations extracted to ./locales/");
```
**CLI — Download with structure:**
```bash
set -euo pipefail
lokalise2 --token "$LOKALISE_API_TOKEN" file download \
--project-id "$LOKALISE_PROJECT_ID" \
--format json \
--original-filenames=false \
--bundle-structure "locales/%LANG_ISO%.json" \
--filter-langs "en,fr,de,es" \
--export-empty-as base \
--replace-breaks=false \
--unzip-to .
```
**SDK — Download with original file structure preserved:**
```typescript
const download = await client.files().download(PROJECT_ID, {
format: "json",
original_filenames: true,
directory_prefix: "", // No extra prefix
export_empty_as: "skip", // Omit untranslated keys
include_comments: false,
include_description: false,
});
```
2. Manage translations — list, update, and mark as reviewed.
**SDK — List translations for a language:**
```typescript
const frTranslations = await client.translations().list({
project_id: PROJECT_ID,
filter_lang_id: 673, // Language ID for French (find via languages endpoint)
filter_is_reviewed: 0, // Only unreviewed
limit: 100,
});
for (const t of frTranslations.items) {
console.log(`[${t.key_id}] ${t.translation} (reviewed: ${t.is_reviewed})`);
}
```
**SDK — Update a translation:**
```typescript
const updated = await client.translations().update(TRANSLATION_ID, {
project_id: PROJECT_ID,
translation: "Nouvelle traduction",
is_reviewed: false, // Mark as needing review after edit
});
```
**SDK — Mark translations as reviewed (batch):**
```typescript
const unreviewed = await client.translations().list({
project_id: PROJECT_ID,
filter_lang_id: LANG_ID,
filter_is_reviewed: 0,
limit: 500,
});
for (const t of unreviewed.items) {
await client.translations().update(t.translation_id, {
project_id: PROJECT_ID,
is_reviewed: true,
});
}
console.log(`Marked ${unreviewed.items.length} translations as reviewed`);
```
**SDK — List translations with cursor pagination (for large datasets):**
```typescript
async function* paginateTranslations(
client: LokaliseApi,
projectId: string,
langId: number
) {
let cursor: string | undefined;
do {
const params: Record<string, unknown> = {
project_id: projectId,
filter_lang_id: langId,
limit: 500,
};
if (cursor) params.cursor = cursor;
const page = await client.translations().list(params);
yield* page.items;
cursor = page.hasNextCursor() ? page.nextCursor() : undefined;
} while (cursor);
}
// Usage
for await (const t of paginateTranslations(client, PROJECT_ID, 673)) {
console.log(`${t.key_id}: ${t.translation}`);
}
```
3. Leverage translation memory (TM) for auto-suggestions based on previously translated segments.
**SDK — Use TM during upload:**
```typescript
const tmResults = await client.translationProviders().list({
team_id: TEAM_ID,
});
// TM is automatically applied during file upload when `use_automations: true`
const upload = await client.files().upload(PROJECT_ID, {
data: base64Data,
filename: "en.json",
lang_iso: "en",
use_automations: true, // Apply TM and MT suggestions automatically
slashn_to_linebreak: true,
});
```
**SDK — Leverage TM during download (pre-translate empty keys):**
```typescript
// Pre-translate uses TM + MT before download
// First, trigger pre-translation
// Then download with filled translations
const download = await client.files().download(PROJECT_ID, {
format: "json",
original_filenames: false,
bundle_structure: "%LANG_ISO%.json",
export_empty_as: "base", // Fallback to base language if TM has no match
});
```
4. Manage contributors — add translators and configure language access.
**SDK — Add a translator with specific language access:**
```typescript
const contributor = await client.contributors().create({
project_id: PROJECT_ID,
contributors: [
{
email: "translator@example.com",
fullname: "Marie Dupont",
is_admin: false,
is_reviewer: true,
languages: [
{
lang_iso: "fr",
is_writable: true, // Can edit French translations
},
{
lang_iso: "de",
is_writable: false, // Read-only access to German
},
],
},
],
});
console.log(`Added contributor: ${contributor.items[0].email}`);
```
**SDK — List all contributors:**
```typescript
const contributors = await client.contributors().list({
project_id: PROJECT_ID,
limit: 100,
});
for (const c of contributors.items) {
const langs = c.languages.map(
(l: { lang_iso: string; is_writable: boolean }) =>
`${l.lang_iso}${l.is_writable ? "(rw)" : "(r)"}`
).join(", ");
console.log(`${c.fullname} <${c.email}> — ${langs}`);
}
```
**SDK — Update contributor permissions:**
```typescript
await client.contributors().update(CONTRIBUTOR_ID, {
project_id: PROJECT_ID,
is_reviewer: true,
languages: [
{ lang_iso: "fr", is_writable: true },
{ lang_iso: "es", is_writable: true }, // Grant Spanish write access
],
});
```
5. Handle file format differences across JSON flat, JSON nested, XLIFF, and PO.
**JSON flat (react-i18next default):**
```json
{
"greeting.hello": "Hello",
"greeting.goodbye": "Goodbye",
"errors.network": "Network error"
}
```
Download config:
```typescript
const download = await client.files().download(PROJECT_ID, {
format: "json",
json_unescaped_slashes: true,
original_filenames: false,
bundle_structure: "%LANG_ISO%.json",
placeholder_format: "icu", // {name} style
export_sort: "a_z",
});
```
**JSON nested (next-intl, vue-i18n):**
```json
{
"greeting": {
"hello": "Hello",
"goodbye": "Goodbye"
},
"errors": {
"network": "Network error"
}
}
```
Download config — use `_` as key separator so Lokalise nests on `.`:
```bash
set -euo pipefail
lokalise2 --token "$LOKALISE_API_TOKEN" file download \
--project-id "$LOKALISE_PROJECT_ID" \
--format json \
--original-filenames=false \
--bundle-structure "%LANG_ISO%.json" \
--export-key-name-as "key_name_dot_separated" \
--unzip-to ./locales
```
**XLIFF 1.2 (iOS, Angular):**
```typescript
const download = await client.files().download(PROJECT_ID, {
format: "xliff",
original_filenames: false,
bundle_structure: "%LANG_ISO%.xliff",
export_empty_as: "empty",
});
```
**PO / GNU gettext:**
```bash
set -euo pipefail
lokalise2 --token "$LOKALISE_API_TOKEN" file download \
--project-id "$LOKALISE_PROJECT_ID" \
--format po \
--original-filenames=false \
--bundle-structure "%LANG_ISO%/LC_MESSAGES/messages.po" \
--unzip-to ./locales
```
**Upload format auto-detection:**
```typescript
// Lokalise detects format from filename extension
// Just make sure the filename matches the content format
await client.files().upload(PROJECT_ID, {
data: base64Data,
filename: "messages.xliff", // Triggers XLIFF parser
lang_iso: "en",
});
```
## Output
- Downloaded translation files extracted to project directory
- Translations updated and review status managed
- Contributors added with appropriate language permissions
- Files exported in the correct format for your i18n framework
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| `404 Project not found` | Wrong `project_id` | Run `client.projects().list()` to verify |
| `Empty bundle (0 files)` | No translations match filters | Remove `include_tags` / `filter_langs` to broaden |
| `400 Invalid format` | Unsupported export format string | Use: `json`, `xliff`, `po`, `strings`, `xml`, `yaml` |
| `Download timeout` | Large project with many languages | Filter to specific languages with `filter_langs` |
| `403 Forbidden` | Contributor lacks write access | Check contributor language permissions |
| `curl: (28) Operation timed out` | S3 bundle URL expired (valid ~30 min) | Request a fresh download URL |
## Examples
### Build-Time Translation Fetch
```typescript
// scripts/fetch-translations.ts — run in CI before build
import { LokaliseApi } from "@lokalise/node-api";
import { execSync } from "node:child_process";
import { mkdirSync, readdirSync } from "node:fs";
const client = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! });
const PROJECT_ID = process.env.LOKALISE_PROJECT_ID!;
const download = await client.files().download(PROJECT_ID, {
format: "json",
original_filenames: false,
bundle_structure: "%LANG_ISO%.json",
export_empty_as: "base",
export_sort: "a_z",
replace_breaks: false,
});
mkdirSync("./src/locales", { recursive: true });
execSync(`curl -sL "${download.bundle_url}" -o /tmp/i18n.zip`);
execSync("unzip -o /tmp/i18n.zip -d ./src/locales");
const files = readdirSync("./src/locales").filter((f) => f.endsWith(".json"));
console.log(`Downloaded ${files.length} locale files: ${files.join(", ")}`);
```
### Contributor Onboarding Script
```typescript
const translators = [
{ email: "hans@example.com", name: "Hans Mueller", langs: ["de"] },
{ email: "yuki@example.com", name: "Yuki Tanaka", langs: ["ja"] },
{ email: "ana@example.com", name: "Ana Garcia", langs: ["es", "pt"] },
];
for (const t of translators) {
await client.contributors().create({
project_id: PROJECT_ID,
contributors: [{
email: t.email,
fullname: t.name,
is_admin: false,
is_reviewer: false,
languages: t.langs.map((l) => ({ lang_iso: l, is_writable: true })),
}],
});
console.log(`Invited ${t.name} for ${t.langs.join(", ")}`);
}
```
## Resources
- [File Download API](https://developers.lokalise.com/reference/download-files)
- [Translations API](https://developers.lokalise.com/reference/list-all-translations)
- [Contributors API](https://developers.lokalise.com/reference/list-all-contributors)
- [Export Options Reference](https://docs.lokalise.com/en/articles/1400465-exporting-translation-files)
- [Bundle Structure Placeholders](https://docs.lokalise.com/en/articles/2281317-filenames)
- [Supported File Formats](https://docs.lokalise.com/en/articles/1400492-uploading-translation-files)
## Next Steps
For common errors and troubleshooting, see `lokalise-common-errors`. For production SDK patterns, see `lokalise-sdk-patterns`.Related Skills
calendar-to-workflow
Converts calendar events and schedules into Claude Code workflows, meeting prep documents, and standup notes. Use when the user mentions calendar events, meeting prep, standup generation, or scheduling workflows. Trigger with phrases like "prep for my meetings", "generate standup notes", "create workflow from calendar", or "summarize today's schedule".
workhuman-core-workflow-b
Workhuman core workflow b for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman core workflow b".
workhuman-core-workflow-a
Workhuman core workflow a for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman core workflow a".
wispr-core-workflow-b
Wispr Flow core workflow b for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr core workflow b".
wispr-core-workflow-a
Wispr Flow core workflow a for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr core workflow a".
windsurf-core-workflow-b
Execute Windsurf's secondary workflow: Workflows, Memories, and reusable automation. Use when creating reusable Cascade workflows, managing persistent memories, or automating repetitive development tasks. Trigger with phrases like "windsurf workflow", "windsurf automation", "windsurf memories", "cascade workflow", "windsurf slash command".
windsurf-core-workflow-a
Execute Windsurf's primary workflow: Cascade Write mode for multi-file agentic coding. Use when building features, refactoring across files, or performing complex code tasks. Trigger with phrases like "windsurf cascade write", "windsurf agentic coding", "windsurf multi-file edit", "cascade write mode", "windsurf build feature".
webflow-core-workflow-b
Execute Webflow secondary workflows — Sites management, Pages API, Forms submissions, Ecommerce (products/orders/inventory), and Custom Code via the Data API v2. Use when managing sites, reading pages, handling form data, or working with Webflow Ecommerce products and orders. Trigger with phrases like "webflow sites", "webflow pages", "webflow forms", "webflow ecommerce", "webflow products", "webflow orders".
webflow-core-workflow-a
Execute the primary Webflow workflow — CMS content management: list collections, CRUD items, publish items, and manage content lifecycle via the Data API v2. Use when working with Webflow CMS collections and items, managing blog posts, team members, or any dynamic content. Trigger with phrases like "webflow CMS", "webflow collections", "webflow items", "create webflow content", "manage webflow CMS", "webflow content management".
veeva-core-workflow-b
Veeva Vault core workflow b for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva core workflow b".
veeva-core-workflow-a
Veeva Vault core workflow a for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva core workflow a".
vastai-core-workflow-b
Execute Vast.ai secondary workflow: multi-instance orchestration, spot recovery, and cost optimization. Use when running distributed training, handling spot preemption, or optimizing GPU spend across multiple instances. Trigger with phrases like "vastai distributed training", "vastai spot recovery", "vastai multi-gpu", "vastai cost optimization".