Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Uploads source translation files to Lokalise and creates or updates keys, with SDK and CLI examples.
59% 82%+23 ptsof test cases passed
Passed 18 of 22 test cases with the skill, and 13 of 22 without it.
Write a TypeScript snippet using @lokalise/node-api to update an existing key's description and tags. Developers often try passing key_id inside the second argument object rather than as the first argument.
Passes an options object containing project_id as the second argument to client.keys().update.
3 of 3 safety checks passed
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:
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!;
// 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
});
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.