Difference between pages "Package:Profanity" and "Funtoo Linux Localization"

(Difference between pages)
 
(Correcting order: First set default language, *then* install correct fonts)
 
Line 1: Line 1:
{{Ebuild
+
== Set Default Language ==
|Summary=Ncurses based jabber client inspired by irssi
+
 
|CatPkg=net-im/profanity
+
On Funtoo, there are two configuration files responsible for your language settings: <code>/etc/locale.gen</code> and <code>/etc/env.d/00basic</code>. First file has only en_US.UTF-8 locale enabled. Last one is a default shipped file comes from stage3 and responsible for en_US.UTF-8 locale system-wide. Not recommended to edit.
|Maintainer=damex
+
The following steps will guide you through the process of setting up the default system language, using French Canadian as an example.
|Homepage=http://www.profanity.im
+
First you will need to edit <code>/etc/locale.gen</code>:
 +
<console>
 +
# ##i##nano -w /etc/locale.gen
 +
</console>
 +
Specify your preferred locale with the accompanying character format (you will mostly want UTF-8):
 +
{{fancynote|It is recommended to keep the preconfigured en_US.UTF-8 locale as a fallback.}}
 +
{{file|name=/etc/locale.gen|body=
 +
en_US.UTF-8 UTF-8
 +
fr_CA.UTF-8 UTF-8
 
}}
 
}}
Profanity is a console based XMPP client written in C using ncurses and libstrophe, inspired by Irssi.
+
To determine an appropriate locale for your system, you should take a look into <code>/usr/share/i18n/SUPPORTED</code> for the default list of supported combinations or check the <code>/usr/share/i18n/locales/</code> directory for a list of valid values.
 +
{{fancywarning|You are strongly advised to use ''at least one'' UTF-8 locale since some applications may require it.}}
  
== Installing latest release version: ==
+
Now, those locales need to be generated:
 +
<console>
 +
# ##i##locale-gen
 +
##g##*##!g## Generating 2 locales (this might take a while) with 1 jobs
 +
*  (1/2) Generating en_US.UTF-8 ... [ ok ]
 +
*  (2/2) Generating fr_CA.UTF-8 ... [ ok ]
 +
##g##*##!g## Generation complete
 +
</console>
  
 +
Once done, you can apply your locale settings system-wide. First display all available options:
 
<console>
 
<console>
###i## emerge profanity
+
$ ##i##eselect locale list
 +
##b####g##Available targets for the LANG variable:
 +
  ##b##[1]##!b##  C
 +
  ##b##[2]##!b##  POSIX
 +
  ##b##[3]##!b##  fr_CA.utf8
 +
  ##b##[4]##!b##  en_US.utf8 ##bl##*
 +
  ##b##[ ]##!b##  (free form)
 +
</console>
 +
The blue star indicates the current default system locale. You can now change it according your wishes:
 +
<console>
 +
# ##i##eselect locale set 3
 +
Setting LANG to fr_CA.utf8 ...
 +
Run ". /etc/profile" to update the variable in your shell.
 +
</console>
 +
Alternatively, you can set the default locale manually. This file should be created first with your prefered editor:
 +
{{file|name=/etc/env.d/02locale|body=LANG="fr_CA.utf8"}}
 +
You can verify your actions using:
 +
<console>
 +
$ ##i##eselect locale show
 +
##b####g##LANG variable in profile:
 +
  ##b##fr_CA.utf8
 
</console>
 
</console>
  
Profanity can be linked with either libxml2 or expat libraries. By default expat is used, set the xml flag to link with libxml2.
+
For an immediate effect it is required to reload the environment:
 +
<console>
 +
# ##i##env-update && source /etc/profile
 +
>>> Regenerating /etc/ld.so.cache...
 +
</console>
 +
Congratulations! You have successfully set up your default language on Funtoo.
  
== Installing development/live version: ==
+
== Read Your Language ==
  
To install latest development version, add net-im/profanity to the package.keywords and package.unmask file:
+
A newly installed Funtoo Linux does not able to read all the languages. You want to read the stuff, say, in Mozilla Firefox. You need to install fonts - A good sign that you have not installed the proper fonts is that the following characters appear as boxes with numbers inside: 日本語フォント
 +
 
 +
Check if you have your language installed (Chinese) by using the <tt>fc-list</tt> command from the <tt>media-libs/fontconfig</tt> ebuild:
  
 
<console>
 
<console>
###i## echo "=net-im/profanity-9999 **" >> /etc/portage/package.keywords
+
# ##i##fc-list :lang=zh
 
</console>
 
</console>
 +
 +
A easier way to get the correct font installed is copy this to <tt>/etc/portage/make.conf</tt> (Simplified Chinese)
  
 
<console>
 
<console>
###i## echo "=net-im/profanity-9999" >> /etc/portage/package.unmask
+
# ##i##LANGUAGE="en_US zh_CN"
 
</console>
 
</console>
 +
 +
After editing the file, run emerge:
 +
 +
<console>
 +
# ##i##emerge -avuDN world
 +
</console>
 +
 +
If you are lucky, the right font will be installed, and your apps will also be able to use Chinese as the default language. But in case you not have the right font installed in this way, you need to install them manually.
 +
 +
For Japanese:
 +
 +
<console>
 +
# ##i##emerge media-fonts/kochi-substitute
 +
</console>
 +
 +
For Chinese:
 +
<console>
 +
# ##i##emerge media-fonts/arphicfonts
 +
</console>
 +
 +
For Korean:
 +
 +
<console>
 +
# ##i##emerge media-fonts/baekmuk-fonts
 +
</console>
 +
 +
== Keymap ==
 +
 +
Funtoo Linux defaults to a US English keyboard. If you are using another type of keyboard, edit <tt>/etc/conf.d/keymaps</tt> and set keymap to your keyboard model. For example, cf for French Canadian keyboard, fr for French Azerty.
 +
 +
<console>
 +
# ##i##nano -w /etc/conf.d/keymaps
 +
</console>
 +
 +
== Input Method ==
 +
 +
ibus is an Intelligent Input Bus for Linux.
 +
 +
<console>
 +
# ##i##emerge -av ibus
 +
</console>
 +
 +
You also need to install language table for ibus (Chinese)
  
 
<console>
 
<console>
###i## emerge =net-im/profanity-9999
+
# ##i##emerge -av ibus-table-chinese
 
</console>
 
</console>
  
{{EbuildFooter}}
+
[[Category:Install|Localization]]

Revision as of 14:48, September 14, 2014

Set Default Language

On Funtoo, there are two configuration files responsible for your language settings: /etc/locale.gen and /etc/env.d/00basic. First file has only en_US.UTF-8 locale enabled. Last one is a default shipped file comes from stage3 and responsible for en_US.UTF-8 locale system-wide. Not recommended to edit. The following steps will guide you through the process of setting up the default system language, using French Canadian as an example. First you will need to edit /etc/locale.gen:

# nano -w /etc/locale.gen

Specify your preferred locale with the accompanying character format (you will mostly want UTF-8):

Note

It is recommended to keep the preconfigured en_US.UTF-8 locale as a fallback.

/etc/locale.gen
en_US.UTF-8 UTF-8
fr_CA.UTF-8 UTF-8

To determine an appropriate locale for your system, you should take a look into /usr/share/i18n/SUPPORTED for the default list of supported combinations or check the /usr/share/i18n/locales/ directory for a list of valid values.

Warning

You are strongly advised to use at least one UTF-8 locale since some applications may require it.

Now, those locales need to be generated:

# locale-gen
 * Generating 2 locales (this might take a while) with 1 jobs
 *  (1/2) Generating en_US.UTF-8 ... [ ok ]
 *  (2/2) Generating fr_CA.UTF-8 ... [ ok ]
 * Generation complete

Once done, you can apply your locale settings system-wide. First display all available options:

$ eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   POSIX
  [3]   fr_CA.utf8
  [4]   en_US.utf8 *
  [ ]   (free form)

The blue star indicates the current default system locale. You can now change it according your wishes:

# eselect locale set 3
Setting LANG to fr_CA.utf8 ...
Run ". /etc/profile" to update the variable in your shell.

Alternatively, you can set the default locale manually. This file should be created first with your prefered editor:

/etc/env.d/02locale
LANG="fr_CA.utf8"

You can verify your actions using:

$ eselect locale show
LANG variable in profile:
  fr_CA.utf8

For an immediate effect it is required to reload the environment:

# env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...

Congratulations! You have successfully set up your default language on Funtoo.

Read Your Language

A newly installed Funtoo Linux does not able to read all the languages. You want to read the stuff, say, in Mozilla Firefox. You need to install fonts - A good sign that you have not installed the proper fonts is that the following characters appear as boxes with numbers inside: 日本語フォント

Check if you have your language installed (Chinese) by using the fc-list command from the media-libs/fontconfig ebuild:

# fc-list :lang=zh

A easier way to get the correct font installed is copy this to /etc/portage/make.conf (Simplified Chinese)

# LANGUAGE="en_US zh_CN"

After editing the file, run emerge:

# emerge -avuDN world

If you are lucky, the right font will be installed, and your apps will also be able to use Chinese as the default language. But in case you not have the right font installed in this way, you need to install them manually.

For Japanese:

# emerge media-fonts/kochi-substitute

For Chinese:

# emerge media-fonts/arphicfonts

For Korean:

# emerge media-fonts/baekmuk-fonts

Keymap

Funtoo Linux defaults to a US English keyboard. If you are using another type of keyboard, edit /etc/conf.d/keymaps and set keymap to your keyboard model. For example, cf for French Canadian keyboard, fr for French Azerty.

# nano -w /etc/conf.d/keymaps

Input Method

ibus is an Intelligent Input Bus for Linux.

# emerge -av ibus

You also need to install language table for ibus (Chinese)

# emerge -av ibus-table-chinese