Complete linguistic strategy in RedHatLinux7.1

Source: Internet
Author: User
Tags i18n
Article Title: Full linguistic strategy in RedHatLinux7.1. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
For many Chinese users who want to learn and learn Linux, ugly Chinese support is the main reason for their continued use. If you are disappointed, you may choose to install a Chinese version such as BluePoint, red flag, and TurboLinux. However, in the Linux camp, RedHat has to be involved, the overwhelming materials and software on the Internet are For RedHat. if there are incompatibility problems with other versions, or you cannot find the commands you need ...... At this time, I really felt the meaning of "the bear's paw and the fish cannot have both sides!
However, with the release of RedHat 7.1, these problems have finally been solved. The core used by RedHat is kernel 2.4.2, XFree86 is 4.03, KDE is 2.1.1, and glibc is 2.2.2, the underlying operating system is well supported for internationalization. If you only need to display Chinese characters or browse Chinese webpages, you do not need to install any additional software.
Linux internationalization and localization
To enable Linux to support multiple languages, there are two problems involved: Internationalization and localization, i18n and l10n.
1. i18n
"Internationalization": Internati-onalization is an international English word. The first letter of an English word, I, and the last letter, contains 18 letters. Therefore, it is often referred to as i18n. I18n is a concept used to provide an architecture so that the same code can be applied to various language habits and coding systems. programmers only need to use the mechanisms and guidelines of this architecture to write applications, you can support a wide variety of languages without creating new code (especially the C library and the X graphical interface's internationalization design ).
2. l10n
"Localization". The English language is Localization. because there are 10 characters between l and n, it is also often referred to as l10n. The main function of l10n is to process software to meet the special requirements of users on specific markets for languages and functions. Software quality assurance activities involving text translation, user interface layout adjustment, localization feature development, production of online documents and printed manuals, and the normal operation of localized versions, of course, input methods should also be supported.
That is to say, i18n provides underlying support for the operating system and l10n provides local support. As we have seen, Win2000 is developed in this mode. the kernel of Win2000 in different languages is exactly the same (i18n), but the operating interface and documentation are different (l10n ).
Built-in Chinese support
RedHat uses the Locale technology to provide multilingual support. we only need to set the corresponding Locale.
It should be noted that the RedHat 7.1 of the "typical installation" does not support Simplified Chinese. you must manually select simplified Chinese support. if you are a newbie and do not know how to choose it, it is also very simple, selecting "Everything (fully installed)" in the custom type during installation can help you solve this problem, but you need enough disk space (2.5 GB required ).
  
1. set Chinese locale
The locale switching of RedHat is very simple: Enter the Linux window interface, execute locale_config to bring up a select local language window, select "Chinese (CN. GB2312) zh_CN.GB2312 "to set locale to" simplified Chinese ". if you want to try" traditional Chinese ", you can also select" Chinese (TW. big5) zh_TW.Big5 ".
2. Chinese locale application
Open a console and run the date command. How can we see a line of garbled characters? Yes, it should be garbled, but it indicates that you have set the Chinese locale correctly.
(1) Gnome environment
Run startx to enter the default GNome desktop. you will see that the time on the taskbar has been displayed in Chinese, and the menu in the footboard in the lower left corner also has Chinese characters (note: here I am talking about "yes" rather than "yes". This is because Gnome's "simplified Chinese" is not completely completed yet, and the menus you see are actually mixed in Chinese and English ).
Maybe many of my friends are more familiar with the KDE environment. it doesn't matter. you can select your preferred operating environment (Gnome, KDE, FVWM, etc.) by running switchdesk )......
(2) KDE environment
Compared with Gnome, KDE is more localized, at least the menu is completely displayed in Chinese. But I don't know why. I still haven't installed the KDE simplified Chinese package for RedHat 7.1. I need to manually add the first CD of RedHat 7.1 to the optical drive, and then execute the following command:
Mount/mnt/cdrom
Cd/mnt/cdrom/RedHat/RPMS
Rpm-ivh kde-i18n-Chinese-2.1.1-2.noarch.rpm
Rpm-ivh kde-i18n-Chinese-Big5-2.1.1-2.noarch.rpm
In this way, KDE's simplified/traditional Chinese display support has been installed, and you need to set the Display language and font.
Open the Control Center of KDE and select "Personalization"/"Country & Language". The settings are as follows:
Country: Asia & Oceania/China
Language: Simplified Chinese (zh_CN.GB2312)
Chars: gb2312.1980-0
(3) display the Chinese directory/file name
RedHat can display Chinese directories and file names. you only need to add the-o codepage = 936, iocharset = cp936 parameter after mount. for example:
Mount-t vfat/dev/hda1/mnt/dosc-o codepage = 936, iocharset = cp936
There is also a permanent way to modify/etc/fstab. below is my fstab file:
There are many Chinese input methods in Linux, but not every input method can be used in RedHat 7.1. Generally, you need to make some adjustments, this adjustment is definitely difficult for beginners.
  
In Linux, there are two common input methods: chinput and xcin, which are difficult to install. For the sake of simplicity, we use tailism and use the rfinput input method in RedFlag Linux to implement Chinese input in RedHat 7.1.
User PopWander will RedFlag Linux Input method transplanted to RedHat 7.1, we can go to http://go3.163.com /~ Download popwander/software/rf-xim-input-2.1-2.i386.rpm and run the following command to install:
Rpm-ivh -- force rf-xim-input-2.1-2.i386.rpm
Rfinput comes with a Chinese dot matrix font and automatically sets environment variables. in RedHat 7.1, no other settings are required. it is started with KDE/Gnome startup, you only need to press Ctrl + Space to call up the Chinese input method. for KDE users, you can also click the icon in the lower-right corner of the desktop to select the input method.
Rfinput includes smart ABC and five input methods, which can be used to directly input phrases. Moreover, rfinput supports Association and memory of input methods in Windows, making it easy to use. If you are five users, you can also edit the five-stroke input code table file in rfinput. this is a text file. you can add your own phrases and each phrase occupies one line, for details about the format, see/usr/local/rfinput/lib/wbx. mb.
Note: in customized Linux, the input method version is 2.0.1, and the latest version of the optical disk version is 2.2-2. neither of them can be directly used under RedHat 7.1. if you want to compile it yourself, download the source code file.
Port Windows fonts
After XFree86 4.0, TrueType fonts can be well supported. TrueType fonts can be scaled infinitely, and the display effect is naturally comparable to that of non-dot matrix fonts. If you want to achieve a nice font effect in Windows, you must install the Chinese TrueType font. Of course, the simplest thing is to use the Chinese TrueType font that comes with Windows. For convenience, we only use the SimSun font as an example.
Note: XFree86 3.x has a problem with TrueType support. Therefore, before installing the font, you must first confirm that XFree86 4.03 is used. use xdpyinfo to view the version number of XFree86:
Xdpyinfo | grep release
Make sure that the displayed number is 4003.
1. font installation
I installed the TrueType font in the/usr/share/fonts/zhFonts Directory. you can set it according to your preferences. Note that TrueType fonts are installed in/usr/share/fonts/default/TrueType on many websites. this directory already exists in RedHat 7.1, the TrueType font is installed, so select a directory as follows:
Mkdir/usr/share/fonts/zhFonts
Cp/mnt/dosc/Windows/simsun. ttf/usr/share/fonts/zhFonts
  
Cd/usr/share/fonts/zhFonts
Ttmkfdir> fonts. dir
Ttmkfdir does not recognize Windows TrueType fonts very well. we need to edit fonts. dir and change it to the following content:
4
Simsun. ttf-misc-SimSun-medium-r-normal -- 0-0-0-0-p-0-ascii-0
Simsun. ttf-misc-SimSun-medium-r-normal -- 0-0-0-0-p-0-gbk-0
Simsun. ttf-misc-SimSun-medium-r-normal -- 0-0-0-0-p-0-iso8859-1
Simsun. ttf-misc-SimSun-medium-r-normal -- 0-0-0-0-p-0-gb2312.1980-0
Then copy fonts. dir to fonts. scale (set the font to be scalable ):
Cat fonts. dir> fonts. scale
2. support setting TrueType fonts
We already have the TrueType font that XFree86 can use, and now we want to edit the XFree86 4.03 configuration file XF86config-4, add the SimSun font path (in Section "Files" Section), as shown below:
Section "Files"
FontPath "unix/: 7100"
FontPath "/usr/share/fonts/zhFonts"
EndSection
Add the TrueType font support module xtt to the Modules section (the freetype module can also support TrueType fonts, but the display speed is not as high as xtt, and the two cannot be used at the same time), as shown below:
Section "Module"
......
Load "xtt"
......
EndSection
3. use TrueType font
After the preceding settings, the use of TrueType fonts is very simple.
(1) KDE environment
"KDE Control Center (KDE Control Center)" → "perception" → "font", set all fonts to SimSun, with a size of 16 and a nice UI (different situations may vary for everyone, set the size on your own ).
(2) Gnome environment
The use of TrueType Chinese fonts in Gnome is troublesome. we must manually modify the resource configuration file of Gnome.
Edit the/etc/gtk/gtkrc. zh_CN file and set the fontset as follows:
Fontset = "-misc-simsun-medium-r-normal -- 16-0-0-0-p-0 -*-*"
Simultaneously edit the/etc/gnome/gtkrc. zh_CN file,
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.