Difference between pages "Switching gcc" and "Funtoo Linux Localization/pt-br"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
== Definir Idioma Padrão ==


== How to switch the gcc version for a specific task ==
No Funtoo, há dois arquivos de configuração responsáveis suas configurações de idioma: <code>/etc/locale.gen</code> e <code>/etc/env.d/00basic</code>. O primeiro arquivo contém somente en_US.UTF-8 locale habilitado. O ultimo é um arquivo padrão embarcado que vem a partir do stage3 e responsável pelo en_US.UTF-8 locale system-wide. não recomendado editar.
Os passos a seguir lhe guiarão através do processo de editar o idioma padrão do sistema (default system language), utilizando o francês canadense como um exemplo.
Primeiro você terá que editar <code>/etc/locale.gen</code>:
<console>
# ##i##nano -w /etc/locale.gen
</console>
Especifique sua localidade preferida com o formato de caracter acompanhante (Você vai preferir principalmente UTF-8):
{{fancynote|É recomendado manter o en_US.UTF-8 locale pré-configurado com um fallback.}}
{{file|name=/etc/locale.gen|body=
en_US.UTF-8 UTF-8
fr_CA.UTF-8 UTF-8
}}
Para determinar uma localidade apropriada para o seu sistema, você deve dar uma olha em <code>/usr/share/i18n/SUPPORTED</code> para a lista padrão de combinações suportadas  ou verifique o diretório <code>/usr/share/i18n/locales/</code> para uma lista de valores válidos.
{{fancywarning|Lhe é altamente aconcelhado usar ''ao menos uma'' localidade UTF-8 desde que algumas aplicações possam exigi-la.}}


This article describes how you can switch the [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] version.
Agora, essas localidades precisam ser geradas:
Let's assume, you want to use gcc-4.4.5, but your main [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] version is 4.6:
<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>


Uma vez feito, você pode aplicar suas configurações de localidade do system (locale settings system-wide). Primeiro exiba todas as opções disponíveis:
<console>
$ ##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>
O asterisco azul indica a localidade atual padrão do sistema. Você pode agora alterá-lo de acordo com o que desejar:
<console>
# ##i##eselect locale set 3
Setting LANG to fr_CA.utf8 ...
Run ". /etc/profile" to update the variable in your shell.
</console>
Alternativamente, você pode definir a localidade padrão manualmente. Esse arquivo deve primeiro ser criado com o seu editor preferido:
{{file|name=/etc/env.d/02locale|body=LANG="fr_CA.utf8"}}
Você pode verificar suas ações utilizando:
<console>
<console>
# ##i##gcc --version
$ ##i##eselect locale show
gcc (Gentoo 4.6.2-r1 p1.4, pie-0.5.0) 4.6.2
##b####g##LANG variable in profile:
Copyright (C) 2011 Free Software Foundation, Inc.
  ##b##fr_CA.utf8
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</console>
</console>


So - what to do? The best and safest way is to switch your [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] version temporarily to the same version that is used by the upstream project.
Para um efeito imediato é necessário recarregar o ambiente:
<console>
# ##i##env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...
</console>
Parabéns! Você definiu com sucesso seu idioma padrão no Funtoo.


To do that, we use the tool gcc-config. First, we'll have a look on what versions are available on your system. Install the desired version of [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] explicitly:
== Configurações do Portage ==
 
Portage utiliza uma variável especial <code>LINGUAS</code> que define quais localizações/traduções são instaladas por padrão. Por padrão, <code>LINGUAS</code> em unset, a qual resultará em ''todas'' localizações disponíveis sendo instaladas pelo Portage.
 
É possível personalizar as configurações de <code>LINGUAS</code> ao configurá-la em <code>/etc/make.conf</code>:


<console>
<console>
# ##i##emerge =sys-devel/gcc-4.4.5*
# ##i##LINGUAS="en_US zh_CN"
</console>
</console>


After emerging, you can see that it is installed with <tt>gcc-config</tt>:
A variável <code>LINGUAS</code> deve utilizar espaços entre cada nome de localização.
 
== Leia Seu Idioma ==
 
Um Funtoo Linux novinho instalado não habilita para ler todos os idiomas. Você quer ler as coisas, digamos, no Mozilla Firefox. Você precisa instalar as fonts - Um bom sinal de que você não instalou as fonts adequadas é que os caracteres a seguir aparecem como caixas com números dentro delas: 日本語フォント
 
Verifique se você possui o idioma instalado (Chinês) ao utilizar o comando <tt>fc-list</tt> a partir do ebuild <tt>media-libs/fontconfig</tt> ebuild:


<console>
<console>
# ##i##gcc-config --list-profiles
# ##i##fc-list :lang=zh
[1] x86_64-pc-linux-gnu-4.4.5
[2] x86_64-pc-linux-gnu-4.6.2 *
#
</console>
</console>


This list shows the versions of gcc that are now installed. The new compiler is now available and can be called as <tt>gcc-4.4.5</tt>. But the default system compiler (what you get when you call <tt>gcc</tt>) is set to 4.6.2. Like with other Funtoo tools, the asterisk marks the currently active version of gcc.  
Se você estiver com sorte, a font correta será instalada, e seus aplicativos também serão capazes de utilizar chinês como o idioma padrão. Mas em caso de você não possuir as fonts corretas instaladas desta maneira, você precisa instalá-las manualmente.


If possible, it is best to modify Makefiles and change the <tt>CC</tt> variable to force any required sources to use <tt>gcc-4.4.5</tt> instead of <tt>gcc</tt> to build. This is a non-invasive change that will be local to your current project, which is the preferred way to make these types of build changes. This is the mechanism we use for building Enterprise kernels that build cleanly with earlier versions of gcc.
Para japonês:


== Changing Default gcc ==
<console>
# ##i##emerge media-fonts/kochi-substitute
</console>


Again, this is not recommended as it will affect the default <tt>gcc</tt> version that the entire system will use. Use this with caution. It is also not supported to run Funtoo Linux with a non-standard system compiler, sicne we are not testing it.
Para chinês:
<console>
# ##i##emerge media-fonts/arphicfonts
</console>


Before you switch your [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] version, it is very important that you make a note about what version was the active one before, so you can easily switch it back to the profiles default after you're done.
Para Coreano:


To switch the version to 4.4.5, we make use of gcc-config again. You can define the version you want to switch to either by giving the number printed before the listed version in the output of <code>gcc-config --list-profiles</code> or by entering the whole string. So, giving <code>1</code> or <code>x86_64-pc-linux-gnu-4.4.5</code> to gcc-config leads to the same result:
<console>
# ##i##emerge media-fonts/baekmuk-fonts
</console>


<console>
== Mapa de teclado (Keymap) ==
# ##i##gcc-config 1
* Switching native-compiler to x86_64-pc-linux-gnu-4.4.5 ...
>>> Regenerating /etc/ld.so.cache...                                                                            [ ok ]


* If you intend to use the gcc from the new profile in an already
O Funtoo Linux padroniza para um teclado inglês americano (US English). Se você estiver utilizando um outro tipo de teclado, edite <tt>/etc/conf.d/keymaps</tt> e defina o keymap para o seu modelo de tecladoto. Por exemplo, cf Para o teclado do francês canadense (French Canadian), fr Para francês azerty (French Azerty).
* running shell, please remember to do:


# source /etc/profile
<console>
#>
# ##i##nano -w /etc/conf.d/keymaps
</console>
</console>


Like it's already suggested in the output from above, the next and last step is to refresh your environment to make use of this switch. You may either issue the following two commands or open another login shell for this. No matter what you do, you should verify that the active [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] version is the one you wanted to switch to:
== Input Method ==
 
ibus is an Intelligent Input Bus for Linux.


<console>
<console>
# ##i##gcc --version
# ##i##emerge -av ibus
gcc (Gentoo 4.6.2-r1 p1.4, pie-0.5.0) 4.6.2
</console>
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


# ##i##source /etc/profile
You also need to install language table for ibus (Chinese)
# ##i##env-update
>>> Regenerating /etc/ld.so.cache...
# ##i##gcc --version
gcc (Gentoo 4.4.5 p1.3, pie-0.4.5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


#
<console>
# ##i##emerge -av ibus-table-chinese
</console>
</console>


As you see here, the current shell is using [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] version 4.4.5 only after you have refreshed your environment. Now you can build your packages / source which need this specific version of [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc].
[[Category:Install|Localization]]
 
It is important that you reset the [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] version back to the default of your profile. To do that, simply reply the above steps again but this time, use your profile's default version of [http://en.wikipedia.org/wiki/GNU_Compiler_Collection gcc] to switch to.

Revision as of 22:16, February 5, 2015

Definir Idioma Padrão

No Funtoo, há dois arquivos de configuração responsáveis suas configurações de idioma: /etc/locale.gen e /etc/env.d/00basic. O primeiro arquivo contém somente en_US.UTF-8 locale habilitado. O ultimo é um arquivo padrão embarcado que vem a partir do stage3 e responsável pelo en_US.UTF-8 locale system-wide. não recomendado editar. Os passos a seguir lhe guiarão através do processo de editar o idioma padrão do sistema (default system language), utilizando o francês canadense como um exemplo. Primeiro você terá que editar /etc/locale.gen:

root # nano -w /etc/locale.gen

Especifique sua localidade preferida com o formato de caracter acompanhante (Você vai preferir principalmente UTF-8):

   Note

É recomendado manter o en_US.UTF-8 locale pré-configurado com um fallback.

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

Para determinar uma localidade apropriada para o seu sistema, você deve dar uma olha em /usr/share/i18n/SUPPORTED para a lista padrão de combinações suportadas ou verifique o diretório /usr/share/i18n/locales/ para uma lista de valores válidos.

   Warning

Lhe é altamente aconcelhado usar ao menos uma localidade UTF-8 desde que algumas aplicações possam exigi-la.

Agora, essas localidades precisam ser geradas:

root # 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

Uma vez feito, você pode aplicar suas configurações de localidade do system (locale settings system-wide). Primeiro exiba todas as opções disponíveis:

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

O asterisco azul indica a localidade atual padrão do sistema. Você pode agora alterá-lo de acordo com o que desejar:

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

Alternativamente, você pode definir a localidade padrão manualmente. Esse arquivo deve primeiro ser criado com o seu editor preferido:

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

Você pode verificar suas ações utilizando:

user $ eselect locale show
root ##b##LANG variable in profile:
  fr_CA.utf8

Para um efeito imediato é necessário recarregar o ambiente:

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

Parabéns! Você definiu com sucesso seu idioma padrão no Funtoo.

Configurações do Portage

Portage utiliza uma variável especial LINGUAS que define quais localizações/traduções são instaladas por padrão. Por padrão, LINGUAS em unset, a qual resultará em todas localizações disponíveis sendo instaladas pelo Portage.

É possível personalizar as configurações de LINGUAS ao configurá-la em /etc/make.conf:

root # LINGUAS="en_US zh_CN"

A variável LINGUAS deve utilizar espaços entre cada nome de localização.

Leia Seu Idioma

Um Funtoo Linux novinho instalado não habilita para ler todos os idiomas. Você quer ler as coisas, digamos, no Mozilla Firefox. Você precisa instalar as fonts - Um bom sinal de que você não instalou as fonts adequadas é que os caracteres a seguir aparecem como caixas com números dentro delas: 日本語フォント

Verifique se você possui o idioma instalado (Chinês) ao utilizar o comando fc-list a partir do ebuild media-libs/fontconfig ebuild:

root # fc-list :lang=zh

Se você estiver com sorte, a font correta será instalada, e seus aplicativos também serão capazes de utilizar chinês como o idioma padrão. Mas em caso de você não possuir as fonts corretas instaladas desta maneira, você precisa instalá-las manualmente.

Para japonês:

root # emerge media-fonts/kochi-substitute

Para chinês:

root # emerge media-fonts/arphicfonts

Para Coreano:

root # emerge media-fonts/baekmuk-fonts

Mapa de teclado (Keymap)

O Funtoo Linux padroniza para um teclado inglês americano (US English). Se você estiver utilizando um outro tipo de teclado, edite /etc/conf.d/keymaps e defina o keymap para o seu modelo de tecladoto. Por exemplo, cf Para o teclado do francês canadense (French Canadian), fr Para francês azerty (French Azerty).

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

Input Method

ibus is an Intelligent Input Bus for Linux.

root # emerge -av ibus

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

root # emerge -av ibus-table-chinese