@acid-tango/lokalise-downloader 中文文档教程

发布于 3年前 浏览 20 项目主页 更新于 3年前

Lokalise Downloader

GitHub 工作流状态npm麻省理工学院许可证欢迎 PRs

使用 CLI 或以编程方式下载 Lokalise 翻译的实用程序

Installation

将 lokalise-downloader 安装为 npm 模块并将其作为开发依赖项保存到 package.json 文件中:

npm install --save-dev @acid-tango/lokalise-downloader

CLI Usage

lokalise-downloader tag1,tag2,tag3 <apiKey> <projectId>

或者,您可以传递 apiKeyprojectId 通过环境变量:

export LOKALISE_API_KEY <apiKey>
export LOKALISE_PROJECT_ID <projectId>
export LOKALISE_PROJECT_TAGS <tags>

Programatic usage

import { downloadLocalesAsJson } from "@acid-tango/lokalise-downloader"

const apiKey = "<apiKey>"
const projectId = "<projectId>"
const tags = ["api", "frontend"]

const translations = await downloadLocalesAsJson(apiKey, projectId, tags)

console.log(translations)

License

MIT

Lokalise Downloader

GitHub Workflow StatusnpmMIT LicensePRs Welcome

Utility for downloading Lokalise translations either using the CLI or programatically

Installation

Install lokalise-downloader as an npm module and save it to your package.json file as a development dependency:

npm install --save-dev @acid-tango/lokalise-downloader

CLI Usage

lokalise-downloader tag1,tag2,tag3 <apiKey> <projectId>

Alternativelly, you can pass the apiKey and projectId through environment variables:

export LOKALISE_API_KEY <apiKey>
export LOKALISE_PROJECT_ID <projectId>
export LOKALISE_PROJECT_TAGS <tags>

Programatic usage

import { downloadLocalesAsJson } from "@acid-tango/lokalise-downloader"

const apiKey = "<apiKey>"
const projectId = "<projectId>"
const tags = ["api", "frontend"]

const translations = await downloadLocalesAsJson(apiKey, projectId, tags)

console.log(translations)

License

MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文