Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Execute Lokalise primary workflow: Upload source files and manage translation keys. Use when uploading translation files, creating/updating keys, or managing source strings in Lokalise projects. Trigger with phrases like "lokalise upload", "lokalise push keys", "lokalise source strings", "add translations to lokalise".
.claude/skills/jeremylongshore-lokalise-core-workflow-a/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 96% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 108% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 167% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 206% | 0% |
Primary workflow covering the "source to Lokalise" direction: upload translation files, create and update keys programmatically, tag keys for organization, and perform bulk operations. Both SDK and CLI approaches shown for every operation.
LOKALISE_API_TOKENLOKALISE_PROJECT_ID@lokalise/node-api installed for SDK exampleslokalise2 CLI installed for CLI examplesSDK — Base64 encode and upload:
typescriptimport { LokaliseApi } from "@lokalise/node-api"; import { readFileSync } from "node:fs"; const client = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! }); const PROJECT_ID = process.env.LOKALISE_PROJECT_ID!; // Read and base64-encode the source file const fileContent = readFileSync("./locales/en.json"); const base64Data = fileContent.toString("base64"); const uploadProcess = await client.files().upload(PROJECT_ID, { data: base64Data, filename: "en.json", lang_iso: "en", replace_modified: true, // Overwrite changed translations distinguish_by_file: true, // Same key names in different files stay separate tags: ["source", "v2.1"], // Auto-tag uploaded keys }); console.log(`Upload queued: process ${uploadProcess.process_id}, status: ${uploadProcess.status}`);
SDK — Poll upload process until complete:
typescriptasync function waitForUpload( client: LokaliseApi, projectId: string, processId: string, maxWaitMs = 60_000 ): Promise<void> { const start = Date.now(); while (Date.now() - start < maxWaitMs) { const proc = await client.queuedProcesses().get(processId, { project_id: projectId }); console.log(` Process ${processId}: ${proc.status}`); if (proc.status === "finished") return; if (proc.status === "cancelled" || proc.status === "failed") { throw new Error(`Upload ${proc.status}: ${JSON.stringify(proc.details)}`); } await new Promise((r) => setTimeout(r, 1000)); } throw new Error(`Upload timed out after ${maxWaitMs}ms`); } await waitForUpload(client, PROJECT_ID, uploadProcess.process_id); console.log("Upload complete");
CLI — Upload with polling:
bashset -euo pipefail lokalise2 --token "$LOKALISE_API_TOKEN" file upload \ --project-id "$LOKALISE_PROJECT_ID" \ --file ./locales/en.json \ --lang-iso en \ --replace-modified \ --distinguish-by-file \ --tag-inserted-keys \ --tag-updated-keys \ --tags "source,v2.1" \ --poll # Waits for process to finish
SDK — Create keys with initial translations:
typescriptconst newKeys = await client.keys().create({ project_id: PROJECT_ID, keys: [ { key_name: { web: "onboarding.step1.title" }, platforms: ["web"], description: "First step of onboarding wizard", tags: ["onboarding", "v2.1"], translations: [ { language_iso: "en", translation: "Welcome aboard!" }, ], }, { key_name: { web: "onboarding.step1.body" }, platforms: ["web"], description: "Body text for onboarding step 1", tags: ["onboarding", "v2.1"], translations: [ { language_iso: "en", translation: "Let's get you set up in just a few steps." }, ], }, { key_name: { web: "errors.network_timeout" }, platforms: ["web"], description: "Shown when API call times out", is_hidden: false, tags: ["errors"], translations: [ { language_iso: "en", translation: "Connection timed out. Please try again." }, ], }, ], }); console.log(`Created ${newKeys.items.length} keys`); for (const k of newKeys.items) { console.log(` ${k.key_id}: ${k.key_name.web}`); }
SDK — Update existing keys:
typescriptconst updatedKey = await client.keys().update(KEY_ID, { project_id: PROJECT_ID, description: "Updated description", tags: ["onboarding", "v2.2", "reviewed"], is_hidden: false, });
SDK — Add tags to existing keys (bulk):
typescript// List keys by an existing tag const v21Keys = await client.keys().list({ project_id: PROJECT_ID, filter_tags: "v2.1", limit: 500, }); // Bulk-update: add a new tag to all of them const keyIds = v21Keys.items.map((k) => k.key_id); const updated = await client.keys().bulk_update({ project_id: PROJECT_ID, keys: keyIds.map((id) => ({ key_id: id, tags: ["v2.1", "ready-for-review"], // Full tag list (replaces existing) })), }); console.log(`Tagged ${updated.items.length} keys with 'ready-for-review'`);
SDK — Filter keys by tag:
typescriptconst errorKeys = await client.keys().list({ project_id: PROJECT_ID, filter_tags: "errors", include_translations: 1, limit: 100, }); for (const k of errorKeys.items) { const en = k.translations.find( (t: { language_iso: string }) => t.language_iso === "en" ); console.log(`${k.key_name.web}: ${en?.translation ?? "(empty)"}`); }
SDK — Bulk delete keys:
typescript// Delete keys that are no longer in the codebase const obsoleteKeys = await client.keys().list({ project_id: PROJECT_ID, filter_tags: "deprecated", limit: 500, }); if (obsoleteKeys.items.length > 0) { const deleteIds = obsoleteKeys.items.map((k) => k.key_id); const result = await client.keys().bulk_delete(deleteIds, { project_id: PROJECT_ID, }); console.log(`Deleted ${result.keys_removed} keys`); }
SDK — Bulk update translations:
typescript// Mark all translations for a tag as "needs review" by clearing is_reviewed const keysToReview = await client.keys().list({ project_id: PROJECT_ID, filter_tags: "v2.2", include_translations: 1, limit: 500, }); for (const key of keysToReview.items) { for (const t of key.translations) { if (t.is_reviewed) { await client.translations().update(t.translation_id, { project_id: PROJECT_ID, is_reviewed: false, }); } } }
CLI — Bulk operations:
bashset -euo pipefail # Upload multiple files in sequence (respect rate limits) for lang in en fr de es ja; do lokalise2 --token "$LOKALISE_API_TOKEN" file upload \ --project-id "$LOKALISE_PROJECT_ID" \ --file "./locales/${lang}.json" \ --lang-iso "$lang" \ --replace-modified \ --poll echo "Uploaded ${lang}.json" sleep 1 # Rate limit buffer done # Upload with cleanup mode (removes keys not present in file) lokalise2 --token "$LOKALISE_API_TOKEN" file upload \ --project-id "$LOKALISE_PROJECT_ID" \ --file ./locales/en.json \ --lang-iso en \ --cleanup-mode \ --poll
| Error | Cause | Solution | |-------|-------|----------| | 400 Invalid file format | File extension or content not recognized | Verify format is in the supported formats list (see Resources) | | 400 Key already exists | Duplicate key_name + platform combo | Set replace_modified: true or use unique key names | | 413 Payload Too Large | Base64 payload exceeds 50MB | Split file or remove unused keys | | 429 Too Many Requests | Exceeded 6 req/sec | Add 170ms minimum delay between calls | | Process status: failed | Invalid file content or encoding | Check file is valid JSON/XLIFF/PO and base64 encoding is correct | | 400 keys must be an array | Wrong payload shape for bulk ops | Wrap keys in an array even for single-key operations |
typescript// ci-upload.ts — extract keys from code and push to Lokalise import { LokaliseApi } from "@lokalise/node-api"; import { readFileSync } from "node:fs"; const client = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! }); const PROJECT_ID = process.env.LOKALISE_PROJECT_ID!; // Upload the extracted source file const data = readFileSync("./locales/en.json").toString("base64"); const proc = await client.files().upload(PROJECT_ID, { data, filename: "en.json", lang_iso: "en", replace_modified: true, cleanup_mode: true, // Remove keys not in this file tags: [`build-${process.env.CI_BUILD_NUMBER ?? "local"}`], }); // Wait for completion let status = proc.status; while (status === "queued" || status === "running") { await new Promise((r) => setTimeout(r, 2000)); const check = await client.queuedProcesses().get(proc.process_id, { project_id: PROJECT_ID, }); status = check.status; } if (status !== "finished") { console.error(`Upload failed with status: ${status}`); process.exit(1); } console.log("Source strings synced to Lokalise");
bashset -euo pipefail # Tag all untagged keys with the current release lokalise2 --token "$LOKALISE_API_TOKEN" key list \ --project-id "$LOKALISE_PROJECT_ID" \ --filter-tags "" \ --limit 500 | jq -r '.[].key_id' | while read -r key_id; do lokalise2 --token "$LOKALISE_API_TOKEN" key update \ --project-id "$LOKALISE_PROJECT_ID" \ --key-id "$key_id" \ --tags "release-3.0" sleep 0.2 done
For downloading translations and managing contributors, see lokalise-core-workflow-b.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,631 | 14,172 | -34% | 1 | 1 | 0% | 2,636 | 5,156 | +96% | 0 | 0 | — |
case-02 | pass→pass | 14,767 | 11,878 | -20% | 1 | 1 | 0% | 1,983 | 4,563 | +130% | 0 | 0 | — |
case-03 | pass→pass | 17,955 | 21,627 | +20% | 1 | 1 | 0% | 2,634 | 5,864 | +123% | 0 | 0 | — |
case-04 | pass→pass | 20,204 | 15,655 | -23% | 1 | 1 | 0% | 2,717 | 5,320 | +96% | 0 | 0 | — |
case-05 | pass→pass | 13,449 | 11,187 | -17% | 1 | 1 | 0% | 1,669 | 4,334 | +160% | 0 | 0 | — |
case-06 | pass→pass | 16,746 | 15,867 | -5% | 1 | 1 | 0% | 2,136 | 5,390 | +152% | 0 | 0 | — |
case-07 | fail→pass | 15,219 | 10,179 | -33% | 1 | 1 | 0% | 2,004 | 4,174 | +108% | 0 | 0 | — |
case-08 | fail→pass | 13,307 | 11,583 | -13% | 1 | 1 | 0% | 1,665 | 4,448 | +167% | 0 | 0 | — |
case-09 | pass→pass | 19,491 | 12,405 | -36% | 1 | 1 | 0% | 2,943 | 4,606 | +57% | 0 | 0 | — |
case-10 | pass→pass | 12,536 | 10,896 | -13% | 1 | 1 | 0% | 1,501 | 4,213 | +181% | 0 | 0 | — |
case-11 | pass→pass | 17,493 | 9,916 | -43% | 1 | 1 | 0% | 1,808 | 4,179 | +131% | 0 | 0 | — |
case-12 | pass→pass | 12,899 | 7,808 | -39% | 1 | 1 | 0% | 1,657 | 4,706 | +184% | 0 | 0 | — |
case-13 | pass→pass | 18,165 | 17,023 | -6% | 1 | 1 | 0% | 2,720 | 5,494 | +102% | 0 | 0 | — |
case-14 | pass→pass | 9,952 | 10,537 | +6% | 1 | 1 | 0% | 1,489 | 4,251 | +185% | 0 | 0 | — |
case-15 | pass→pass | 14,686 | 17,402 | +18% | 1 | 1 | 0% | 1,957 | 4,999 | +155% | 0 | 0 | — |
case-16 | pass→pass | 26,981 | 17,459 | -35% | 1 | 1 | 0% | 3,230 | 5,900 | +83% | 0 | 0 | — |
case-17 | fail→fail | 14,208 | 28,934 | +104% | 1 | 1 | 0% | 2,623 | 5,645 | +115% | 0 | 0 | — |
case-18 | fail→pass | 38,998 | 9,488 | -76% | 1 | 1 | 0% | 6,411 | 5,178 | -19% | 0 | 0 | — |
case-19 | fail→pass | 12,636 | 17,474 | +38% | 1 | 1 | 0% | 1,681 | 5,143 | +206% | 0 | 0 | — |
case-20 | fail→fail | 13,485 | 16,259 | +21% | 1 | 1 | 0% | 2,487 | 5,753 | +131% | 0 | 0 | — |
case-21 | fail→fail | 19,053 | 13,009 | -32% | 1 | 1 | 0% | 2,107 | 5,792 | +175% | 0 | 0 | — |
case-22 | fail→fail | 17,722 | 13,884 | -22% | 1 | 1 | 0% | 1,953 | 5,083 | +160% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.