Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jupyterlab-language-pack-es-ES to Python image and set Spanish to be the default language #3

Open
2 tasks
emiliom opened this issue Feb 3, 2023 · 6 comments
Labels
ohw23es-intercoonecta Feb - Mar 2023 event in Spanish

Comments

@emiliom
Copy link
Member

emiliom commented Feb 3, 2023

  • Add jupyterlab-language-pack-es-ES to the Python image
  • Implement steps to make it the default JupyterLab language for a period of 2-3 weeks encompassing the OHWes event (Feb 27 - Mar 3). I've looked into options for doing this and can document them here; I think I also tested one of these options, but only in the context of a local JupyterLab installation.
@emiliom
Copy link
Member Author

emiliom commented Feb 9, 2023

To set a specific language as the JupyterLab default, first the language pack package must be installed in the conda environment. The ES language pack is available on conda-forge as jupyterlab-language-pack-es-ES.

Then, we create an overrides.json file and place it in the path <sys.prefix>/settings/, where <sys.prefix> is the Application Directory, which can be obtain with the command jupyter lab path (assuming the conda environment includes JupyterLab). For example, on my Ubuntu computer this settings path is ~/miniconda3/envs/jupyterlab_new/share/jupyter/lab/settings/
If the user changes the language through JupyterLab interface, overrides.json will no longer be used.

Here's what the content of overrides.json should be:

{
  "@jupyterlab/translation-extension:plugin": {
    "locale": "es_ES"
  }
}

For more information:

@abkfenris do you have any input on this? We'll add the language pack package ourselves, right? While doing that, should we also address #2? As for placing the overrides.json file in the right path, I imagine that'll be for 2i2c, right?

@abkfenris
Copy link
Contributor

Hmm, exploring those a bit I think /opt/conda/share/jupyter/lab/settings/overrides.json would be the path. That's one that we can set because it's baked into the image (so it could be COPY overrides.json /opt/conda/share/jupyter/lab/settings/overrides.json).

If it's in the other paths its going to be more complicated to tweak because each user gets /home/jovyan/ mounted to a separate filesystem.

(base) jovyan@jupyter-abkfenris:~$ jupyter lab path
[LabPathApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `LabPathApp`.
Application directory:   /opt/conda/share/jupyter/lab
User Settings directory: /home/jovyan/.jupyter/lab/user-settings
Workspaces directory: /home/jovyan/.jupyter/lab/workspaces

Added comments on #2 about bumping other packages/underlying image.

@emiliom
Copy link
Member Author

emiliom commented Feb 9, 2023

Thanks! Heh, it didn't occur to me to follow my own instructions and run jupyter lab path on the hub.

I'm pretty sure it's not the "Workspaces directory", but I don't know if it'd be "User Settings directory". It looks like it really is "Application directory", /opt/conda/share/jupyter/lab 🤞

I can communicate this to 2i2c. Worse case scenario, each user will have to switch the language via the interface, and I already have instruction in Spanish for doing that, with screenshots and all.

@emiliom
Copy link
Member Author

emiliom commented Feb 13, 2023

Also add the Brazilian Portuguese language pack to the Python image, while we're at it! See 2i2c-org/default-hub-homepage#20 (review)

@emiliom
Copy link
Member Author

emiliom commented Feb 13, 2023

I think I'm now pedaling back from changing the language default, and instead stick with the English default plus instructions for switching the language. We already have the instructions in Spanish for switching the language to Spanish.

That'll be less work overall and less experimentation at this stage, plus less disruption to others outside this event. Plus, most participants in this Spanish event will already have seen, and possibly even applied, the instructions for switching language; and there may be some advantage in event participants being clearly aware that the English interface is readily accessible.

@emiliom
Copy link
Member Author

emiliom commented Feb 20, 2023

With the hub now using the updated Python image, I've confirmed that the Spanish and Portuguese language packs are now accessible on JupyterLab, and switching to the Spanish language pack works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ohw23es-intercoonecta Feb - Mar 2023 event in Spanish
Projects
None yet
Development

No branches or pull requests

2 participants