Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Keep Linux in english while windows in native language Post 303025635 by bakunin on Thursday 8th of November 2018 06:07:03 AM
Old 11-08-2018
In addition to what gull04 (rightfully) said: there is no "Linux language"! Unlike Windows in Linux everything is controlled by a "language setting", which is basically done in the environment. There are the variables "LANG" and some others all starting with "LC_". Issue the two commands

Code:
set | grep '^LC_'
echo $LANG

to see them in a terminal window. You probably see an output like this:

Code:
# set | grep '^LC_'
LC_ADDRESS=de_AT.UTF-8
LC_IDENTIFICATION=de_AT.UTF-8
LC_MEASUREMENT=de_AT.UTF-8
LC_MONETARY=de_AT.UTF-8
LC_NAME=de_AT.UTF-8
LC_NUMERIC=de_AT.UTF-8
LC_PAPER=de_AT.UTF-8
LC_TELEPHONE=de_AT.UTF-8
LC_TIME=C

# echo $LANG
C

Because of the i.e. LC_TIME setting date will display the date and time in an international format. Would it be set like the others ("de_AT.UTF-8", the austrian variety of german) its output would change:

Code:
# export LC_TIME=C
# date
Thu Nov  8 11:26:25 CET 2018

# export LC_TIME=de_AT.UTF-8
# date                      
Do Nov  8 11:29:22 CET 2018

Notice that the day of week was named "Thu" (Thursday) first and "Do" ("Donnerstag", which is german for Thursday) in the second.

The same goes for all the other aspects of behavior in UNIX: whatever language- or even culturally-related aspect there is it is controlled by these environment variables: LC_COLLATE will tell utilities like sort which sort order to apply. Easy, you might think, but does the german "ö" come before or after the "o", hmm? And is uppercase to be before or after lowercase? Actually, that depends - it depends on the setting of LC_COLLATE.

All this is called the "locale" and since this is just a bunch of environment variables you can easily set them to whatever value you want. I prefer "C", which is a "base" locale: english as language, ASCII characters instead of unicode characters, etc.. Try the following on the commandline:

Code:
export LANG=C
export LC_ALL=C

and you will get everything in english: man page output, diagnostic messages, etc. Instead of "C" you could also use something like "en_GB.UTF-8" (british english using unicode 8bit-characters) or "de_DE.UTF-8" (Germanies german using unicode 8-bit characters) and so on. You can (in theory - to make a consistent locale is a lot of effort) even create your own locale and use that. To have Linux speak elvish and use "ropes" instead of "miles" as a measurement of length surely might appeal to some. ;-))

So, the bottom line is: just set your locale to what you want and if you want that effect to be lasting you should do that in your sessions startup scripts: ~/.profile and, depending on which shell you use, ~/.kshrc, ~/.bashrc, ~/.cshrc or whatever.

I hope this helps.

bakunin
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

format to linux native?

hi again all, i am still trying to get my old win95 pc to become a unix/linux pc, running with redhat. i managed to install it on my old win32/fat partition (which is the whole hdd), but when i did this it said it may result in lower operating speed, but i couldn't manage to create a linux native... (2 Replies)
Discussion started by: gan
2 Replies

2. UNIX for Dummies Questions & Answers

Trying to native compile Linux Dialog

Hi, as my thread has been moved to Debian. I don't run Debian machine. My machine is Linux embedded router - mipsel. Sources come from Debian, but Dialog sources are GNU, so no Debian specific. Native compilation vs. crosscompilation, exactly to let you know, that I don't run Debian... (2 Replies)
Discussion started by: jack2
2 Replies

3. Shell Programming and Scripting

Delete files not in English language

Hi All, I have some 10,000 files in a directory. Now, some of those files are in English and many are not. They are in other languages like Arabic, Chinese, German, Portuguese, Japanese etc. Is there any way to delete those files that are not in English as I want to only keep English files... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

4. Solaris

Exceed XDMCP Query: Menu displayed is tiny size when logged in with language other than English

Hi All, I'm new for Solaris and exceed both. I tried searching in forum but couldn't locate any similar issue posted so posting the issue. I'm remotely connecting a solaris machine using Exceed XDMCP Query and while login I select Chinese language / locale for login. After login when I... (0 Replies)
Discussion started by: kshukla08
0 Replies

5. Red Hat

The English characters distorted after add a right to left language

i need for a right to left language support, in red hat EL6 , for repository problem, i never could to use from yum-solution, when i try from Gnu Desktop: Desktop --> system --> preference --> keyboard --> layouts --> Add and Add second language,the second language is ok but i lose English... (4 Replies)
Discussion started by: alwaystudent
4 Replies

6. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies

7. UNIX for Beginners Questions & Answers

Seen Windows pc, having all the features of Linux, could exe, read and edit save like windows

Hi, totally new to linux base using windows when started learning and using computers. but i remember that one pc was there , look alike windows desktop, but could not do the task as windows just click and open and view edit etc. But, you could do a little differently even saving in and opening... (8 Replies)
Discussion started by: jraju
8 Replies

8. UNIX for Beginners Questions & Answers

Wanna learn native GUI programming in UNIX - Linux ?

Hi , wanna learn native GUI programming in Unix-Linux instead of Gtk and Qt. No problem. You don't need a cross platform Gui toolkit like Gtk and Qt. And the code and syntax is also not more or less than others. Check out this code for a simple mainwindow for your application that is openend in... (0 Replies)
Discussion started by: Sennenmut
0 Replies
All times are GMT -4. The time now is 05:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy