Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@lokalise/node-api
Advanced tools
Lokalise lets you manage translations of your app, game or website – either on your own or with a team of collaborators.
Lokalise API documentation
npm install @lokalise/node-api
const { LokaliseApi } = require('@lokalise/node-api');
const lokaliseApi = new LokaliseApi({ apiKey: '<apiKey>'});
const projects = await lokaliseApi.projects.list();
Every request returns a promise with a corresponding object (or array of objects) as the result.
Table of Contents generated with DocToc
Parameters page or limit are optional.
lokaliseApi.projects.list({ page: 1, limit: 1000 });
lokaliseApi.projects.create({ name: "Project name", description: "Project description" });
lokaliseApi.projects.delete(projectId);
lokaliseApi.projects.update(<projectId>, { name: "New name", description: "New description"});
You should pass projectId as a parameter.
lokaliseApi.comments.list_project_comments({ project_id: <projectId>});
You should pass projectId and keyId as parameters.
lokaliseApi.comments.list_project_comments({ project_id: <projectId>, key_id: <keyId>});
You should pass commentId, projectId and keyId as parameters.
lokaliseApi.comments.get(<commentId>, { project_id: <projectId>, key_id: <keyId>});
Returns promise array of comments.
lokaliseApi.comments.create({
'comments': [
{ comment: "Project comment 1" },
{ comment: "Project comment 2" }
],
{ project_id: '<projectId>', key_id: '<keyId>'});
lokaliseApi.comments.delete(<commentId>, { project_id: <projectId>, key_id: <keyId> });
You should pass projectId as a parameter.
lokaliseApi.contributors.list({ project_id: <projectId> });
You should pass contributorId and projectId as parameters.
lokaliseApi.contributors.get(<contributorId>, { project_id: <projectId> });
You should pass contributors object and projectId as parameters.
lokaliseApi.contributors.get({
"contributors": [
{
"email": "translator@mycompany.com",
"fullname": "Mr. Translator",
"is_admin": false,
"is_reviewer": true,
"languages": [
{
"lang_iso": "en",
"is_writable": false
},
{
"lang_iso": "ru",
"is_writable": true
}
],
"admin_rights": [
"keys", "languages"
]
}
]
},
{ project_id: <projectId>, key_id: <key_id>});
You should pass contributorId and projectId as parameters.
lokaliseApi.contributors.delete(<contributorId>, {project_id: <projectId>});
Parameters page or limit are optional.
lokaliseApi.files.list({ project_id: <projectId>, page: 1, limit: 1000 });
lokaliseApi.files.upload(<projectId>, {
"filename": "index.json",
"data": "D94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGL.....",
"lang_iso": "en",
"tags": [
"index", "admin", "v2.0"
],
"convert_placeholders": true
}
});
lokaliseApi.files.download(<projectId>, {
"format": "json",
"original_filenames": true
});
Params page and limit are optional.
lokaliseApi.files.list({ project_id: <projectId>, page: 1, limit: 1000 });
lokaliseApi.files.upload(<projectId>, {
"filename": "index.json",
"data": "D94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGL.....",
"lang_iso": "en",
"tags": [
"index", "admin", "v2.0"
],
"convert_placeholders": true
}
});
lokaliseApi.files.download(<projectId>, {
"format": "json",
"original_filenames": true
});
lokaliseApi.keys.list({project_id: <projectId>, page: 1, limit: 1})
lokaliseApi.keys.create({
"keys": [
{
"key_name": "index.welcome",
"description": "Index app welcome",
"platforms": [
"web"
],
"translations": [
{
"language_iso": "en",
"translation": "Welcome"
}
]
},
{
"key_name": "index.apple",
"description": "Welcome apple",
"platforms": [
"web"
],
"is_plural": true,
"translations": [
{
"language_iso": "en",
"translation": {
"one": "I have one apple",
"other": "I have a lot of apples"
}
}
]
},
{
"key_name": "index.hello",
"platforms": [
"web"
]
}
]
},
{project_id: <projectId, page: 1, limit: 1>});
lokaliseApi.keys.update(<keyId>, {
"platforms": [
"web","other"
],
"description": "Index app welcome"
},
{ project_id: <projectId> });
lokaliseApi.keys.bulk_update({
"keys": [
{
"key_id": 331223,
"key_name": "index.welcome",
"description": "Index app welcome",
"platforms": [
"web"
]
},
{
"key_id": 331224,
"key_name": "index.hello",
"description": "Index greetings",
"platforms": [
"web"
]
}
]
}, { project_id: <projectId>});
lokaliseApi.keys.delete(<keyId>, { project_id: <projectId> });
lokaliseApi.keys.bulk_delete({
"keys": [
12345, 12346
]
}, { project_id: <projectId> });
lokaliseApi.languages.system_languages({page: 1, limit: 10000})
lokaliseApi.languages.list({project_id: <projectId>});
lokaliseApi.languages.create({
"languages": [
{
"lang_iso": "en"
},
{
"lang_iso": "ru"
}
]},
{ project_id: <projectId> });
lokaliseApi.languages.get(<languageId>, { project_id: <projectId> });
lokaliseApi.languages.update(<languageId>, {
"lang_iso": "en-US",
"plural_forms": [
"one", "zero", "few", "other"
]
}, {project_id: <projectId>});
lokaliseApi.languages.delete(<languageId>, { project_id: <projectId> });
lokaliseApi.screenshots.list({project_id: <projectId>});
lokaliseApi.screenshots.create({
"screenshots": [
{
"data": "data:image/jpeg;base64,D94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGL.....",
"ocr": false,
"key_ids": [
1132290, 1132292, 1132293
],
"tags": [
"onboarding"
]
}
]
}, {project_id: <projectId>});
lokaliseApi.screenshots.get(<screenshotId>, {project_id: <projectId>});
lokaliseApi.screenshots.update(<screenshotId>, {
"key_ids": [
1132290, 1132292
],
"tags": [
"main"
]
}, {project_id: <projectId>});
lokaliseApi.screenshots.delete(<screenshotId>, { project_id: <projectId> });
lokaliseApi.snapshots.list({project_id: <projectId>});
lokaliseApi.snapshots.create({ "title": "API snapshot" }, {project_id: <projectId>});
lokaliseApi.snapshots.restore({ project_id: <projectId>, id: <snapshotId>});
lokaliseApi.snapshots.delete({ project_id: <projectId>, id: <snapshotId>});
lokaliseApi.tasks.list({project_id: <projectId>});
lokaliseApi.tasks.create({
"title": "Voicemail messages",
"description": "Need your help with some voicemail message translation. Thanks!",
"due_date": "2018-12-31 12:00:00 (Etc\/UTC)",
"keys": [
11212, 11241, 11245
],
"languages": [
{
"language_iso": "fi",
"users": [
421
]
},
{
"language_iso": "ru",
"groups": [
191
]
}
],
"auto_close_languages": true,
"auto_close_task": true,
"task_type": "translation",
"parent_task_id": 12345,
"closing_tags": ["tag_one", "tag_two"],
"do_lock_translations": true
}, {project_id: <projectId>});
lokaliseApi.tasks.get(<taskId>, { project_id: <projectId> });
lokaliseApi.tasks.delete(<taskId>, { project_id: <projectId>});
lokaliseApi.teams.list({ page 1, limit: 10000 });
lokaliseApi.team_users.list({project_id: <projectId>});
lokaliseApi.team_users.get(<teamUserId>, { project_id: <projectId> });
lokaliseApi.team_users.update(<teamUserId>, { "role": "admin" },
{ project_id: <projectId> });
lokaliseApi.team_users.delete(<teamUserId>, { project_id: <projectId> });
lokaliseApi.user_groups.list({ team_id: <teamId> });
lokaliseApi.user_groups.create({
"name": "Proofreaders",
"is_reviewer": true,
"is_admin": false,
"admin_rights": [],
"languages": {
"reference": [],
"contributable": [640]
}
}, { team_id: <teamId> });
lokaliseApi.user_groups.get(<groupId>, { team_id: <teamId> });
lokaliseApi.user_groups.add_project_to_group(<teamId>, <groupId>, {
"projects": [
"598901215bexxx43dcba74.xxx"
]
});
lokaliseApi.user_groups.remove_project_from_group(<teamId>, <groupId>, {
"projects": [
"598901215bexxx43dcba74.xxx"
]
});
FAQs
Official Lokalise API 2.0 Node.js client
The npm package @lokalise/node-api receives a total of 131,640 weekly downloads. As such, @lokalise/node-api popularity was classified as popular.
We found that @lokalise/node-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.