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

How to change language (locale) #268

Open
mdshovon97 opened this issue Feb 2, 2025 · 4 comments
Open

How to change language (locale) #268

mdshovon97 opened this issue Feb 2, 2025 · 4 comments

Comments

@mdshovon97
Copy link

$ sudo locale-gen en_US.UTF-8
Generating locales (this might take a while)...
zh_CN.UTF-8... done
en_US.UTF-8... done
Generation complete.
$ sudo locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=ja_JP.UTF-8
LANGUAGE=
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
$

@ykhandler
Copy link

#SETUP LANGUAGE TO EN
echo export LANGUAGE=en_US > ~/.i18n
echo export LANG=en_US.UTF-8 >> ~/.i18n
echo export LC_ALL=en_US.UTF-8 >> ~/.i18n

export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US"

sudo localedef -f UTF-8 -i en_US en_US.UTF-8
cp /etc/locale.gen /etc/locale.gen1
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/zh_CN.UTF-8 UTF-8/# zh_CN.UTF-8 UTF-8/g' /etc/locale.gen
sudo locale-gen

sudo update-locale LANG="en_US.UTF-8" LANGUAGE="en_US" LC_ALL="en_US.UTF-8"

@mdshovon97
Copy link
Author

How to use this command

#SETUP LANGUAGE TO EN
echo export LANGUAGE=en_US > ~/.i18n
echo export LANG=en_US.UTF-8 >> ~/.i18n
echo export LC_ALL=en_US.UTF-8 >> ~/.i18n

export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US"

sudo localedef -f UTF-8 -i en_US en_US.UTF-8
cp /etc/locale.gen /etc/locale.gen1
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/zh_CN.UTF-8 UTF-8/# zh_CN.UTF-8 UTF-8/g' /etc/locale.gen
sudo locale-gen

sudo update-locale LANG="en_US.UTF-8" LANGUAGE="en_US" LC_ALL="en_US.UTF-8"

@mdshovon97
Copy link
Author

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "zh_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Extracting templates from packages: 100%
Preconfiguring packages ...

@ykhandler
Copy link

You can save it to a script file. Ex: MySetup.sh, then run it like this:
bash ./MySetup.sh

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