diff --git a/documentation/content/en/books/fdp-primer/weblate/_index.adoc b/documentation/content/en/books/fdp-primer/weblate/_index.adoc index 83b234910c..b1578008dc 100644 --- a/documentation/content/en/books/fdp-primer/weblate/_index.adoc +++ b/documentation/content/en/books/fdp-primer/weblate/_index.adoc @@ -1,487 +1,487 @@ --- title: Chapter 10. Weblate Translations prev: books/fdp-primer/po-translations next: books/fdp-primer/manual-pages description: "How to join the FreeBSD translators team and translate online on Weblate" tags: ["weblate", "po", "translations", "tutorial", "quick start"] showBookMenu: true weight: 10 path: "/books/fdp-primer/" --- [[weblate-translations]] = Weblate Translations :doctype: book :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :sectnumoffset: 10 :partnums: :source-highlighter: rouge :experimental: :images-path: books/fdp-primer/ ifdef::env-beastie[] ifdef::backend-html5[] :imagesdir: ../../../../images/{images-path} endif::[] ifndef::book[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] toc::[] endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] toc::[] include::../../../../../shared/asciidoctor.adoc[] endif::[] [[weblate-introduction]] == Introduction This chapter describes some basic steps for joining the FreeBSD translators team, translating online on Weblate or offline, and some simple suggestions on translating, proofreading, and testing. It's focused on the translation part. The original documents (articles and books) are in the {main-site}[documentation portal]. https://weblate.org/en/[Weblate] is web-based open-source software focused on localization; the FreeBSD project runs a local instance. [[weblate-become-translator]] == How to Become a FreeBSD Translator Following are simple steps to start translating articles and books of the FreeBSD Documentation Project. . Create an account on the https://translate-dev.freebsd.org/[FreeBSD Weblate instance] with an email address or your GitHub account. . Subscribe to the {freebsd-translators}. . Introduce yourself and ask to join a language team. If the language team does not exist, ask to create it. The self-introduction is essential. It raises your chances of being approved for write access. . Login to https://translate-dev.freebsd.org/[Weblate] with the new account. . Find the language team and choose an initial document to translate. . Create a Bugzilla account to submit the translations after finishing a document. The Documentation project is also accepting GitHub Pull Requests with translation submissions. [WARNING] ==== All translation files and documents must follow https://www.freebsd.org/copyright/freebsd-doc-license/[The FreeBSD Documentation License]; if this is unacceptable, please do not sign up or send any patches or translations. ==== [[weblate-introduce-yourself]] == Introduce Yourself Please provide a brief self-introduction on the {freebsd-translators} to initiate the process of granting access. This will enable a language coordinator or administrator to provide the necessary permissions for the new user of Weblate to start translating. Following is an example of how such an email could look. [.programlisting] .... Subject: Self-Introduction: Name and language Name: Name (use preferred name) Location: City, country (optional) Login: username or email (essential) Language: Language to translate (essential) Profession or student status: (optional) About You: (free format -- info which you feel comfortable sharing with others: company, school, other affiliation, historical qualifications, other projects you have worked on, level and type of computer skills, other relevant skills, etc.) You and the FreeBSD Project: (free format: other FreeBSD projects of interest, comments, etc.) .... [[weblate-login]] == Login to Weblate Open https://translate-dev.freebsd.org/[] and `Sign in`. -image::weblate-login.webp[Weblate Login,800] +image::weblate-login.png[Weblate Login,800] Use a username, email address, or GitHub account to log in. The user profile contains your preferences, name, and email address. The name and address will be used in commits; keep this information accurate. On the FreeBSD Weblate instance, all translations will be committed to https://github.com/freebsd/freebsd-doc-translate[freebsd-doc-translate] (an intermediate repository on GitHub), not directly to https://github.com/freebsd/freebsd-doc[freebsd-doc]. Translators must take the PO gettext files (`.po`), converting them to `.adoc` and submit it via https://bugs.freebsd.org/bugzilla/[Bugzilla] or https://github.com/freebsd/freebsd-doc/pulls[GitHub] to get the translated document published or updated in the documentation portal. See more in the following sections. Weblate will commit daily, at least to `freebsd-doc-translate`, if any new strings are translated. [[weblate-find-language-team]] == Find a Language Team to Join In Click `Projects`, choose `Documentation`, then click `Languages`, and see all the available languages. -image::weblate-languages.webp[Weblate Languages,500] +image::weblate-languages.png[Weblate Languages,500] Note that some languages and translated documents already exist in the documentation portal and repositories. If the desired language for translation is not available in Weblate, please contact the https://www.freebsd.org/docproj/translations/[language coordinators] before asking to create a new language. If there is no answer, then write to the {doceng}. [[weblate-translating-online]] == Translating Online on Weblate Translating documents online proves to be the easiest method for document translation on FreeBSD, as it allows users to collaborate on the same file, distributing the workload. Once a coordinator or administrator grants access to a specific language for a username, the save button will be enabled, so that this user can start translating. -image::weblate-documents.webp[Weblate Documents,800] -image::weblate-translate.webp[Weblate Translate,800] +image::weblate-documents.png[Weblate Documents,800] +image::weblate-translate.png[Weblate Translate,800] Weblate has a set of links that lead to actual translation. The translation is further divided into individual checks, like `Untranslated` or `Needing review`. If the whole document is translated without any error, `All translations` link is still available in case a review is necessary. Alternatively, the search field can be used to find a specific string or term. In the https://docs.weblate.org/en/latest/user/translating.html#translation-projects[Weblate documentation], there is more info about translations, like keyboard shortcuts and other tips about the translation tool. [[weblate-translating-offline]] == Translating Offline Weblate on FreeBSD uses PO gettext files for translations. Users familiar with PO gettext files that want to translate offline can download and upload the translations through the document page on Weblate by clicking in the `Files` section. -image::weblate-offline.webp[Weblate Offline,800] +image::weblate-offline.png[Weblate Offline,800] [[weblate-automatic-suggestions]] == Translation based on Automatic Suggestions Languages using Weblate before the migration to Hugo/Asciidoctor can use this feature from Weblate to save time. This feature from Weblate uses the Translation Memory generated by the other components and projects on the same server. The former Weblate translations are hosted on the same server as read-only for that. Strings that match `100/100` in similarity can be copied and saved directly. Other strings will need at least minor adjustment. Some examples: -image::weblate_automatic_suggestion_01.webp[Weblate Automatic Suggestions 01,800] +image::weblate_automatic_suggestion_01.png[Weblate Automatic Suggestions 01,800] With the migration to Hugo/Asciidoctor, documents use UTF-8. Some HTML entities should be replaced. Some strings, such as links, require changes to markup. -image::weblate_automatic_suggestion_02.webp[Weblate Automatic Suggestions 02,800] +image::weblate_automatic_suggestion_02.png[Weblate Automatic Suggestions 02,800] Links: -image::weblate_automatic_suggestion_03.webp[Weblate Automatic Suggestions 03,800] +image::weblate_automatic_suggestion_03.png[Weblate Automatic Suggestions 03,800] [[weblate-proofreading-qa]] == Proofreading and Weblate Quality Checks The document dashboard `Project/Language/Document` shows the translation status and string status for that document. This page is handy for proofreading and quality checks. -image::weblate-revision1.webp[Weblate Revision 01,800] +image::weblate-revision1.png[Weblate Revision 01,800] In this example, two strings are missing the full stop; following that link will show only those strings to be revised/translated. -image::weblate-revision2.webp[Weblate Revision 02,800] +image::weblate-revision2.png[Weblate Revision 02,800] Translators and reviewers often value observing translated strings in context. [[weblate-building]] == Building the Translated Document The project does not use continuous integration and continuous delivery to build translations. There are studies to make it available. [NOTE] ==== The following example uses GitHub, as Weblate is also on GitHub. Note that this repository is a read-only mirror, but Pull Requests are accepted. ==== To build the translation locally, follow these steps: [[weblate-clone-repositories]] [.procedure] ==== .Procedure: Clone the necessary repositories . Clone the `freebsd-doc` repository: + [source,console?prompt=%] .... % git clone https://github.com/freebsd/freebsd-doc.git ~/freebsd-doc .... . Clone the `freebsd-doc-translate` repository: + [source,console?prompt=%] .... % git clone https://github.com/freebsd/freebsd-doc-translate.git ~/freebsd-doc-translate .... ==== [[weblate-copy-translation]] [.procedure] ==== .Procedure: Copy a translation file to `freebsd-doc` With both repositories in place, copy the translation from `freebsd-doc-translate` to `freebsd-doc`. Example of the Committer's Guide article translation in Spanish. [source,console?prompt=%] .... % cp ~/freebsd-doc-translate/documentation/content/es/articles/committers-guide/_index.po \ ~/freebsd-doc/documentation/content/es/articles/committers-guide/ .... ==== [[weblate-translate]] [.procedure] ==== .Procedure: Convert a translation file (`.po`) to `.adoc` Go to the root of `freebsd-doc`. [source,console?prompt=%] .... % cd ~/freebsd-doc .... Translate (convert) the `.po` file to `.adoc` [source,console?prompt=%] .... % ./tools/translate.sh documentation es articles/committers-guide .... By default: only files with more than eighty percent of strings translated will be converted to `.adoc`. To ignore that limit: [source,console?prompt=%] .... % KEEP_ENV=0 ./tools/translate.sh documentation es articles/committers-guide .... ==== Some documents, like books, have many PO gettext files. Always copy all of them when translating and building. Files that weren't translated will be converted with the source (English) strings. [WARNING] ==== The directory structure is fundamental. Always follow the English document directory structure. ==== [[weblate-build]] [.procedure] ==== .Procedure: Build the translated document Last, the building part. Enter the documentation directory because there is no need to build the FreeBSD website. [source,console?prompt=%] .... % cd documentation .... And build the documentation. Note that `en` is always added by default when building any other language. [source,console?prompt=%] .... % DOC_LANG=es make .... This command will build only the English and Spanish documents of the FreeBSD documentation portal. The output will be in the [.filename]#public# directory; open that in a browser. Note that some index files can redirect the browser to the online page. Another good option is to build and serve the content with Hugo's internal webserver: [source,console?prompt=%] .... % DOC_LANG=es make run .... By default, the webserver listens on `localhost`; To override this behavior, specify the desired IP address in the `BIND` parameter value. [source,console?prompt=%] .... % DOC_LANG=es make run BIND=192.168.15.10 .... This builds and serves the content with Hugo's internal webserver and lets it open, and if any file changes, it rebuilds them automatically. ==== To make any necessary adjustments in the translation, follow the steps below to re-sync all components: - Fix the translation string on https://translate-dev.freebsd.org/[Weblate]. - Force Weblate to commit the changes on `Document/Manage/Commit` section. - Sync the local Weblate repository `freebsd-doc-translate` with a `git pull origin main` command. - Copy the translation again to `freebsd-doc`. - Convert the translation to .adoc with the `./tools/translate.sh` script. - Hugo will rebuild the file and not build the entire set if `make run` was used; or re-execute `make`. [IMPORTANT] ==== Follow the previous steps as many times as is necessary until the document is ready to be published. ==== The crossref:doc-build[doc-build-rendering,Documentation Build Process] chapter includes information about rendering to HTML and PDF. [[weblate-submitting-translations]] == Submitting Translations Example of submitting an update to the Brazilian Portuguese article Committer's Guide. [[weblate-git-repo-status]] [.procedure] ==== .Check the repository After following the steps in crossref:weblate[weblate-building,Building the Translated Document], go to the root of `freebsd-doc` and preview what's to be committed. For an overview of files to be changed, and differences in file content: [source,console?prompt=%] .... % git status % git diff .... Review the output, and if any files unrelated to the Committer's Guide translation update were changed or added, take the appropriate action of reverting or removing them, respectively, before proceeding further. Always include the PO gettext file (`.po`) and the translated document in Hugo/Asciidoctor (`.adoc`). ==== [[weblate-git-new-branch]] [.procedure] ==== .Create a new branch and commit Create another branch to separate the work, which will help with future updates in the local repository. [source,console?prompt=%] .... % git checkout -b committers-guide_pt-br .... Register the local commit. [source,console?prompt=%] .... % git add . % git commit .... Example of commit messages for translations: [.programlisting] .... pt-br/committers-guide: Sync with en XXXXXXX .... Where `XXXXXXX` is the man:git[1] revision stored in the Weblate repository [.filename]#~/freebsd-doc-translate/revision.txt#. If it is the first translation of an article: [.programlisting] .... Add Korean translation of Leap Seconds article .... A message will be displayed after the commit if man:git[1] has not been configured previously. Please follow the instructions and provide the name and email address used on Weblate. This step is crucial to proper crediting of contributors. Then check the entire commit, review changes, and author name and email. [source,console?prompt=%] .... % git show .... ==== [[weblate-git-patch-submit]] [.procedure] ==== .Generate a patch Next, generate a man:git-format-patch[1] file. [source,console?prompt=%] .... % git format-patch main 0001-pt-br-committers-guide-Sync-with-en-XXXXXXX.patch .... ==== Attach the patch [.filename]#0001-pt-br-committers-guide-Sync-with-en-XXXXXXX.patch# to a problem report in https://bugs.freebsd.org/bugzilla/[FreeBSD Bugzilla]. Include the following information in the report: [[weblate-bugzilla-fields]] .Bugzilla Fields [cols="1,1", frame="none", options="header"] |=== | Field | Value | *product* | Documentation | *Component* | Books & Articles | *Summary* | Same as the local commit | *Description* | State that instructions in this guide were followed, including proofreading and other necessary steps. Include things that may help with triage and progression of the report. | *CC* (Optional) | If the language has coordinators, include their email addresses in the CC field. |=== For people familiar with man:git[1] and GitHub: instead of submitting the patch through https://bugs.freebsd.org/bugzilla/[Bugzilla], a https://github.com/freebsd/freebsd-doc/pulls[GitHub pull request] can be used (use the name and address that you use with Weblate). https://github.com/freebsd/freebsd-doc/ is a secondary mirror. Changes to the `doc` tree can be made only by people who have a `doc` commit bit. When translators keep sending good-quality patches, they can be nominated by other committers to receive write-access (a extref:{committers-guide}[doc commit bit, committer.types] for translations), a FreeBSD account, and associated perks. The list of extref:{contributors}[Additional FreeBSD Contributors, contrib-additional] includes non-committers whose contributions are committed to the `doc` tree. If in doubt about any procedure, write to the {freebsd-translators}. [[weblate-faq]] == FAQ (Frequently Asked Questions) [[weblate-copyrights]] === Is it necessary to translate all the Copyright messages? Every language team decides this for their language; in `pt-br` (Brazilian Portuguese) team, it was decided not to translate those messages. diff --git a/documentation/content/pt-br/books/fdp-primer/weblate/_index.adoc b/documentation/content/pt-br/books/fdp-primer/weblate/_index.adoc index decebfbad5..d4989a43b5 100644 --- a/documentation/content/pt-br/books/fdp-primer/weblate/_index.adoc +++ b/documentation/content/pt-br/books/fdp-primer/weblate/_index.adoc @@ -1,454 +1,454 @@ --- description: 'Como entrar para a equipe de tradutores do FreeBSD e traduzir online no Weblate' next: books/fdp-primer/manual-pages path: /books/fdp-primer/ prev: books/fdp-primer/po-translations showBookMenu: 'true' tags: ["weblate", "po", "translations", "tutorial", "quick start"] title: 'Capítulo 10. Traduções Weblate' weight: 10 --- [[weblate-translations]] = Traduções Weblate :doctype: book :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :sectnumoffset: 10 :partnums: :source-highlighter: rouge :experimental: :images-path: books/fdp-primer/ ifdef::env-beastie[] ifdef::backend-html5[] :imagesdir: ../../../../images/{images-path} endif::[] ifndef::book[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] toc::[] endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] toc::[] include::../../../../../shared/asciidoctor.adoc[] endif::[] [[weblate-introduction]] == Introdução Este capítulo descreve alguns passos básicos para ingressar na equipe de tradutores do FreeBSD, traduzindo online no Weblate ou offline, e algumas sugestões simples sobre tradução, revisão e teste. O foco é na parte da tradução. Os documentos originais (artigos e livros) estão no {main-site-en}[portal de documentação]. https://weblate.org/en/[Weblate] é um software web de código aberto com foco em idiomas; o projeto FreeBSD possui uma instância local. [[weblate-become-translator]] == Como se Tornar um Tradutor do FreeBSD A seguir seguem os passos para começar a traduzir artigos e livros do Projeto de Documentação do FreeBSD. . Crie uma conta na https://translate-dev.freebsd.org/[instância Weblate do FreeBSD] com um endereço de e-mail ou sua conta GitHub. . Inscreva-se na {freebsd-translators}. . Apresente-se e peça para participar de uma equipe de idiomas. Se a equipe de idiomas não existir, peça para criá-la. A auto-apresentação é essencial. Isso aumenta suas chances de ser aprovado para acesso de escrita. . Acesse o https://translate-dev.freebsd.org/[Weblate] com a nova conta. . Encontre a equipe de idiomas e escolha um documento inicial para traduzir. . Crie uma conta no Bugzilla para enviar as traduções depois de terminar um documento. O projeto de documentação também está aceitando Pull Requests do GitHub com envio de traduções. [WARNING] ==== Todos os arquivos de tradução e documentos devem seguir a https://www.freebsd.org/copyright/freebsd-doc-license/[Licença de Documentação do FreeBSD]; se isso não for aceitável, por favor, não se inscreva ou envie patches ou traduções. ==== [[weblate-introduce-yourself]] == Apresente-se Forneça uma breve auto-apresentação na {freebsd-translators} para iniciar o processo de concessão de acesso. Isso permitirá que um coordenador ou administrador de idiomas forneça as permissões necessárias para que o novo usuário do Weblate comece a traduzir. A seguir está um exemplo de como tal e-mail poderia parecer. [.programlisting] .... Subject: Self-Introduction: Name and language Name: Name (usar nome preferido) Location: City, country (opcional) Login: username or email (essencial) Language: Language to translate (essencial) Profession or student status: (opcional) About You: (formato livre -- informações com as quais você se sente à vontade para compartilhar others: empresa, escola, outra afiliação, habilitações históricas, outras projetos em que você trabalhou, nível e tipo de conhecimento de informática, outras habilidades relevantes, etc.) You and the FreeBSD Project: (formato livre: outros projetos FreeBSD de interesse, comentários, etc.) .... [[weblate-login]] == Entrar no Weblate Abra https://translate-dev.freebsd.org/[] e `Entre`. -image::weblate-login.webp["Login Weblate", 800] +image::weblate-login.png["Login Weblate", 800] Use um nome de usuário, endereço de e-mail ou conta do GitHub para fazer login. O perfil do usuário contém suas preferências, nome e endereço de e-mail. O nome e o endereço serão usados nos commits; mantenha esta informação atualizada. Na instância Weblate do FreeBSD, todas as traduções serão enviadas para o https://github.com/freebsd/freebsd-doc-translate[freebsd-doc-translate] (um repositório intermediário no GitHub), e não diretamente para o https://github.com/freebsd/freebsd-doc[freebsd-doc]. Os tradutores devem pegar os arquivos PO gettext (`.po`), converte-los para `.adoc` e submete-los via https://bugs.freebsd.org/bugzilla/[Bugzilla] ou https://github.com/freebsd/freebsd-doc/pulls[GitHub] para publicar ou atualizar o documento traduzido no portal de documentação. Veja mais nas seções a seguir. O Weblate irá enviar os commits diariamente, pelo menos, para o `freebsd-doc-translate`, se quaisquer novas strings forem traduzidas. [[weblate-find-language-team]] == Encontre uma Equipe de Idiomas para Participar Clique em `Projetos`, escolha `Documentação`, depois clique em `Idiomas` e veja todos os idiomas disponíveis. -image::weblate-languages.webp["Idiomas Weblate", 500] +image::weblate-languages.png["Idiomas Weblate", 500] Observe que alguns idiomas e documentos traduzidos já existem no portal de documentação e repositórios. Se o idioma desejado para tradução não estiver disponível no Weblate, entre em contato com os https://www.freebsd.org/docproj/translations/[coordenadores de idiomas] antes de solicitar a criação de um novo idioma. Se não houver resposta, entre em contato com a {doceng}. [[weblate-translating-online]] == Traduzindo Online no Weblate Traduzir documentos online tende a ser o método mais fácil para tradução de documentos no FreeBSD, pois permite que os usuários trabalhem no mesmo arquivo, distribuindo a carga de trabalho. Assim que um coordenador ou administrador conceder acesso a um idioma específico para um usuário, o botão salvar será habilitado para que esse usuário possa começar a traduzir. -image::weblate-documents.webp["Documentos Weblate", 800] -image::weblate-translate.webp["Weblate Translate", 800] +image::weblate-documents.png["Documentos Weblate", 800] +image::weblate-translate.png["Weblate Translate", 800] O Weblate possui um conjunto de links que levam à tradução. A tradução é dividida em verificações individuais, como `Não traduzido` ou `Precisando de revisão`. Se todo o documento estiver traduzido sem nenhum erro, o link `Todas as traduções` ainda estará disponível caso uma revisão seja necessária. Como alternativa, o campo de pesquisa pode ser usado para localizar uma string ou termo específico. Na https://docs.weblate.org/en/latest/user/translating.html#translation-projects[documentação do Weblate], há mais informações sobre traduções, como atalhos de teclado e outras dicas sobre a ferramenta de tradução. [[weblate-translating-offline]] == Traduzindo Offline O Weblate no FreeBSD usa arquivos PO gettext para traduções. Os usuários familiarizados com os arquivos PO gettext que desejam traduzir offline podem baixar e enviar as traduções através da página do documento no Weblate clicando na seção `Arquivos`. -image::weblate-offline.webp["Weblate Offline", 800] +image::weblate-offline.png["Weblate Offline", 800] [[weblate-automatic-suggestions]] == Tradução baseada em Sugestões Automáticas Os idiomas que usavam Weblate antes da migração para Hugo/Asciidoctor podem usar esse recurso do Weblate para economizar tempo. Este recurso do Weblate usa a Memória de Tradução gerada pelos outros componentes e projetos no mesmo servidor. As antigas traduções do Weblate estão hospedadas no mesmo servidor como somente leitura por causa disso. Strings que correspondem a `100/100` em similaridade podem ser copiadas e salvas diretamente. Outras strings precisarão de pelo menos um pequeno ajuste. Alguns exemplos: -image::weblate_automatic_suggestion_01.webp["Weblate Sugestões Automáticas 01", 800] +image::weblate_automatic_suggestion_01.png["Weblate Sugestões Automáticas 01", 800] Com a migração para Hugo/Asciidoctor, os documentos passaram a utilizar UTF-8. Algumas entidades HTML devem ser substituídas. Algumas strings, como links, requerem alterações na marcação. -image::weblate_automatic_suggestion_02.webp["Weblate Sugestões Automáticas 02", 800] +image::weblate_automatic_suggestion_02.png["Weblate Sugestões Automáticas 02", 800] Links: -image::weblate_automatic_suggestion_03.webp["Weblate Sugestões Automáticas 03", 800] +image::weblate_automatic_suggestion_03.png["Weblate Sugestões Automáticas 03", 800] [[weblate-proofreading-qa]] == Revisão e Verificações de Qualidade do Weblate O dashboard do documento `Projeto/Idioma/Documento` mostra o status da tradução e o status das strings desse documento. Esta página é útil para revisão e verificações de qualidade. -image::weblate-revision1.webp["Weblate Revisão 01", 800] +image::weblate-revision1.png["Weblate Revisão 01", 800] Neste exemplo, falta o ponto final em duas strings; clicando nesse link será mostrado apenas as strings a serem revisadas/traduzidas. -image::weblate-revision2.webp["Weblate Revisão 02", 800] +image::weblate-revision2.png["Weblate Revisão 02", 800] Tradutores e revisores geralmente gostam da visualização das strings traduzidas em seu contexto. [[weblate-building]] == Compilando o Documento Traduzido O projeto não usa integração contínua e entrega contínua (CI/CD) para gerar as traduções. Existem estudos para a sua disponibilização. [NOTE] ==== O exemplo a seguir usa o GitHub, pois o Weblate também está no GitHub. Observe que este repositório é um espelho somente leitura, mas as Pull Requests são aceitas. ==== Para gerar a tradução localmente, siga estas etapas: [[weblate-clone-repositories]] [.procedure] ==== .Procedimento: Clone os repositórios necessários . Clone o repositório `freebsd-doc`: + [source, console?prompt=%] .... % git clone https://github.com/freebsd/freebsd-doc.git ~/freebsd-doc .... . Clone o repositório `freebsd-doc-translate`: + [source, console?prompt=%] .... % git clone https://github.com/freebsd/freebsd-doc-translate.git ~/freebsd-doc-translate .... ==== [[weblate-copy-translation]] [.procedure] ==== .Procedimento: Copie um arquivo de tradução para `freebsd-doc` Com ambos os repositórios, copie a tradução de `freebsd-doc-translate` para `freebsd-doc`. Exemplo de tradução do artigo do Committer's Guide em espanhol. [source, console?prompt=%] .... % cp ~/freebsd-doc-translate/documentation/content/es/articles/committers-guide/_index.po \ ~/freebsd-doc/documentation/content/es/articles/committers-guide/ .... ==== [[weblate-translate]] [.procedure] ==== .Procedimento: Converter um arquivo de tradução (`.po`) para `.adoc` Vá para a raiz do `freebsd-doc`. [source, console?prompt=%] .... % cd ~/freebsd-doc .... Traduzir (converter) o arquivo `.po` para `.adoc` [source, console?prompt=%] .... % ./tools/translate.sh documentation es articles/committers-guide .... Por padrão: apenas arquivos com mais de oitenta por cento de strings traduzidas serão convertidos para `.adoc`. Para ignorar esse limite: [source, console?prompt=%] .... % KEEP_ENV=0 ./tools/translate.sh documentation es articles/committers-guide .... ==== Alguns documentos, como livros, possuem muitos arquivos PO gettext. Sempre copie todos eles ao traduzir e compilar. Arquivos que não foram traduzidos serão convertidos com as strings de origem (inglês). [WARNING] ==== A estrutura de diretórios é fundamental. Siga sempre a estrutura de diretórios dos documentos em inglês. ==== [[weblate-build]] [.procedure] ==== .Procedimento: Gerar o documento traduzido Por último, a parte da compilação. Entre no diretório de documentação porque não há necessidade de compilar o site do FreeBSD. [source, console?prompt=%] .... % cd documentation .... E compile a documentação. Observe que `en` é sempre adicionado por padrão ao compilar qualquer outro idioma. [source, console?prompt=%] .... % DOC_LANG=es make .... Este comando irá compilar apenas os documentos em inglês e espanhol do portal de documentação do FreeBSD. A saída estará no diretório [.filename]#public#; abra-o em um navegador. Observe que alguns arquivos de índice podem redirecionar o navegador para a página online. Outra boa opção é compilar e servir o conteúdo com o servidor web interno do Hugo: [source, console?prompt=%] .... % DOC_LANG=es make run .... Por padrão, o servidor web escuta em `localhost`; Para substituir esse comportamento, especifique o endereço IP desejado no valor do parâmetro `BIND`. [source, console?prompt=%] .... % DOC_LANG=es make run BIND=192.168.15.10 .... Isso compila e serve o conteúdo com o servidor web interno de Hugo e deixa ele em espera, quando algum arquivo for alterado, ele o recompila automaticamente. ==== Para fazer os ajustes necessários na tradução, siga as etapas abaixo para sincronizar novamente todos os componentes: - Corrija a string de tradução em https://translate-dev.freebsd.org/[Weblate]. - Force o Weblate a realizar o commit das alterações na aba `Document/Manage/Commit`. - Sincronize o repositório Weblate local `freebsd-doc-translate` com o comando `git pull origin main`. - Copie a tradução novamente para `freebsd-doc`. - Converta a tradução para .adoc com o script `./tools/translate.sh`. - Hugo irá recompilar o arquivo e não todo o conjunto se `make run` foi utilizado; ou execute novamente o `make`. [IMPORTANT] ==== Siga os passos anteriores quantas vezes forem necessárias até que o documento esteja pronto para ser publicado. ==== O capítulo crossref:doc-build[doc-build-rendering,Processo de Compilação da Documentação] inclui informações sobre a renderização para HTML e PDF. [[weblate-submitting-translations]] == Enviando Traduções Exemplo de envio de atualização do artigo Committer's Guide em Português do Brasil. [[weblate-git-repo-status]] [.procedure] ==== .Verifique o repositório Depois de seguir os passos em crossref:weblate[weblate-building,Compilando o Documento Traduzido], vá para a raiz do `freebsd-doc` e visualize o que deve ser submetido. Para obter uma visão geral dos arquivos a serem alterados e das diferenças no conteúdo do arquivo: [source, console?prompt=%] .... % git status % git diff .... Revise a saída e, se algum arquivo não relacionado à atualização da tradução do Committer's Guide foi alterado ou adicionado, tome a ação apropriada de revertê-lo ou removê-lo, respectivamente, antes de continuar. Sempre inclua o arquivo PO gettext (`.po`) e o documento traduzido em Hugo/Asciidoctor (`.adoc`). ==== [[weblate-git-new-branch]] [.procedure] ==== .Crie uma nova branch e faça o commit Crie outra branch para separar o trabalho, o que ajudará em futuras atualizações no repositório local. [source, console?prompt=%] .... % git checkout -b committers-guide_pt-br .... Registre o commit local. [source, console?prompt=%] .... % git add . % git commit .... Exemplo de mensagens de commit para traduções: [.programlisting] .... pt-br/committers-guide: Sincronizar com en XXXXXXX .... Onde `XXXXXXX` é a revisão man:git[1] armazenada no repositório Weblate [.filename]#~/freebsd-doc-translate/revision.txt#. Se for a primeira tradução de um artigo: [.programlisting] .... Adicionar tradução Coreana do artigo Leap Seconds .... Uma mensagem será exibida após o commit se o man:git[1] não tiver sido configurado anteriormente. Siga as instruções e forneça o nome e o endereço de e-mail usado no Weblate. Esta etapa é crucial para creditar o trabalho dos contribuidores. Em seguida, verifique todo o commit, revise as alterações e o nome e e-mail do autor. [source, console?prompt=%] .... % git show .... ==== [[weblate-git-patch-submit]] [.procedure] ==== .Gerar um patch Em seguida, gere um arquivo man:git-format-patch[1]. [source, console?prompt=%] .... % git format-patch main 0001-pt-br-committers-guide-Sync-with-en-XXXXXXX.patch .... ==== Anexe o patch [.filename]#0001-pt-br-committers-guide-Sync-with-en-XXXXXXX.patch# a um relatório de problema no https://bugs.freebsd.org/bugzilla/[Bugzilla do FreeBSD]. Inclua as seguintes informações no relatório: [[weblate-bugzilla-fields]] .Campos do Bugzilla [cols="1,1", frame="none", options="header"] |=== | Campo | Valor | *produto* | Documentação | *Componente* | Artigos e Livros | *Resumo* | O mesmo que o commit local | *Descrição* | Declare que as instruções deste guia foram seguidas, incluindo revisão e outras etapas necessárias. Inclua informações que podem ajudar na triagem e no progresso do relatório. | *CC* (Opcional) | Se o idioma tiver coordenadores, inclua seus endereços de e-mail no campo CC. |=== Para pessoas familiarizadas com man:git[1] e GitHub: em vez de enviar o patch através do https://bugs.freebsd.org/bugzilla/[Bugzilla], um https://github.com/freebsd/freebsd-doc/pulls[pull request do GitHub] pode ser usado (use o nome e o endereço de e-mail utilizado no Weblate). https://github.com/freebsd/freebsd-doc/ é um espelho secundário. Alterações na árvore `doc` podem ser feitas apenas por pessoas que possuem um `doc` commit bit. Quando os tradutores continuam enviando patches de boa qualidade, eles podem ser nomeados por outros committers para receber acesso de escrita (um extref:{committers-guide}[doc commit bit, committer.types] para traduções), uma conta FreeBSD e todas as vantagens associadas. A lista de extref:{contributors}[Contribuidores Adicionais do FreeBSD, contrib-additional] inclui não-committers cujas contribuições são submetidas à árvore `doc`. Em caso de dúvida sobre algum procedimento, escreva para a {freebsd-translators}. [[weblate-faq]] == FAQ (Perguntas Frequentes) [[weblate-copyrights]] === É necessário traduzir todas as mensagens de Copyright? Cada equipe de idiomas decide isso para o seu próprio idioma; na equipe `pt-br` (Português do Brasil), foi decidido não traduzir essas mensagens. diff --git a/documentation/static/images/books/fdp-primer/weblate-commit.webp b/documentation/static/images/books/fdp-primer/weblate-commit.webp deleted file mode 100644 index e5df1bcdb0..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-commit.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate-documents.png b/documentation/static/images/books/fdp-primer/weblate-documents.png new file mode 100644 index 0000000000..4f51a8b1bc Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate-documents.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate-documents.webp b/documentation/static/images/books/fdp-primer/weblate-documents.webp deleted file mode 100644 index 866e33cb7f..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-documents.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate-languages.png b/documentation/static/images/books/fdp-primer/weblate-languages.png new file mode 100644 index 0000000000..4b3e24d9e4 Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate-languages.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate-languages.webp b/documentation/static/images/books/fdp-primer/weblate-languages.webp deleted file mode 100644 index cb1b65a788..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-languages.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate-login.png b/documentation/static/images/books/fdp-primer/weblate-login.png new file mode 100644 index 0000000000..d57ec47c09 Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate-login.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate-login.webp b/documentation/static/images/books/fdp-primer/weblate-login.webp deleted file mode 100644 index a947159de9..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-login.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate-offline.png b/documentation/static/images/books/fdp-primer/weblate-offline.png new file mode 100644 index 0000000000..87badbd9cc Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate-offline.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate-offline.webp b/documentation/static/images/books/fdp-primer/weblate-offline.webp deleted file mode 100644 index 4ea4999f9a..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-offline.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate-revision1.png b/documentation/static/images/books/fdp-primer/weblate-revision1.png new file mode 100644 index 0000000000..5f6f9c1d2c Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate-revision1.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate-revision1.webp b/documentation/static/images/books/fdp-primer/weblate-revision1.webp deleted file mode 100644 index 939eb0b335..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-revision1.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate-revision2.png b/documentation/static/images/books/fdp-primer/weblate-revision2.png new file mode 100644 index 0000000000..8cea25cc0e Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate-revision2.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate-revision2.webp b/documentation/static/images/books/fdp-primer/weblate-revision2.webp deleted file mode 100644 index 54242fa930..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-revision2.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate-translate.png b/documentation/static/images/books/fdp-primer/weblate-translate.png new file mode 100644 index 0000000000..702837a3d5 Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate-translate.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate-translate.webp b/documentation/static/images/books/fdp-primer/weblate-translate.webp deleted file mode 100644 index d9c3a76973..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate-translate.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_01.png b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_01.png new file mode 100644 index 0000000000..989d1d70bb Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_01.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_01.webp b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_01.webp deleted file mode 100644 index 6f760b2337..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_01.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_02.png b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_02.png new file mode 100644 index 0000000000..cb8956ce71 Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_02.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_02.webp b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_02.webp deleted file mode 100644 index ae12522ca0..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_02.webp and /dev/null differ diff --git a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_03.png b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_03.png new file mode 100644 index 0000000000..c53bdf98c2 Binary files /dev/null and b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_03.png differ diff --git a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_03.webp b/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_03.webp deleted file mode 100644 index 0c1aadeb73..0000000000 Binary files a/documentation/static/images/books/fdp-primer/weblate_automatic_suggestion_03.webp and /dev/null differ