在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jnavila/git-manpages-l10n开源软件地址:https://github.com/jnavila/git-manpages-l10n开源编程语言:Python 66.8%开源软件介绍:GIT Documentation TranslationsThis project holds the translations for the documentation of Git. This document describes how you can contribute to the effort of enhancing the language coverage and maintaining the translation. This project is not about translating Git itself although the base content (the manpages) is extracted from it. Git uses a workflow for translations which is different from the one used by Git Manpages. If you feel interested, please refer to the specific instructions. PresentationThis project relies on the Git project itself for the original version of the Git manpages and documents. In order to allow the translations in a maintainable way over the changes to the Git project, the source files are processed with a converter named po4a . This tool converts the source files into gettext po files which can be processed just like gettext internationalization files. The source files for the manpages are written in Asciidoc with some custom macros. Although the documents are split into simple paragraphs by po4a for translations, Asciidoc inline formatting marks are retained. The two character language translation codes are defined by ISO_639-1, as stated in the gettext(1) full manual, appendix A.1, Usual Language Codes. WorkflowTranslation Process FlowThe overall data-flow looks like this:
There are basically two ways to translate the documents. The first one uses the standard Git workflow, similar to any software project. The second one uses the more accessible web tool at Weblate.org and is the preferred way of contributing. Contributing through WeblateThe translation files are uploaded to the hosted weblate website, where contributors can easily translate the documents and use all the helpers that are provided. Contributing to Git manpages translation requires you to acknowledge the project's code of contributors. Contributing to an existing translationIf the language you plan to translate is already listed, you can just jump to the language's management page and start fixing translations or tackling untranslated content. Your inputs will update the translation file for your language. The web application handles your submissions and generates a Git commit in the local repository of weblate after one day of inactivity. Creating a new language translationYou cannot directly create a new language in Weblate by yourself, but you can request the creation of the language to the maintainer. Upon receiving this request, the maintainer will create the po translation file and push it. Weblate will update the list of available language accordingly and you can then start to contribute. Contributing with the Git workflowContributing to an existing translationAs a contributor for a language XX, you should first check TEAMS file in this directory to see whether a dedicated team for your language XX exists. Fork the dedicated repository and start to work if it exists. Otherwise, you can just fork this project and start translating. When committing, don't forget to follow the code of contribution and add your "Signed-off-by:" line. When you feel that your work is worth an update (e.g. a few new manpages have been translated), you open a pull request to this repository in order to get your changes merged. Creating a new language translationIf you are the first contributor for the language XX, please fork this repository, prepare and/or update the translated message file po/documentation.XX.po (described later), and ask the l10n coordinator to pull your work. If there are multiple contributors for the same language, please first coordinate among yourselves and nominate the team leader for your language, so that the l10n coordinator only needs to interact with one person per language. You add a translation for the first time by
A file po/documentation.XX.po was created, corresponding to the newly created translation and is ready for your translations. Then edit the automatically generated copyright info in your new documentation.XX.po to be correct, e.g. for Icelandic:
And change references to PACKAGE VERSION in the PO Header Entry to just "Git Documentation":
Once you are done testing the translation (see below), commit the documentation.XX.po files and ask the l10n coordinator to pull from you. Testing your changes(This is done by the language teams, after creating or updating documentation.XX.po file). Before being able to compile the documents, you need to have a working compilation toolchain which you can get by running:
Before you submit your changes do:
On systems with GNU gettext (i.e. not Solaris) and po4a, this will try to merge translations with the source asciidoc files into translated asciidoc files and compile them to manpages. Then you can check the translated manpages, for instance for
and verify how your translated manpage is rendered. Advices for translatorsHelpful TipsGit is a version control system (VCS in short) and this kind of software expects users to understand some dedicated concepts. More generally, translating a tool requires at least a minimum of knowledge of its purpose and use. Git is no exception, and its manpages are full of its specifics. Here are a few helpful advices in order to help you work through this translation. Know a little more about GitAs said earlier, knowing the base of Git is necessary in order to prevent mistranslations. Even if you are not going to be an expert at Git (you could, given the content of the manpages), you can try to install it and make a basic use of it. To get you started, please refer to the introductory chapters of the Progit book, at least the first three chapters. Set up a glossary of the key conceptsWhen translating a software where some words have been chosen to hold some key concepts, it is often necessary to maintain a list of the selected translation of these words, that convey the concept correctly and are used in every place the original word is used. Git provides a glossary with definitions and Weblate has a glossary feature where a reminder is shown when a glossary term appears in the original string. This is an excellent way to enhance the quality of the translation, while helping translators share the same vocabulary. Also, some translators of git maintain their own glossary of terms in the headers of the their translation files. You can find these files in the repository of Git. Learn a little about Asciidoc formattingWhile po4a is quite good at extracting paragraphs from the Asciidoc sources, all the inline formattings are still pushed in the po files. For the translations to be faithful to the original these formatting marks must be pushed at the right places in the translated content. Learn to recognize these marks and to manage them in your content. Translate placeholders in command linesWhen some template command lines contain Translate in orderIf you don't specify an order on Weblate, the source segments are presented in the order priority, which places in first the content of most used git commands. The corresponding manpages are more susceptible to be read by beginners. So your work has the biggest impact right when starting. Get in touch with the maintainerIn case you need to contact the maintainer for e.g. an issue in a source string or an issue with the translated manpages, the project is hosted on GitHub where issues can be opened. Maintainer's TasksMaintaining the documentation.pot file(This is done by the documentation l10n coordinator). The documentation.pot file in the po directory contains a message catalog extracted from Git's documentation sources. The l10n coordinator maintains it by adding new translations or update existing ones with po4a(1). In order to update the document sources to extract the messages from, the l10n coordinator is expected to pull from the main git repository at strategic point in history (e.g. when a major release and release candidates are tagged), and then run "make update-sources" at the top-level directory. Language contributors use this file to prepare translations for their language, but they are not expected to modify it. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论