Difference between revisions of "GettextParaTradutores"

From The Battle for Wesnoth Wiki
(Gettext para tradutores)
(Gettext para tradutores)
Line 1: Line 1:
 
Este arquivo está em processo de tradução para o português brasileiro. Edite à vontade.
 
Este arquivo está em processo de tradução para o português brasileiro. Edite à vontade.
  
== Gettext para tradutores  ==
+
== Os text-domains ==
 
 
 
A tradução de Battle for Wesnoth é dividida em alguns domínios-texto (''text-domain''):
 
A tradução de Battle for Wesnoth é dividida em alguns domínios-texto (''text-domain''):
 
* wesnoth
 
* wesnoth
Line 9: Line 8:
 
* mais um domínio-texto para cada campanha. Os nomes desses domínios-texto são constituídos pela palavra "wesnoth" mais a abreviação comum da campanha em inglês (wesnoth-ei, wesnoth-httt, wesnoth-trow, wesnoth-tb, wesnoth-tsg e wesnoth-utbs).
 
* mais um domínio-texto para cada campanha. Os nomes desses domínios-texto são constituídos pela palavra "wesnoth" mais a abreviação comum da campanha em inglês (wesnoth-ei, wesnoth-httt, wesnoth-trow, wesnoth-tb, wesnoth-tsg e wesnoth-utbs).
  
 +
== Os arquivos do SVN ==
 
Usaremos a tradução Sueca (sv) e o domínio ''wesnoth'' como exemplo nessa página.
 
Usaremos a tradução Sueca (sv) e o domínio ''wesnoth'' como exemplo nessa página.
 
Existem três importantes arquivos para cada domínio-texto:
 
Existem três importantes arquivos para cada domínio-texto:
Line 15: Line 15:
 
* ''{translations_dir}/sv/LC_MESSAGES/wesnoth.gmo'', que é a versão binária do <lang>.po que o jogo irá usar por razões de eficácia. Esse arquivo não é encontrado no cvs, mas é criado durante a compilação do jogo.
 
* ''{translations_dir}/sv/LC_MESSAGES/wesnoth.gmo'', que é a versão binária do <lang>.po que o jogo irá usar por razões de eficácia. Esse arquivo não é encontrado no cvs, mas é criado durante a compilação do jogo.
  
O primeiro desses arquivos podemos atualizar de vez em quando, quando há um texto novo ou modificado. Como, por exemplo, quando um cenário de nova campanha atinge o SVN
+
=== Atualizando os arquivos no SVN ===
 +
O primeiro desses arquivos podemos atualizar de vez em quando, quando há um texto novo ou modificado. Como, por exemplo, quando um cenário de nova campanha atinge o SVN.
  
 
Então, ''msgmerge'' é usado para fundir esse novo "estado das strings do jogo" com suas traduções correspondetes, e gerando um novo, e ataulizado, ''sv.po''.
 
Então, ''msgmerge'' é usado para fundir esse novo "estado das strings do jogo" com suas traduções correspondetes, e gerando um novo, e ataulizado, ''sv.po''.
Line 23: Line 24:
 
"make -C po update-po" executa esses três passos de uma vez só.
 
"make -C po update-po" executa esses três passos de uma vez só.
  
 +
== Os arquivos PO ==
 
That was for the "Big Picture".
 
That was for the "Big Picture".
 
But you really just need to be concerned with the po file:
 
But you really just need to be concerned with the po file:
Line 29: Line 31:
 
You really don't need to bother with any of these commands, unless you want to compile gmo files to check in-game.
 
You really don't need to bother with any of these commands, unless you want to compile gmo files to check in-game.
  
 +
== Enviando as traduções ==
 
Ivanovic is now responsible for integrating translations into Wesnoth, with the help of Torangan and ott.
 
Ivanovic is now responsible for integrating translations into Wesnoth, with the help of Torangan and ott.
 
You should contact Ivanovic (crazy-ivanovic AT gmx DOT net), and he'll put them in the game.
 
You should contact Ivanovic (crazy-ivanovic AT gmx DOT net), and he'll put them in the game.

Revision as of 19:31, 25 September 2010

Este arquivo está em processo de tradução para o português brasileiro. Edite à vontade.

Os text-domains

A tradução de Battle for Wesnoth é dividida em alguns domínios-texto (text-domain):

  • wesnoth
  • wesnoth-editor
  • wesnoth-lib (contém expressões (strings) compartilhados pelo jogo e pelo editor)
  • mais um domínio-texto para cada campanha. Os nomes desses domínios-texto são constituídos pela palavra "wesnoth" mais a abreviação comum da campanha em inglês (wesnoth-ei, wesnoth-httt, wesnoth-trow, wesnoth-tb, wesnoth-tsg e wesnoth-utbs).

Os arquivos do SVN

Usaremos a tradução Sueca (sv) e o domínio wesnoth como exemplo nessa página. Existem três importantes arquivos para cada domínio-texto:

  • arquivo wesnoth/wesnoth.pot, que contém todas as strings usadas pelo jogo principal (não contém as strings do editor nem as strings das campanhas). Você pode ver como se parece um arquivo .pot no SVN: Current SVN version.
  • wesnoth/sv.po, o arquivo contendo a tradução, Você pode ver como se parece um arquivo .po no SVN: Current SVN version.
  • {translations_dir}/sv/LC_MESSAGES/wesnoth.gmo, que é a versão binária do <lang>.po que o jogo irá usar por razões de eficácia. Esse arquivo não é encontrado no cvs, mas é criado durante a compilação do jogo.

Atualizando os arquivos no SVN

O primeiro desses arquivos podemos atualizar de vez em quando, quando há um texto novo ou modificado. Como, por exemplo, quando um cenário de nova campanha atinge o SVN.

Então, msgmerge é usado para fundir esse novo "estado das strings do jogo" com suas traduções correspondetes, e gerando um novo, e ataulizado, sv.po.

Após, uma ferramenta chamada msgfmt é rodada, que gera um novo arquivo wesnoth.gmo a partir do arquivo wesnoth.po, que será usado após o jogo ser instalado.

"make -C po update-po" executa esses três passos de uma vez só.

Os arquivos PO

That was for the "Big Picture". But you really just need to be concerned with the po file: translating new strings, checking "fuzzy" entries. We can handle the administrative tasks of updating etc. You really don't need to bother with any of these commands, unless you want to compile gmo files to check in-game.

Enviando as traduções

Ivanovic is now responsible for integrating translations into Wesnoth, with the help of Torangan and ott. You should contact Ivanovic (crazy-ivanovic AT gmx DOT net), and he'll put them in the game.

When sending po files to a maintainer to be included in SVN, please create a zip or tar.gz/bz2 archive that you attach, rather than cutting and pasting the translations into an email. The translated strings are very sensitive to formatting and the archive will also help distinguish which file is which when sending more than one po file.

FAQ

  • O que é uma "fuzzy string"?
    • É uma expressão (string) que foi marcada para revisão de tradução. Por exemplo, se foi feita uma pequena alteração e foi rodado o comando msgmerge, ele irá marcar a tradução como "fuzzy". Quando o modelo de tradução foi mudado para gettext, todas as transações foram marcadas como "fuzzy". ALém disso, a maioria dos editores tem como opção, o próprio editor colocar a string como "fuzzy", caso ele não tenha certeza de alguma tradução.
  • O que são as "Plural-forms"?
    • Alguns idiomas (como o português) tem diferentes formas de palavra para diferentes números de coisas (por exemplo, em português nós temos "1 coisa", mas "2 coisas"). As regras são diferentes para diferentes idiomas. Você pode achá-las aqui.
  • O que eu faço para inserir uma nova linha numa expressão?
    • Se você quer inserir uma nova linha numa string, você precisa incluir duas aspas (""). Você pode usar normalmente novas linhas, sem afetar a tradução.
  • Como eu uso ', uma vez que um apóstrofo delimita o início e fim de uma string no texto?
    • Adicione uma contrabarra antes dele (fica assim: \').
  • O que eu faço com strings como "Prefs section^General"?
    • There are ambiguous strings which should be translated in a different way depending on where they appear. For example, we have "General" in the preferences as "General preferences" and we can also have "a General". These strings can have different translations for a given language, so we use "context" to solve this. The prefix only tries to give a hint about the string, and should be not translated, for example:
  msgid "Prefs section^General"
  msgstr "General"
  • Com quem eu falo para maiores informações?
    • Pode falar com Ivanovic, Torangan, ott, Yann ou Isaac no IRC (irc.freenode.net, #wesnoth or #wesnoth-dev). Se não gosta do IRC, mande um e-mail para crazy-ivanovic AT gmx DOT net, ou mande uma mensagem privada para ele (ivanovic) no fórum.
  • How do I quickly test PO file changes?
    • When you modify a PO file, run "make update-gmo" in the main po directory to create a new MO file, then run "make install" there to install the new MO file.
    • Then force cache rebuild. This is tricky -- if you only update MO files, the game may use a cached (i.e., old) version letting you wonder why it still displays the old translation. Either change game.cfg modification time, e.g. with "touch /usr/local/share/wesnoth/game.cfg", or delete the corresponding cache[s] in ~/.wesnoth/cache.
  • The .po file in SVN has changed, how do I move over the translations I've made?
    • If your file with additional translations is called old.po and the new file from SVN is called svn.po, create a new file called new.po by doing
  msgmerge -o new.po old.po svn.po

The new file new.po will keep your translations from old.po as well as the new strings from svn.po, but check the result -- some translations will not be possible to move across if the original strings changed, these are kept as comments at the end of the file.

  • How to generate man files from wesnoth-man(current 1.3 trunk) .po files?

To create "real" manpages out of the po files you have to install a prog named "po4a" and run make update-po4a inside the maindir before running make and make install. They are not automatically created out of po files. With that command the files will be created and afterwards installed.

Note: At least 80% of the .po file must be translated for the creation of a man file

  • Why svn diff is so huge? I have only made a small change to the .po file with poedit.
    • When saving .po file poedit unwraps all strings. Usually, all .po files are wrapped at 80 characters so if you want smaller diffs and less merge conflicts you can execute the following commands each time after editing with poedit:
  msgattrib file.po > file.po1
  mv file.po1 file.po

Ferramentas

Existem várias ferramentas para se trabalhar com arquivos .po:

Obviamente, você pode editar os arquivos .po com qualquer editor de texto UTF-8. Entrataneto, as ferramentas listadas acima possuem grandes vantagens sobre qualquer editor quando se trata de tradução por arquivos .po como, por exemplo, ir à próxima string fuzzy/não-traduzida ou pesquisa em campos específicos (msgid, msgstr, comment)...

Veja também