跳转到主要内容

JupyterLab语言包翻译助手

项目描述

jupyterlab-translate

Linux tests license pypi version conda version Code Style: Black Join the chat at https://gitter.im/jupyterlab/jupyterlab

此包用于生成JupyterLab生态系统中的语言包

此包执行以下在JupyterLab核心和外部扩展中常见的任务

  • *.py*.ts*.tsx文件中的代码中提取字符串。
  • 从JSON模式文件中提取字符串。
  • 创建gettext *.pot目录。
  • 从目录中删除重复的字符串。
  • 为特定语言创建gettext *.po目录。
  • 将目录编译为*.mo*.json格式,以便由JupyterLab前端使用。
  • 提供Hatch构建钩子,在构建wheel时编译目录。
  • 从Crowdin项目更新贡献者列表。

安装

Pip

pip install jupyterlab-translate

您还需要安装nodejs >= 14。

Conda

conda install jupyterlab-translate -c conda-forge

用法

将目录捆绑为语言包的一部分

这是分发您本地化目录的推荐方式。

访问语言包仓库

将目录与包捆绑在一起

jupyterlab-translate extract <JLAB-EXTENSION-DIR> <JLAB-EXTENSION-NAME>
jupyterlab-translate update <JLAB-EXTENSION-DIR> <JLAB-EXTENSION-NAME> -l es_ES
jupyterlab-translate compile <JLAB-EXTENSION-DIR> <JLAB-EXTENSION-NAME>

开发

Typescript提取器

为了从typescript文件中提取可翻译的字符串,此包依赖于gettext-extract。为了简化其安装和使用,该工具通过创建使用@vercel/ncc 编译器的单个JavaScript文件打包到Python包中。

要更新单一代码文件,请参阅发布文件

由以下支持