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

Chinese support #2

Closed
forest0 opened this issue Jul 12, 2020 · 3 comments
Closed

Chinese support #2

forest0 opened this issue Jul 12, 2020 · 3 comments

Comments

@forest0
Copy link

forest0 commented Jul 12, 2020

Thanks for your sharing, I've tested on the debian package of version 7.6.7.3, worked like a charm.

However, one problem that annoys me sometimes is Chinese failed to render, since EasyConnect show most of its messages in Chinese and some messages are really helpful, e.g., the error message when you failed to connect.

So I tried to add Chinese support and it worked, the following are some hints in case some other guys need them:

# install a Chinese font, I just use microhei here
apt-get install locales ttf-wqy-microhei

echo "Asia/Shanghai" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i -e 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
echo 'LANG="zh_CN.UTF-8"' > /etc/default/locale
dpkg-reconfigure --frontend=noninteractive locales
update-locale LANG=zh_CN.UTF-8

# and set your language environment variables
# here I set them in Dockerfile, adjust according to your needs
ENV LANG zh_CN.UTF-8
ENV LANGUAGE zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
@Hagb
Copy link
Collaborator

Hagb commented Jul 14, 2020

Hi. Thanks for your code. It works perfect!

But I tried to make the image as small as possible, and don't know whether it is a good idea to include the Chinese font in image. (There is a workaround if Chinese font(s) installed in the host: add --mount type=bind,source=/usr/share/fonts/,target=/usr/share/fonts/,readonly as a docker argument so as to use the font from the host)

The language in EasyConnect can also be changed to English. I used EasyConnect 7.6.3 where the language can be changed directly in the interface.

I didn't find how to change the language by GUI in EasyConnect 7.6.7, but it can be done by setting the value of language in /root/easy_connect.json (such as "language": "en_US" for English).

@forest0
Copy link
Author

forest0 commented Jul 14, 2020

I did not find how to change language by GUI in 7.6.7 either, so I thought that Chinese was the only language it support. Now I managed to change language to English by editing easy_connect.json, so Chinese is not a necessary now(though I believe providing a default configuration with language set to English is more friendly to users).

BTW, mount the fonts in host into docker is a smart trick.

@Hagb
Copy link
Collaborator

Hagb commented Jan 18, 2023

EasyConnect 7.6.7 displays resources whose names are defined by server-side and are usually Chinese, so a Chinese font becomes necessary. fonts-wqy-microhei has been installed in the image since 5b52478.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants