Translation python package

Creating translation in extension python package.

Hi all, I’m trying to ship a translation language in a jupyter lab extension. I followed the instruction here: Internationalization and Localization — JupyterLab 4.2.0b1 documentation
and the example jupyterlab_server/tests/translations/jupyterlab-some-package at main · jupyterlab/jupyterlab_server · GitHub

I added: entry_points={“jupyterlab.locale”: [“sas_workbench = sas_workbench”]} in setup.py,
and in MANIFEST.in
recursive-include sas_workbench *.json
recursive-include sas_workbench *.mo

I added a de_DE translation in the local folder.

image

but for some reason when I load the translation domain from the ITranslator in the front end, the dictionary object for that domain is always empty.

would anyone be able to help pointing out what I miss?

Thanks in advance

The domain name has to strictly match what is used on the backend, so it could be this. One thing I would check is whether your packages locale gets picked up via entry point; I would do this by hooking into get_installed_packages_locale in jupyterlab_server/translation_utils.py because I think there is no logging for this.