Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Weblate Translation Tips ====== This is a step-by-step to build each document after translating them with Weblate. All examples are for ''%%pt-br%%'' language, replace it with your language code. ===== Repositories ===== Clone all repositories, %%FreeBSD%% doc, and Weblate translations. <code> $ cd /tmp $ git clone https://git.freebsd.org/doc.git $ git clone https://github.com/freebsd/freebsd-doc-translate.git $ cd doc </code> ===== Articles ===== ==== General Notes ==== * After translating with ''%%tools/translate.sh%%'', consider that executing the script will overwrite those manual changes in articles other than the one you are working on. Pay attention before submitting. Especially, try to avoid ''%%git -a%%'' and ''%%git restore%%'' as many ''%%*.adoc%%'' files as necessary. * When creating new articles to the tree, ''%%shared/$LANGUAGE/urls.adoc%%'' needs to be adjusted. For instance, once the Spanish ''%%bsdl-gpl%%'' article is added to the tree make the following change in ''%%shared/es/urls.adoc%%'': <code> bsdl-gpl: https://docs.freebsd.org/articles/bsdl-gpl/ --> bsdl-gpl: {main-site}/articles/bsdl-gpl/ </code> ==== leap-seconds ==== Copy translation (single .po) to the doc tree. <code> $ cp ../freebsd-doc-translate/documentation/content/pt_BR/articles/leap-seconds/_index.po \ documentation/content/pt-br/articles/leap-seconds/_index.po </code> Convert the .po file to .adoc. <code> $ ./tools/translate.sh documentation pt-br </code> Build. <code> $ DOC_LANG="en pt-br" make documentation </code> Check. <code> $ open documentation/public/pt-br/articles/leap-seconds/index.html </code> Submit. ==== contributors ==== Just necessary to translate ''%%index%%'' and ''%%contrib-develinmemoriam%%''. Copy translation (both .po) to the doc tree. <code> $ cp -a ../freebsd-doc-translate/documentation/content/pt_BR/articles/contributors/_index.po \ documentation/content/pt-br/articles/contributors/ $ cp -a ../freebsd-doc-translate/documentation/content/pt_BR/articles/contributors/contrib-develinmemoriam.po \ documentation/content/pt-br/articles/contributors/ </code> Convert the .po file to .adoc. <code> $ ./tools/translate.sh documentation pt-br </code> Other includes will reference the English document files; the exception is ''%%contrib-develinmemoriam%%''. <code> include::content/en/articles/contributors/contrib-committers.adoc[] include::content/en/articles/contributors/contrib-corealumni.adoc[] include::content/en/articles/contributors/contrib-develalumni.adoc[] include::content/en/articles/contributors/contrib-portmgralumni.adoc[] include::{include-path}contrib-develinmemoriam.adoc[] include::content/en/articles/contributors/contrib-additional.adoc[] include::content/en/articles/contributors/contrib-386bsd.adoc[] </code> Build. <code> $ DOC_LANG="en pt-br" make documentation </code> Check. <code> $ open documentation/public/pt-br/articles/contributors/index.html </code> Submit. ==== explaining-bsd ==== Copy translation (single .po) to the doc tree. <code> $ cp ../freebsd-doc-translate/documentation/content/pt_BR/articles/explaining-bsd/_index.po \ documentation/content/pt-br/articles/explaining-bsd/_index.po </code> Convert the .po file to .adoc. <code> $ ./tools/translate.sh documentation pt-br </code> Build. <code> $ DOC_LANG="en pt-br" make documentation </code> Check. <code> $ open documentation/public/pt-br/articles/explaining-bsd/index.html </code> Submit. ===== Books ===== ==== fdp-primer ==== Create fdp-primer directory. <code> $ cd doc $ mkdir -p documentation/content/pt-br/books/fdp-primer/ </code> Copy translations (multiple .po) to the doc tree. <code> $ cp -a -R \ ../freebsd-doc-translate/documentation/content/pt_BR/books/fdp-primer/* \ documentation/content/pt-br/books/fdp-primer/ </code> Add ''%%fdp-primer%%'' to ''%%documentation/content/pt-br/books/books.adoc%%''. Copy ''%%content/en/books/fdp-primer/chapters-order.adoc%%'' to ''%%content/pt-br/books/fdp-primer/chapters-order.adoc%%'' <code> $ cp documentation/content/en/books/fdp-primer/chapters-order.adoc \ documentation/content/pt-br/books/fdp-primer/chapters-order.adoc </code> Convert .po files to .adoc. <code> $ ./tools/translate.sh documentation pt-br </code> Check translations and brake lines. Some tables and examples can break the build. A few examples that needed attention when translating to pt-br: <code> - documentation/content/pt-br/books/fdp-primer/doc-build/_index.adoc https://cgit.freebsd.org/doc/tree/documentation/content/en/books/fdp-primer/doc-build/_index.adoc#n245 https://cgit.freebsd.org/doc/tree/documentation/content/en/books/fdp-primer/doc-build/_index.adoc#n314 - documentation/content/pt-br/books/fdp-primer/manual-pages/_index.adoc https://cgit.freebsd.org/doc/tree/documentation/content/en/books/fdp-primer/manual-pages/_index.adoc#n187 - documentation/content/pt-br/books/fdp-primer/writing-style/_index.adoc https://cgit.freebsd.org/doc/tree/documentation/content/en/books/fdp-primer/writing-style/_index.adoc#n191 - documentation/content/pt-br/books/fdp-primer/examples/_index.adoc Copy examples from the English. - documentation/content/pt-br/books/fdp-primer/structure/_index.adoc - documentation/content/pt-br/books/fdp-primer/rosetta/_index.adoc - documentation/content/pt-br/books/fdp-primer/examples/_index.adoc </code> Add attribute translations manually. <code> documentation/content/pt-br/books/fdp-primer/asciidoctor-primer/_index.adoc documentation/content/pt-br/books/fdp-primer/doc-build/_index.adoc documentation/content/pt-br/books/fdp-primer/editor-config/_index.adoc documentation/content/pt-br/books/fdp-primer/manual-pages/_index.adoc documentation/content/pt-br/books/fdp-primer/see-also/_index.adoc documentation/content/pt-br/books/fdp-primer/structure/_index.adoc documentation/content/pt-br/books/fdp-primer/translations/_index.adoc documentation/content/pt-br/books/fdp-primer/writing-style/_index.adoc :toc-title: Índice documentation/content/pt-br/books/fdp-primer/examples/_index.adoc :toc-title: Índice :example-caption: Exemplo documentation/content/pt-br/books/fdp-primer/po-translations/_index.adoc :toc-title: Índice :table-caption: Tabela :example-caption: Exemplo documentation/content/pt-br/books/fdp-primer/rosetta/_index.adoc :toc-title: Índice :table-caption: Tabela </code> Check line number from all includes ''%%documentation/content/pt-br/books/fdp-primer/book.adoc%%''. Example [[https://cgit.freebsd.org/doc/commit/?id=e528e6bcbd7d9a420012f0e194eb493cae01db58|e528e6bcbd]]. Build. <code> $ DOC_LANG="en pt-br" make documentation </code> Check. <code> $ open documentation/public/pt-br/books/fdp-primer/index.html </code> Submit. ---- {{tag>Services}} doc/translation/weblate/documents.txt Last modified: 2023/03/11 13:31by DaniloBaio