|
楼主 |
发表于 2004-5-26 09:51:37
|
显示全部楼层
找到了制作语言包的方法,内容如下
How to create a multilanguage module for SLAX
---------------------------------------------
This document describes which packages and which files are needed
to create a SLAX module with your language. At first, read the file
DOC_MODULES to learn how to create modules for SLAX. You will need to
know that.
Now let's assume that your language is "cs" (for Czech) and you wish to
create the module structure in /tmp/lang directory. Also let's assume
that you don't wish to include any sounds, manuals and documentation
files in the module, because of it's size.
-----------------------
1. Installing KDE files
-----------------------
The most important part of multilanguage module for SLAX is covered in
two KDE i18n packages. In Slackware, these files are located in
/slackware/kdei/ directory on the FTP or on the Install CD. So download
them if neccessary and install them by using
installpkg -root /tmp/lang ./kde-i18n-cs*.tgz
installpkg -root /tmp/lang ./koffice-i18n-cs*.tgz
You may now remove everythig you don't need from the lang directory.
For example, you won't need /tmp/lang/opt/kde/share/doc.
KDE multilanguage support is now installed, but the default language
in KDE is still english.
-------------------------------
2. Set KDE to use your language
-------------------------------
You will need to modify two KDE config files. You may copy them from your
home directory (/root/ under SLAX) to /tmp/lang; and then:
at first, /tmp/lang/root/.kde/share/config/kdeglobals: in [Locale] section,
for example, modify these lines:
[Locale]
Country=cz
Language=cs
at second, /tmp/lang/root/.kde/share/config/kxkbrc: in [Layout] section,
for example, modify these lines:
[Layout]
Additional=cz,us
Layout=cz
Variants=cz(basic),us(intl)
If you are not sure what to type here, make your changes by using
KDE Control Center and then see these files to find all differences.
--------------------
3. Textmode settings
--------------------
To be able to use your keyboard and language in text-mode, start "setfont"
and "loadkeys" with apropriate arguments. You can create
/tmp/lang/etc/rc.d/rc.keymap
with the following content:
echo "Loading keyboard mapping for cz" # This is Czech keyboard mapping
loadkeys cz 2>/dev/null >/dev/null
and then edit
/tmp/lang/etc/rc.d/rc.font
adding the following:
echo "Loading font from file lat2a-16.psfu.gz" # This is Czech font
setfont -v lat2a-16.psfu.gz 2>/dev/null >/dev/null
These two scripts will be executed by SLAX during the boot.
You also have to create /tmp/lang/manual with the following content:
#!/bin/bash
/etc/rc.d/rc.font
/etc/rc.d/rc.keymap
to start both rc-scripts mentioned above when user loads the module manually
(by downloading the module and using moduse command)
-------------------
4. Own translations
-------------------
Edit or replace /tmp/lang/etc/issue with your translation
of SLAX splash screen.
You may also wish to translate this document to your language
and copy it to /tmp/lang/
----------------
5. System locale
----------------
Locale is used to translate textmode applications.
You may want to create profile script to set your locale
environment variables. For example
/tmp/lang/etc/profile.d/lang.sh
#!/bin/sh
export LANG=cs_CZ
export LC_COLLATE=C
Apropriate translations are usually located in /usr/share/locale/??/*.mo
These translations could break scripts so it's a good idea
to include only few of them, for ncurses apps only, for example
mc.mo (for Midnight Commander)
lynx.mo (for Lynx browser)
mutt.mo (for Mutt mail client)
--------------------
6. Create the module
--------------------
Then convert your lang directory to SLAX module by using
dir2img /tmp/lang cs.img /data |
|