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

Desktop GUI has some features not appearing in French #70

Closed
Jose-Matsuda opened this issue Jan 14, 2021 · 8 comments
Closed

Desktop GUI has some features not appearing in French #70

Jose-Matsuda opened this issue Jan 14, 2021 · 8 comments
Labels
bug Something isn't working as expected stale Awaiting input from creator for prolonged time period

Comments

@Jose-Matsuda
Copy link

Describe the bug:

XFCE VNC does not get fully localized into French (first image below) after installing the locale and setting the environment variables.

Expected behaviour:

The XFCE installed applications (using thunar as an example) to appear in French (second image below).

Steps to reproduce the issue:
In a docker file

FROM mltooling/ml-workspace-minimal:0.12.1
RUN \
    apt-get update && \
    apt-get install -y locales && \
    sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
    locale-gen && \
    dpkg-reconfigure --frontend=noninteractive locales && \
    clean-layer.sh
ENV LANG=fr_FR.UTF-8 LANGUAGE=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8

Build: sudo docker build -t mltest
Run: sudo docker run --rm -p 8080:8080 mltest
Navigate to desktop gui

Technical details:

  • Workspace version: 0.12.1 (base)
  • Docker versionL: 20.10.0
  • Host Machine OS (Windows/Linux/Mac): Linux
  • Command used to start the workspace : sudo docker run --rm -p 8080:8080 mltest
  • Browser (Chrome/Firefox/Safari): Firefox

Possible Fix:
I don't know :(

Additional context:
I've looked at and extended just an xfce specific image here and was able to get the UI to fully appear in French (see second image below). That image is based on ubuntu:16.04.

image

I would instead expect something like
image

@Jose-Matsuda Jose-Matsuda added the bug Something isn't working as expected label Jan 14, 2021
@raethlein
Copy link
Member

Hey @Ito-Matsuda,

could you try out the following please:

  1. Open a terminal in your running workspace

  2. Execute the following commands to set the locale:

    echo 'export LC_ALL=fr_FR.UTF-8' >> ~/.xsessionrc
    echo 'export LANG=fr_FR.UTF-8' >> ~/.xsessionrc
    echo 'export LANGUAGE=fr_FR.UTF-8' >> ~/.xsessionrc
    
    sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
    locale-gen && \
    dpkg-reconfigure --frontend=noninteractive locales
  3. Restart vnc: supervisorctl restart novnc vncserver

  4. Refresh the noVNC page

@Jose-Matsuda
Copy link
Author

Hi there,
Unfortunately that doesn't seem to work.
image
then
image

I also get the vncserver failing / continuously exiting after running the restart vnc.

image. I get the same result if I stop novnc and then vncserver in the Supervisor status page.

@raethlein
Copy link
Member

Hm, I have not found any solution yet so maybe the problem is the version of Thunar? If that is the case, the problem might be solved as soon as it is updated.

@Jose-Matsuda
Copy link
Author

I think some mo files are not being generated correctly or there is something messing with it. If I get a Thunar.mo file from an ubuntu:16.04 image from this other desktop project

image

and place it in either /usr/share/locale/fr/LC_MESSAGES or /usr/share/locale-langpack/fr/LC_MESSAGES and it becomes localized.

image

@raethlein
Copy link
Member

raethlein commented Jan 20, 2021

Hey @Ito-Matsuda, thanks for the hint with the Thunar.mo file!
So, I have figured out that the translation files for Thunar are in the thunar-data package (e.g. here).
When I install the package in a ubuntu:16.04 docker container, then the *.mo files are copied to the /usr/share/locale/* directory, while they are not copied in a ubuntu:18.04 or ubuntu:20.04 container.

How to try out:

# in (brackets) the command for 18.04 if different
docker run -it --entrypoint /bin/bash ubuntu:16.04 (docker run -it --entrypoint /bin/bash ubuntu:18.04)

apt-get update && apt-get install -y wget
wget http://ports.ubuntu.com/pool/universe/t/thunar/thunar-data_1.6.11-0ubuntu0.16.04.2_all.deb (wget http://ports.ubuntu.com/pool/universe/t/thunar/thunar-data_1.6.15-0ubuntu1.18.04.1_all.deb)

dpkg -i thunar-data_1.6.11-0ubuntu0.16.04.2_all.deb (dpkg -i thunar-data_1.6.15-0ubuntu1.18.04.1_all.deb)

find / -name Thunar.mo
# This shows a list of the Thunar.mo files under /usr/share/locale/ on 16.04 but not on 18.04

# Check that the Thunar.mo files are in the actual package, for example the french translation:
mkdir /temp
dpkg -x  thunar-data_1.6.11-0ubuntu0.16.04.2_all.deb /temp
ll /temp/usr/share/locale/fr/LC_MESSAGES/

I guess you could just copy the translation file from the extracted directory. I have not found anything yet why the .mo files are not copied automatically when installing the package on ubuntu:18.04/20.04.

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

@github-actions github-actions bot added the stale Awaiting input from creator for prolonged time period label Apr 21, 2021
@github-actions github-actions bot closed this as completed May 5, 2021
@huapox
Copy link

huapox commented May 16, 2021

My testing:

  • debian:xxx is okay.
  • debian:xxx-slim: the xx.mo will not gen when one app newly installed. just like ubuntu18.04/20.14
#https://hub.docker.com/_/debian?tab=description&page=1&ordering=last_updated
debian:<suite>-slim
(removing some extra files that are normally not necessary within containers, such as man pages and documentation)

The xx.mo is generated when some app just installed.

locale-gen got /usr/lib/locale/locale-archive, but not xx.mo. xx.mo is in app's xx.deb package.


The problem occured at the base-container, refrence src:

The keyConf:

  • debian:stretch /etc/dpkg/dpkg.cfg.d/docker
  • ubuntu:18.04 /etc/dpkg/dpkg.cfg.d/excludes
# ubuntu:18.04 /etc/dpkg/dpkg.cfg.d/excludes

# Drop all translations
#path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo #notes this line 


# debian:stretch
sed -i "s^path-exclude /usr/share/locale/*^# path-exclude /usr/share/locale/*^g" /etc/dpkg/dpkg.cfg.d/docker

@raethlein
Copy link
Member

raethlein commented May 17, 2021

Great @huapox, thanks a lot for the answer! I just tested it and the entry in /etc/dpkg/dpkg.cfg.d/excludes is also the reason for the Ubuntu 18.04/20.04 images! If you comment the line out as you suggested and install the package again (e.g. dpkg -i thunar-data_1.6.15-0ubuntu1.18.04.1_all.deb as described in the comment above), the translations are copied correctly! I think we are going to comment out that line in future versions of the workspace image by default then or at least add it to the FAQ section in the Readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected stale Awaiting input from creator for prolonged time period
Projects
None yet
Development

No branches or pull requests

3 participants