Difference between pages "Creating Profiles" and "Funtoo Linux Localization/pt-br"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
m (Drobbins moved page Custom Profiles to Creating Profiles)
 
 
Line 1: Line 1:
Want to create your own custom profiles? Thought up a mix-in that's not currently in the Funtoo profiles? Have an overlay with profiles and want to make it easy for people to use them? Well you've come to the right place. This article will show you how to easily add you own profiles. No more ugly hacking of parent files and other nonsense. Once you follow this guide, not only will portage easily recognize your profiles, they will also show up in eselect right along with the ones from the main tree.
== Definir Idioma Padrão ==


== How to do it ==
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.
=== Rules to follow ===
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.
#You will need a version of [[Package:Eselect|eselect]] that supports Funtoo profiles (already integrated into Funtoo Linux.)
Primeiro você terá que editar <code>/etc/locale.gen</code>:
#Your overlay must have a profiles directory. It must include a repo_name file with the name of your overlay.  
<console>
#Your profiles must be inside of the profiles directory
# ##i##nano -w /etc/locale.gen
#You need a profiles.eselect.desc file inside the profiles directory. See profiles.eselect.example in your Funtoo Portage tree for instructions.
</console>
#If you're creating profiles of types arch, build, flavor, or mix-ins, your profile must be inside a directory with same name, such as <tt>profiles/my_profile/flavor/new_profile</tt>, <tt>profiles/my_profile/mix-ins/subdir/profile</tt>.
Especifique sua localidade preferida com o formato de caracter acompanhante (Você vai preferir principalmente UTF-8):
# Currently <tt>NoMix</tt> (see <tt>profiles.eselect.example</tt>) is only supported for profiles in the same tree.
{{fancynote|É recomendado manter o en_US.UTF-8 locale pré-configurado com um fallback.}}
# If you're not using a standard Funtoo tree, you must ensure that your main Portage tree has <tt>profile-formats = portage-2</tt> set in <tt>metadata/layout.conf</tt> in order for portage to interpret the <repo_name>:<profile> syntax.
{{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.}}


=== Example of how to set up ===
Agora, essas localidades precisam ser geradas:
For our example we will create a mix-ins profile called 'fake_pro' in a local overlay called 'local_overlay'. fake_pro will set the 'dummy' USE flag globally and also set the 'fake' USE flag on sys-apps/not-exist. We will then add the profile to eselect so it's visible when running 'eselect profile'.
<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>


==== Creating the profile ====
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:
We will use ''<code>${OVERLAY_DIR}</code>'' as the path to local_overlay. These instructions assume the overlay exists.
<console>
If you haven't set a name for your overlay, do that first:
$ ##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>
<console>
###i## echo "local_overlay" > ${OVERLAY_DIR}/profiles/repo_name
# ##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>
$ ##i##eselect locale show
##b####g##LANG variable in profile:
  ##b##fr_CA.utf8
</console>
</console>


Next lets create a directory to store our profile. Since we're creating a 'mix-ins' profile we need to make sure our profile is inside a 'mix-ins' subdirectory. This is a requirement in order to ensure that the profile will show up in eselect. If your not planning on using eselect then there's no requirement to use 'mix-ins'
Para um efeito imediato é necessário recarregar o ambiente:
<console>
<console>
###i## install -d ${OVERLAY_DIR}/profiles/my_profiles/mix-ins/fake_pro
# ##i##env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...
</console>
</console>
Parabéns! Você definiu com sucesso seu idioma padrão no Funtoo.
== 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>:


Now that we have a directory for our profile, lets go ahead and add our settings. Global USE settings go in ''<code>make.defaults</code>'', package specific USE settings go in ''<code>package.use</code>'':
<console>
<console>
###i## cd ${OVERLAY_DIR}/profiles/my_profiles/mix-ins/fake_pro
# ##i##LINGUAS="en_US zh_CN"
###i## echo 'USE="$USE dummy"' >> make.defaults
###i## echo 'sys-apps/not-exist fake' >> package.use
</console>
</console>
Note that no matter if your using funtoo or gentoo, profile settings all work the same. For more information please check the portage man page.


==== Adding to eselect ====
The <code>LINGUAS</code> variable should use spaces between each localization name.
eselect reads from the file ''<code>profiles.eselect.desc</code>'' in your profiles/ directory. Format is "Type Name Status NoMix" space-separated. For more information look in ''<code>/usr/portage/profiles/profiles.eselect.example</code>'':
 
== 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 <tt>fc-list</tt> command from the <tt>media-libs/fontconfig</tt> ebuild:
 
<console>
<console>
###i## echo 'mix-ins my_profiles/mix-ins/fake_pro testing' >> ${OVERLAY_DIR}/profiles/profiles.eselect.desc
# ##i##fc-list :lang=zh
</console>
</console>
Watch the result:
 
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## eselect profile list
# ##i##emerge -av ibus-table-chinese
</console>
</console>


[[Category:Portage]]
[[Category:Install|Localization]]
[[Category:Labs]]
[[Category:HOWTO]]
[[Category:Featured]]

Revision as of 21:43, 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"

The LINGUAS variable should use spaces between each localization name.

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:

root # fc-list :lang=zh

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:

root # emerge media-fonts/kochi-substitute

For Chinese:

root # emerge media-fonts/arphicfonts

For Korean:

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

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