This package is used to generate language packs for the JupyterLab ecosystem.
This package performs the following tasks common on JupyterLab core and external extensions:
- Extract strings from code in
*.py
,*.ts
,*.tsx
files. - Extract strings from JSON schema files.
- Create gettext
*.pot
catalogs. - Removes duplicate strings from catalogs.
- Create gettext
*.po
catalogs for specific languages. - Compile catalogs to
*.mo
and*.json
format to be consumed by the JupyterLab frontend. - Provide a Hatch Build Hook to compile catalogs when building wheels.
- Update the list of contributors from Crowdin project.
pip install jupyterlab-translate
You will also need to install nodejs
>= 14.
conda install jupyterlab-translate -c conda-forge
This is the recommended way of distributing your localization catalogs.
Visit the language packs repository.
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>
To extract translatable strings from typescript files, this package relies on
gettext-extract
. To ease its
installation and usage, that tool is packaged within the python package by
creating a monolithic JavaScript file using @vercel/ncc
compiler.
To update the monolithic file, have a look at the release file.