Adicionando um idioma

Preparação

If the language you want to translate has not been started by someone else already and you wish to create a set of new files for the desired language, say “fr” (French), then you must first use the environment you have created, as guided in Getting Started, in particular Instalando as dependências and Building the Manual sections.

This will give you a foundation environment for:

  • Criando um novo conjunto de tradução à partir do material em Inglês

  • Execute o comando ``make”” para transformar textos traduzidos em arquivos po, em arquivos html para testes locais.

  • Atualizar as mudanças nos textos em inglês que foram adicionados por outros colaboradores.

Os exemplos abaixo mostram o processo para criar um novo conjunto de arquivos para o francês, idioma de código fr, na plataforma Linux. Outras plataformas podem variar um pouco, mas devem ser basicamente as mesmas.

  1. Create a Blender ID if you have not done so already

  2. Log into projects.blender.org and Create an Issue requesting for commit access in order to transfer changes to the central repository of the translation team.

  3. Open an instance of a console application.

  4. Change the current working directory to the directory of blender-manual, where the instance of Makefile resides.

Trying the Make Process to Create HTML Files in English

  1. Certifique-se de que a instância anterior do diretório ``build”” seja removida, se existir alguma:

    make clean
    
  2. Converte todos os arquivos rst em arquivos de tradução pot:

    make gettext
    
  3. Cria arquivos html`:

    make html
    
  4. After this, you can actually view the created html files locally by opening the blender-manual/build/html/index.html file.

Criar a Entrada de Idioma no Menu HTML

  1. Create an entry for the language in the html menu by opening file ./resources/theme/js/version_switch.js (assuming you are at the blender-manual subdirectory).

  2. Encontre a table para os idiomas em var all_langs = {..};.

  3. Digite a entrada: "fr": "Français",, ("fr": "Français"). (Repare nos caracteres Unicode).

  4. Commit the updated file:

    git add ./resources/theme/js/version_switch.js
    git commit -m "HTML: Add French to language menu"
    
  5. Push your changes to the upstream repository:

    git push
    

Geração do conjunto de arquivos para a língua escolhida

  1. Confira o repositório de tradução atual usando o comando:

    git clone https://projects.blender.org/blender/blender-manual-translations.git locale
    

    This will download all language sets available in the repository into the locale directory of your drive. You can go to the locale directory to see the hidden subdirectory .git within it, together with directories of languages. You’ll need to add your own set of files for the language you are trying to translating to.

  2. From the blender-manual directory to generate a set of files for fr language:

    make update_po
    

    Estes arquivos ainda estão apenas em inglês, com todas as entradas msgstr em branco.

  3. Submeter novo conjunto de arquivos ao repositório central:

    cd locale
    git add fr
    git commit -m "Initial commit language set of files for French"
    

Dica

  • Recomenda-se fazer duas variáveis de ambiente para estes diretórios, no .bashrc`, para tornar mais conveniente para alterar ou scriptar comandos batch/shell para o processo de tradução e revisão:

    export BLENDER_MAN_EN=$HOME/<directory to make file directory above>/blender-manual
    export BLENDER_MAN_FR=$BLENDER_MAN_EN/locale
    
  • Newly generated files will contain some placeholders for authors and revision dates etc. If you find the job of replacing them repetitive, make use of the script change_placeholders.sh in the subdirectory ~/blender-manual/tools_maintenance, make a copy of that to your local bin directory and replace all values that were mentioned in the file with your specific details, then after each change to a file, you would do following commands to update the file with your personal details, revision date and time, plus generating the html files for your language, which you can view using your Internet browser:

    $HOME/bin/change_placeholders.sh $BLENDER_MAN_FR
    make -d --trace -w -B -e SPHINXOPTS="-D language='fr'" 2>&1