pax_global_header00006660000000000000000000000064147645373570014537gustar00rootroot0000000000000052 comment=7d1bb69fe5d053530b2efeae26106a62510f551d translate-3.15.1/000077500000000000000000000000001476453735700136235ustar00rootroot00000000000000translate-3.15.1/.deepsource.toml000066400000000000000000000002071476453735700167330ustar00rootroot00000000000000test_patterns = ["**/test_*.py"] version = 1 [[analyzers]] enabled = true name = "python" [analyzers.meta] runtime_version = "3.x.x" translate-3.15.1/.github/000077500000000000000000000000001476453735700151635ustar00rootroot00000000000000translate-3.15.1/.github/FUNDING.yml000066400000000000000000000000771476453735700170040ustar00rootroot00000000000000github: WeblateOrg liberapay: Weblate open_collective: weblate translate-3.15.1/.github/renovate.json000066400000000000000000000021331476453735700177000ustar00rootroot00000000000000{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ "config:recommended", ":dependencyDashboard", "helpers:pinGitHubActionDigests" ], "labels": [ "dependencies" ], "rangeStrategy": "widen", "automerge": true, "automergeType": "pr", "automergeStrategy": "rebase", "platformAutomerge": true, "pre-commit": { "enabled": true }, "packageRules": [ { "matchPackageNames": [ "shellcheck-py/shellcheck-py" ], "versioning": "loose" } ], "customManagers": [ { "customType": "regex", "fileMatch": [ "\\.pre-commit-config\\.yaml" ], "matchStrings": [ "(?[^'\" ]+)==(?[^'\" ,\\s]+)" ], "datasourceTemplate": "pypi", "versioningTemplate": "pep440" }, { "customType": "regex", "fileMatch": [ "\\.pre-commit-config\\.yaml" ], "matchStrings": [ "(?[^'\" ]+)@(?[^'\" ,\\s]+)" ], "datasourceTemplate": "npm", "versioningTemplate": "npm" } ] } translate-3.15.1/.github/workflows/000077500000000000000000000000001476453735700172205ustar00rootroot00000000000000translate-3.15.1/.github/workflows/docs.yml000066400000000000000000000013511476453735700206730ustar00rootroot00000000000000name: Docs on: push: branches-ignore: - dependabot/** - deepsource** pull_request: permissions: contents: read jobs: docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Python uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: '3.13' - uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1 - name: Install apt dependencies run: | sudo apt-get update sudo apt-get install -y libgettextpo-dev - name: Install Python dependencies run: uv sync --only-group docs - name: Build docs run: make docs translate-3.15.1/.github/workflows/pre-commit.yml000066400000000000000000000012361476453735700220210ustar00rootroot00000000000000name: Pre-commit check on: push: branches-ignore: - dependabot/** - deepsource** pull_request: permissions: contents: read jobs: pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1 - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: '3.13' - name: pre-commit run: uv run --no-sources --only-group pre-commit pre-commit run --all env: RUFF_OUTPUT_FORMAT: github REUSE_OUTPUT_FORMAT: github translate-3.15.1/.github/workflows/setup.yml000066400000000000000000000057341476453735700211140ustar00rootroot00000000000000name: Distribution on: push: branches-ignore: - dependabot/** - deepsource** tags: - '*' pull_request: permissions: contents: read jobs: setup: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: '3.13' - uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1 with: enable-cache: true cache-dependency-glob: '' cache-suffix: '3.13' - name: Install apt dependencies run: | sudo apt-get update sudo apt-get install -y libgettextpo-dev - name: Build pakcage run: uv build - name: Twine check run: uvx twine check dist/* - name: Install test (source) run: | uv venv test-ttk-release-src . ./test-ttk-release-src/bin/activate uv pip install dist/translate_toolkit-*.tar.gz moz2po --help python ./test-ttk-release-src/lib/python*/site-packages/translate/lang/identify.py README.rst - name: Install test (wheel) run: | uv venv test-ttk-release-whl . ./test-ttk-release-whl/bin/activate uv pip install dist/translate_toolkit*.whl moz2po --help python ./test-ttk-release-whl/lib/python*/site-packages/translate/lang/identify.py README.rst - uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 with: name: setup - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 with: path: ./dist/* pypi-publish: if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') needs: - setup runs-on: ubuntu-24.04 permissions: # this permission is mandatory for trusted publishing id-token: write steps: - uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9 with: # unpacks default artifact into dist/ # if `name: artifact` is omitted, the action will create extra parent dir name: artifact path: dist - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 github-publish: if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') needs: - setup runs-on: ubuntu-24.04 permissions: # this permission is mandatory for creating a release contents: write steps: - uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9 with: # unpacks default artifact into dist/ # if `name: artifact` is omitted, the action will create extra parent dir name: artifact path: dist - uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0 with: artifacts: dist/* translate-3.15.1/.github/workflows/test.yml000066400000000000000000000044431476453735700207270ustar00rootroot00000000000000name: Tests on: push: branches-ignore: - dependabot/** - deepsource** pull_request: permissions: contents: read jobs: test: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: requirements: [latest] python-version: - '3.9' - '3.10' - '3.11' - '3.12' - '3.13' os: - ubuntu-latest - windows-latest - macos-latest include: - requirements: minimal python-version: '3.9' os: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: allow-prereleases: true python-version: ${{ matrix.python-version }} - uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1 with: enable-cache: true cache-dependency-glob: '' cache-suffix: ${{ matrix.python-version }} - name: Install apt dependencies if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgettextpo-dev libxml2-dev libxmlsec1-dev gettext hunspell-af - name: Install Windows dependencies if: matrix.os == 'windows-latest' run: | nuget install Gettext.Tools -Version 0.22.4 -OutputDirectory c:\nuget; Add-Content $env:GITHUB_PATH "C:\nuget\Gettext.Tools.0.22.4\tools\bin" - name: Minimalize deps if: matrix.requirements == 'minimal' run: sed -i '/^ *"/ s/>=/==/' pyproject.toml - name: Install pip dependencies run: uv sync --all-extras --dev - name: pytest run: make test - name: test-functional if: matrix.os == 'ubuntu-latest' env: PYTHON_ARGS: -m coverage run --append --source ${{ github.workspace }}/translate COVERAGE_FILE: ${{ github.workspace }}/.coverage run: | source .venv/bin/activate make test-functional - name: Coverage run: uv run coverage xml - uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0 with: name: ${{ runner.os }}, Python ${{ matrix.python-version }}, ${{ matrix.requirements }} translate-3.15.1/.gitignore000066400000000000000000000012351476453735700156140ustar00rootroot00000000000000# / /LICENSE # /docs/ /docs/_build/ # Python *.py[cod] *.egg-info # pytest .cache/ .pytest_cache/ # vim .*.swp *~ # PyCharm .idea/ # distutils /build/ /dist/ MANIFEST # Coverage .coverage* # Common virtualenv locations .venv venv uv.lock ############################## # translate/ specific excludes ############################## translate/storage/properties.class # Testing # ####### # Roundtrip testing noise translate/convert/diff_*.diff translate/convert/mozilla-l10n/ translate/convert/mozilla-gaia/ translate/convert/rewritten-po/ translate/convert/templates-recreated/ # other tests/xliff_conformance/af-pootle.xlf # cli testing tests/cli/results translate-3.15.1/.pre-commit-config.yaml000066400000000000000000000020131476453735700201000ustar00rootroot00000000000000# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: check-yaml - id: check-merge-conflict - id: check-json - id: check-toml - id: fix-encoding-pragma args: [--remove] - repo: meta hooks: - id: check-hooks-apply - id: check-useless-excludes - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.9.10 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.31.3 hooks: - id: check-github-workflows - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.14.0 hooks: - id: pretty-format-yaml args: [--autofix, --indent, '2'] - repo: https://github.com/pappasam/toml-sort rev: v0.24.2 hooks: - id: toml-sort-fix - repo: https://github.com/abravalheri/validate-pyproject rev: v0.23 hooks: - id: validate-pyproject translate-3.15.1/.readthedocs.yml000066400000000000000000000011621476453735700167110ustar00rootroot00000000000000# Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details version: 2 sphinx: configuration: docs/conf.py # Optionally build your docs in additional formats such as PDF and ePub formats: [] build: os: ubuntu-22.04 tools: python: '3.13' apt_packages: - libgettextpo0 jobs: create_environment: - asdf plugin add uv - asdf install uv latest - asdf global uv latest install: - uv sync --only-group docs build: html: - .venv/bin/sphinx-build -T -b html -d docs/_build/doctrees --jobs auto docs $READTHEDOCS_OUTPUT/html translate-3.15.1/COPYING000066400000000000000000000431001476453735700146540ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Moe Ghoul, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. translate-3.15.1/CREDITS000066400000000000000000000034121476453735700146430ustar00rootroot00000000000000Translate Toolkit Credits ========================= See the README file for an explanation of what the Translate Toolkit is See the ChangeLog (or version control history) for more detailed credits These are people who have contributed documentation or code, but bug reports are also a valuable contribution! Many people have contributed suggestions etc on the translate-devel list and these are also appreciated If you've been left out, let us know! Alphabetical Order of Contributors ---------------------------------- Alexander Dupuy: poterminology, quality checks Anders Kaplan: improvements to html2po, translation support for Markdown Caio Begotti: documentation Clytie Siddall: testing and bugreporting Dan Schafer (Mozilla): improvements to html2po David Farning: testing David Fraser: main development Dwayne Bailey: added tests, checks in pofilter, some helpful bash scripts, testing Filip Miletic: fixes for unicode problems, skype conversion Fredrik Corneliusson: xliff work Friedel Wolff: bug fixes, development Geoffrey Hutchison: better Qt .ts support Grégory Journé: better .rc support Ivan Masár: improvements to pocount Javier Sola: documentation Kaloian Doganov: improvement of po2html Lars Kruse: version control, indexing, support, reviews Marek Wieckowski: Qt ts file enhancements Matt Chisholm: fixes Matthias Klose: extra file options for converters Miklos Vajna: patches and testing of version control Nicolas François: po4a integration, performance Ognyan Kulev: testing and fixes Pavel Janík: testing Rail Aliev (Раиль Алиев): testing, converters, podebug Thomas Fogwill: portal code Tom Cato Amundsen: patch to enable pogrep to search anywhere in the PO unit Torsten Martinsen: patches to po2ts Walter Leibbrandt: development Wynand Winterbach: development translate-3.15.1/Makefile000066400000000000000000000011571476453735700152670ustar00rootroot00000000000000DOCS_DIR = docs .PHONY: all docs help test test-functional all: help docs: # The following creates the HTML docs. make -C ${DOCS_DIR} SPHINXOPTS="--show-traceback --fail-on-warning --jobs auto" html ${TAIL} docs-review: docs python -mwebbrowser file://$(shell pwd)/${DOCS_DIR}/_build/html/index.html help: @echo "Help" @echo "----" @echo @echo " docs - build Sphinx docs" @echo " docs-review - launch webbrowser to review docs" @echo " test - run unit test suite" @echo " test-functional - run the functional test suite" test: @uv run pytest --cov=. -r EfsxX test-functional: @tests/cli/run_tests.sh translate-3.15.1/README.rst000066400000000000000000000175041476453735700153210ustar00rootroot00000000000000Translate Toolkit ----------------- .. image:: https://img.shields.io/pypi/v/translate-toolkit.svg :alt: Released version :target: https://pypi.python.org/pypi/translate-toolkit/ .. image:: https://readthedocs.org/projects/translate-toolkit/badge/ :target: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/ .. image:: https://img.shields.io/pypi/pyversions/translate-toolkit.svg :alt: Supported Python versions :target: https://pypi.python.org/pypi/translate-toolkit/ .. image:: https://img.shields.io/pypi/l/translate-toolkit.svg :target: https://pypi.python.org/pypi/translate-toolkit/ :alt: License The Translate Toolkit is a set of software and documentation designed to help make the lives of localizers both more productive and less frustrating. The Toolkit is part of the Translate project, hosted at . The software includes programs to convert localization formats to the common PO, and emerging XLIFF format. There are also programs to check and manage PO and XLIFF files. Online documentation includes guides on using the tools, running a localization project and how to localize various projects from OpenOffice.org to Mozilla. At its core the software contains a set of classes for handling various localization storage formats: DTD, properties, OpenOffice.org GSI/SDF, CSV, MO, Qt .ts, TMX, TBX, WordFast txt, Gettext .mo, Windows RC, and of course PO and XLIFF. It also provides scripts to convert between these formats. Also part of the Toolkit are Python programs to create word counts, merge translations and perform various checks on translation files. Important Links --------------- * `Latest release downloads `_ * `Documentation `_, also use ``--help`` with any of the commands. * The Translate Toolkit is released under the `GPL `_ with `contributions from many people `_. * `Reporting issues `_ * `Installation `_ Joining the Translate Project ----------------------------- If you would like to join the translate project mailing list then visit: . The vision of the Translate Project is to be a meta project for localizers built on the premise that your language deserves to be a project on its own right not a poor cousin of the main project. Most projects are inattentive to the needs and difficulties experienced by localizers. To that end the aim is to work towards creating tools and documentation that allows localizers to focus on what they do best: translating software. Requirements ------------ There are several extra requirements which you might to install to get full feature set. This cal be easily specified during pip installation:: # Install with XML support pip install translate-toolkit[XML] # Install all optional dependencies pip install translate-toolkit[all] .. note:: Please check ``pyproject.toml`` The Toolkit requires Python 3.9 or newer. The package lxml is required. You should install version 4.6.3 or later. Depending on your platform, the easiest way to install might be through your system's package management. Alternatively you can try :: pip install lxml which should install the newest version from the web. For Mac OSX, the following pages might be of help: The package lxml has dependencies on libxml2 and libxslt. Please check the lxml site for the recommended versions of these libraries if you need to install them separately at all. Most packaged versions of lxml will already contain these dependencies. When the environment variable USECPO is set to 1, the toolkit will attempt to use libgettextpo from the gettext-tools package (it might have a slightly different name on your distribution). This can greatly speed up access to PO files, but has not yet been tested as extensively. Feedback is most welcome. The package iniparse is necessary for ini2po and po2ini: The python-Levenshtein package will improve performance for fuzzy matching if it is available. This can improve the performance of pot2po, for example. It is optional and no functionality is lost if it is not installed, only speed. Functions in the `lang.data` module can supply functions to translate language names using the `pycountry` package. It can even translate names in the format ``Language (Country)`` such as ``English (South Africa)`` This is used by Pootle and Virtaal. If the package is not installed, the language names will simply appear in English. It is therefore recommended you install the `pycountry` package. The package vobject is needed for ical2po and po2ical. The aeidon package is needed for sub2po and po2sub. Some Unicode encoded files (including most files from ) require version 0.14 or later. Trados TXT TM support requires the BeautifulSoup parser Markdown support requires the mistletoe parser Program overview ---------------- Use ``--help`` to find the syntax and options for all programs. * Converters:: oo2po - convert between OpenOffice.org GSI files and PO oo2xliff - convert between OpenOffice.org GSI files and XLIFF moz2po - convert between Mozilla files and PO csv2po - convert PO format to CSV for editing in a spreadsheet program php2po - PHP localisable string arrays converter. ts2po - convert Qt Linguist (.ts) files to PO txt2po - convert simple text files to PO html2po - convert HTML to PO (beta) md2po - convert Markdown to PO xliff2po - XLIFF (XML Localisation Interchange File Format) converter prop2po - convert Java .properties files to PO po2wordfast - Wordfast Translation Memory converter po2tmx - TMX (Translation Memory Exchange) converter pot2po - PO file initialiser csv2tbx - Create TBX (TermBase eXchange) files from Comma Separated Value (CSV) files ini2po - convert .ini files to to PO ical2po - Convert iCalendar files (*.ics) to PO sub2po - Convert many subtitle files to PO resx2po - convert .Net Resource (.resx) files to PO * Tools (Quality Assurance):: pofilter - run any of the 40+ checks on your PO files pomerge - merge corrected translations from pofilter back into your existing PO files. poconflicts - identify conflicting use of terms porestructure - restructures po files according to poconflict directives pogrep - find words in PO files * Tools (Other):: pocompile - create a Gettext MO files from PO or XLIFF files pocount - count translatable file formats (PO, XLIFF) podebug - Create comment in your PO files' msgstr which can then be used to quickly track down mistranslations as the comments appear in the application. posegment - Break a PO or XLIFF files into sentence segments, useful for creating a segmented translation memory. poswap - uses a translation of another language that you would rather use than English as source language poterminology - analyse PO or POT files to build a list of frequently occurring words and phrases translate-3.15.1/codecov.yml000066400000000000000000000000171476453735700157660ustar00rootroot00000000000000comment: false translate-3.15.1/docs/000077500000000000000000000000001476453735700145535ustar00rootroot00000000000000translate-3.15.1/docs/Makefile000066400000000000000000000131661476453735700162220ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = uv run sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext coverage help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/TranslateToolkit.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/TranslateToolkit.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/TranslateToolkit" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/TranslateToolkit" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Coverage report is in $(BUILDDIR)/coverage." translate-3.15.1/docs/_ext/000077500000000000000000000000001476453735700155125ustar00rootroot00000000000000translate-3.15.1/docs/_ext/translate_docs.py000066400000000000000000000017701476453735700210760ustar00rootroot00000000000000# # Copyright 2012 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . """Sphinx extension with custom stuff for Translate Toolkit docs.""" import docutils def setup(app): # :opt: to mark options -P --pot and options values --progress=dots app.add_generic_role(name="opt", nodeclass=docutils.nodes.literal) return {"parallel_read_safe": True} translate-3.15.1/docs/_static/000077500000000000000000000000001476453735700162015ustar00rootroot00000000000000translate-3.15.1/docs/_static/README.txt000066400000000000000000000000671476453735700177020ustar00rootroot00000000000000In this directory go static files, for example images. translate-3.15.1/docs/api/000077500000000000000000000000001476453735700153245ustar00rootroot00000000000000translate-3.15.1/docs/api/convert.rst000066400000000000000000000124631476453735700175440ustar00rootroot00000000000000convert ======= .. automodule:: translate.convert :show-inheritance: acesskey -------- .. automodule:: translate.convert.accesskey :members: :inherited-members: convert ------- .. automodule:: translate.convert.convert :members: :inherited-members: csv2po ------ .. automodule:: translate.convert.csv2po :members: :inherited-members: csv2tbx ------- .. automodule:: translate.convert.csv2tbx :members: :inherited-members: dtd2po ------ .. automodule:: translate.convert.dtd2po :members: :inherited-members: factory ------- .. automodule:: translate.convert.factory :members: :inherited-members: html2po ------- .. automodule:: translate.convert.html2po :members: :inherited-members: ical2po ------- .. automodule:: translate.convert.ical2po :members: :inherited-members: ini2po ------ .. automodule:: translate.convert.ini2po :members: :inherited-members: json2po ------- .. automodule:: translate.convert.json2po :members: :inherited-members: moz2po ------ .. automodule:: translate.convert.moz2po :members: :inherited-members: mozfunny2prop ------------- .. automodule:: translate.convert.mozfunny2prop :members: :inherited-members: mozlang2po ---------- .. automodule:: translate.convert.mozlang2po :members: :inherited-members: odf2xliff --------- .. automodule:: translate.convert.odf2xliff :members: :inherited-members: oo2po ----- .. automodule:: translate.convert.oo2po :members: :inherited-members: oo2xliff -------- .. automodule:: translate.convert.oo2xliff :members: :inherited-members: php2po ------ .. automodule:: translate.convert.php2po :members: :inherited-members: po2csv ------ .. automodule:: translate.convert.po2csv :members: :inherited-members: po2dtd ------ .. automodule:: translate.convert.po2dtd :members: :inherited-members: po2html ------- .. automodule:: translate.convert.po2html :members: :inherited-members: po2ical ------- .. automodule:: translate.convert.po2ical :members: :inherited-members: po2ini ------ .. automodule:: translate.convert.po2ini :members: :inherited-members: po2json ------- .. automodule:: translate.convert.po2json :members: :inherited-members: po2mozlang ---------- .. automodule:: translate.convert.po2mozlang :members: :inherited-members: po2moz ------ .. automodule:: translate.convert.po2moz :members: :inherited-members: po2oo ----- .. automodule:: translate.convert.po2oo :members: :inherited-members: po2php ------ .. automodule:: translate.convert.po2php :members: :inherited-members: po2prop ------- .. automodule:: translate.convert.po2prop :members: :inherited-members: po2rc ----- .. automodule:: translate.convert.po2rc :members: :inherited-members: po2resx ------- .. automodule:: translate.convert.po2resx :members: :inherited-members: po2sub ------ .. automodule:: translate.convert.po2sub :members: :inherited-members: po2symb ------- .. automodule:: translate.convert.po2symb :members: :inherited-members: po2tiki ------- .. automodule:: translate.convert.po2tiki :members: :inherited-members: po2tmx ------ .. automodule:: translate.convert.po2tmx :members: :inherited-members: po2ts ----- .. automodule:: translate.convert.po2ts :members: :inherited-members: po2txt ------ .. automodule:: translate.convert.po2txt :members: :inherited-members: po2web2py --------- .. automodule:: translate.convert.po2web2py :members: :inherited-members: po2wordfast ----------- .. automodule:: translate.convert.po2wordfast :members: :inherited-members: po2xliff -------- .. automodule:: translate.convert.po2xliff :members: :inherited-members: po2yaml ------- .. automodule:: translate.convert.po2yaml :members: :inherited-members: pot2po ------ .. automodule:: translate.convert.pot2po :members: :inherited-members: prop2mozfunny ------------- .. automodule:: translate.convert.prop2mozfunny :members: :inherited-members: prop2po ------- .. automodule:: translate.convert.prop2po :members: :inherited-members: rc2po ----- .. automodule:: translate.convert.rc2po :members: :inherited-members: resx2po ------- .. automodule:: translate.convert.resx2po :members: :inherited-members: sub2po ------ .. automodule:: translate.convert.sub2po :members: :inherited-members: symb2po ------- .. automodule:: translate.convert.symb2po :members: :inherited-members: tiki2po ------- .. automodule:: translate.convert.tiki2po :members: :inherited-members: ts2po ----- .. automodule:: translate.convert.ts2po :members: :inherited-members: txt2po ------ .. automodule:: translate.convert.txt2po :members: :inherited-members: web2py2po --------- .. automodule:: translate.convert.web2py2po :members: :inherited-members: xliff2odf --------- .. automodule:: translate.convert.xliff2odf :members: :inherited-members: xliff2oo -------- .. automodule:: translate.convert.xliff2oo :members: :inherited-members: xliff2po -------- .. automodule:: translate.convert.xliff2po :members: :inherited-members: yaml2po ------- .. automodule:: translate.convert.yaml2po :members: :inherited-members: translate-3.15.1/docs/api/filters.rst000066400000000000000000000014221476453735700175250ustar00rootroot00000000000000filters ======= .. automodule:: translate.filters :show-inheritance: autocorrect ----------- .. automodule:: translate.filters.autocorrect :members: :inherited-members: checks ------ .. automodule:: translate.filters.checks :members: :inherited-members: decoration ---------- .. automodule:: translate.filters.decoration :members: :inherited-members: helpers -------- .. automodule:: translate.filters.helpers :members: :inherited-members: pofilter -------- .. automodule:: translate.filters.pofilter :members: :inherited-members: prefilters ---------- .. automodule:: translate.filters.prefilters :members: :inherited-members: spelling -------- .. automodule:: translate.filters.spelling :members: :inherited-members: translate-3.15.1/docs/api/index.rst000066400000000000000000000014411476453735700171650ustar00rootroot00000000000000.. _api: API === The Translate Toolkit provides several modules for programmers to build their own tools. Module overview ---------------- The following will give you an idea about what each module is capable of. convert ^^^^^^^ .. automodule:: translate.convert :noindex: filters ^^^^^^^ .. automodule:: translate.filters :noindex: lang ^^^^ .. automodule:: translate.lang :noindex: misc ^^^^ .. automodule:: translate.misc :noindex: search ^^^^^^ .. automodule:: translate.search :noindex: services ^^^^^^^^ .. automodule:: translate.services :noindex: storage ^^^^^^^ .. automodule:: translate.storage :noindex: tools ^^^^^ .. automodule:: translate.tools :noindex: Module list ------------ All the modules included in the Translated Toolkit are listed here. translate-3.15.1/docs/api/lang.rst000066400000000000000000000063651476453735700170110ustar00rootroot00000000000000lang ==== .. automodule:: translate.lang :show-inheritance: af -- .. automodule:: translate.lang.af :members: :inherited-members: am -- .. automodule:: translate.lang.am :members: :inherited-members: ar -- .. automodule:: translate.lang.ar :members: :inherited-members: bn -- .. automodule:: translate.lang.bn :members: :inherited-members: code_or ------- .. automodule:: translate.lang.code_or :members: :inherited-members: common ------ .. automodule:: translate.lang.common :members: :inherited-members: data ---- .. automodule:: translate.lang.data :members: :inherited-members: de -- .. automodule:: translate.lang.de :members: :inherited-members: el -- .. automodule:: translate.lang.el :members: :inherited-members: es -- .. automodule:: translate.lang.es :members: :inherited-members: factory ------- .. automodule:: translate.lang.factory :members: :inherited-members: fa -- .. automodule:: translate.lang.fa :members: :inherited-members: fi -- .. automodule:: translate.lang.fi :members: :inherited-members: fr -- .. automodule:: translate.lang.fr :members: :inherited-members: gu -- .. automodule:: translate.lang.gu :members: :inherited-members: he -- .. automodule:: translate.lang.he :members: :inherited-members: hi -- .. automodule:: translate.lang.hi :members: :inherited-members: hy -- .. automodule:: translate.lang.hy :members: :inherited-members: identify -------- .. automodule:: translate.lang.identify :members: :inherited-members: ja -- .. automodule:: translate.lang.ja :members: :inherited-members: km -- .. automodule:: translate.lang.km :members: :inherited-members: kn -- .. automodule:: translate.lang.kn :members: :inherited-members: ko -- .. automodule:: translate.lang.ko :members: :inherited-members: ml -- .. automodule:: translate.lang.ml :members: :inherited-members: mr -- .. automodule:: translate.lang.mr :members: :inherited-members: ne -- .. automodule:: translate.lang.ne :members: :inherited-members: ngram ----- .. automodule:: translate.lang.ngram :members: :inherited-members: pa -- .. automodule:: translate.lang.pa :members: :inherited-members: poedit ------ .. automodule:: translate.lang.poedit :members: :inherited-members: si -- .. automodule:: translate.lang.si :members: :inherited-members: st -- .. automodule:: translate.lang.st :members: :inherited-members: sv -- .. automodule:: translate.lang.sv :members: :inherited-members: ta -- .. automodule:: translate.lang.ta :members: :inherited-members: team ---- .. automodule:: translate.lang.team :members: :inherited-members: te -- .. automodule:: translate.lang.te :members: :inherited-members: th -- .. automodule:: translate.lang.th :members: :inherited-members: ug -- .. automodule:: translate.lang.ug :members: :inherited-members: ur -- .. automodule:: translate.lang.ur :members: :inherited-members: vi -- .. automodule:: translate.lang.vi :members: :inherited-members: zh -- .. automodule:: translate.lang.zh :members: :inherited-members: translate-3.15.1/docs/api/misc.rst000066400000000000000000000017041476453735700170130ustar00rootroot00000000000000misc ==== .. automodule:: translate.misc :show-inheritance: dictutils --------- .. automodule:: translate.misc.dictutils :members: :inherited-members: file_discovery -------------- .. automodule:: translate.misc.file_discovery :members: :inherited-members: multistring ----------- .. automodule:: translate.misc.multistring :members: :inherited-members: optrecurse ---------- .. automodule:: translate.misc.optrecurse :members: :inherited-members: ourdom ------ .. automodule:: translate.misc.ourdom :members: :inherited-members: progressbar ----------- .. automodule:: translate.misc.progressbar :members: :inherited-members: quote ----- .. automodule:: translate.misc.quote :members: :inherited-members: wsgi ---- .. automodule:: translate.misc.wsgi :members: :inherited-members: xml_helpers ----------- .. automodule:: translate.misc.xml_helpers :members: :inherited-members: translate-3.15.1/docs/api/search.rst000066400000000000000000000005541476453735700173270ustar00rootroot00000000000000search ====== .. automodule:: translate.search :show-inheritance: lshtein ------- .. automodule:: translate.search.lshtein :members: :inherited-members: match ----- .. automodule:: translate.search.match :members: :inherited-members: terminology ----------- .. automodule:: translate.search.terminology :members: :inherited-members: translate-3.15.1/docs/api/services.rst000066400000000000000000000002611476453735700177000ustar00rootroot00000000000000services ======== .. automodule:: translate.services :show-inheritance: tmserver -------- .. automodule:: translate.services.tmserver :members: :inherited-members: translate-3.15.1/docs/api/storage.rst000066400000000000000000000150211476453735700175210ustar00rootroot00000000000000storage ======= .. automodule:: translate.storage :show-inheritance: base ---- .. automodule:: translate.storage.base :members: :inherited-members: benchmark --------- .. automodule:: translate.storage.benchmark :members: :inherited-members: bundleprojstore --------------- .. automodule:: translate.storage.bundleprojstore :members: :inherited-members: catkeys ------- .. automodule:: translate.storage.catkeys :members: :inherited-members: cpo --- .. automodule:: translate.storage.cpo :members: :inherited-members: csvl10n ------- .. automodule:: translate.storage.csvl10n :members: :inherited-members: directory --------- .. automodule:: translate.storage.directory :members: :inherited-members: dtd --- .. automodule:: translate.storage.dtd :members: :inherited-members: _factory_classes ---------------- .. automodule:: translate.storage._factory_classes :members: :inherited-members: factory ------- .. automodule:: translate.storage.factory :members: :inherited-members: fpo --- .. automodule:: translate.storage.fpo :members: :inherited-members: html ---- .. automodule:: translate.storage.html :members: :inherited-members: ical ---- .. automodule:: translate.storage.ical :members: :inherited-members: ini --- .. automodule:: translate.storage.ini :members: :inherited-members: jsonl10n -------- .. automodule:: translate.storage.jsonl10n :members: :inherited-members: lisa ---- .. automodule:: translate.storage.lisa :members: :inherited-members: markdown -------- .. automodule:: translate.storage.markdown :members: :inherited-members: mo -- .. automodule:: translate.storage.mo :members: :inherited-members: mozilla_lang ------------ .. automodule:: translate.storage.mozilla_lang :members: :inherited-members: odf_io ------ .. automodule:: translate.storage.odf_io :members: :inherited-members: odf_shared ---------- .. automodule:: translate.storage.odf_shared :members: :inherited-members: omegat ------ .. automodule:: translate.storage.omegat :members: :inherited-members: oo -- .. automodule:: translate.storage.oo :members: :inherited-members: placeables ---------- .. automodule:: translate.storage.placeables :show-inheritance: base ~~~~ .. automodule:: translate.storage.placeables.base :members: :inherited-members: general ~~~~~~~ .. automodule:: translate.storage.placeables.general :members: :inherited-members: interfaces ~~~~~~~~~~ .. automodule:: translate.storage.placeables.interfaces :members: :inherited-members: lisa ~~~~ .. automodule:: translate.storage.placeables.lisa :members: :inherited-members: parse ~~~~~ .. automodule:: translate.storage.placeables.parse :members: :inherited-members: strelem ~~~~~~~ .. automodule:: translate.storage.placeables.strelem :members: :inherited-members: terminology ~~~~~~~~~~~ .. automodule:: translate.storage.placeables.terminology :members: :inherited-members: xliff ~~~~~ .. automodule:: translate.storage.placeables.xliff :members: :inherited-members: php --- .. automodule:: translate.storage.php :members: :inherited-members: pocommon -------- .. automodule:: translate.storage.pocommon :members: :inherited-members: poheader -------- .. automodule:: translate.storage.poheader :members: :inherited-members: poparser -------- .. automodule:: translate.storage.poparser :members: :inherited-members: po -- .. automodule:: translate.storage.po :members: :inherited-members: poxliff ------- .. automodule:: translate.storage.poxliff :members: :inherited-members: project ------- .. automodule:: translate.storage.project :members: :inherited-members: projstore --------- .. automodule:: translate.storage.projstore :members: :inherited-members: properties ---------- .. automodule:: translate.storage.properties :members: :inherited-members: pypo ---- .. automodule:: translate.storage.pypo :members: :inherited-members: qm -- .. automodule:: translate.storage.qm :members: :inherited-members: qph --- .. automodule:: translate.storage.qph :members: :inherited-members: rc -- .. automodule:: translate.storage.rc :members: :inherited-members: statistics ---------- .. automodule:: translate.storage.statistics :members: :inherited-members: subtitles --------- .. automodule:: translate.storage.subtitles :members: :inherited-members: symbian ------- .. automodule:: translate.storage.symbian :members: :inherited-members: tbx --- .. automodule:: translate.storage.tbx :members: :inherited-members: tiki ---- .. automodule:: translate.storage.tiki :members: :inherited-members: tmdb ---- .. automodule:: translate.storage.tmdb :members: :inherited-members: tmx --- .. automodule:: translate.storage.tmx :members: :inherited-members: trados ------ .. automodule:: translate.storage.trados :members: :inherited-members: ts2 --- .. automodule:: translate.storage.ts2 :members: :inherited-members: ts -- .. automodule:: translate.storage.ts :members: :inherited-members: :deprecated: txt --- .. automodule:: translate.storage.txt :members: :inherited-members: utx --- .. automodule:: translate.storage.utx :members: :inherited-members: wordfast -------- .. automodule:: translate.storage.wordfast :members: :inherited-members: workflow -------- .. automodule:: translate.storage.workflow :members: :inherited-members: xliff ----- .. automodule:: translate.storage.xliff :members: :inherited-members: xml_extract ----------- .. automodule:: translate.storage.xml_extract :show-inheritance: extract ~~~~~~~ .. automodule:: translate.storage.xml_extract.extract :members: :inherited-members: generate ~~~~~~~~ .. automodule:: translate.storage.xml_extract.generate :members: :inherited-members: misc ~~~~ .. automodule:: translate.storage.xml_extract.misc :members: :inherited-members: unit_tree ~~~~~~~~~ .. automodule:: translate.storage.xml_extract.unit_tree :members: :inherited-members: xpath_breadcrumb ~~~~~~~~~~~~~~~~ .. automodule:: translate.storage.xml_extract.xpath_breadcrumb :members: :inherited-members: xml_name -------- .. automodule:: translate.storage.xml_name :members: :inherited-members: zip --- .. automodule:: translate.storage.zip :members: :inherited-members: translate-3.15.1/docs/api/tools.rst000066400000000000000000000032201476453735700172130ustar00rootroot00000000000000tools ===== .. automodule:: translate.tools :show-inheritance: build_tmdb ---------- .. automodule:: translate.tools.build_tmdb :members: :inherited-members: phppo2pypo ---------- .. automodule:: translate.tools.phppo2pypo :members: :inherited-members: poclean ------- .. automodule:: translate.tools.poclean :members: :inherited-members: pocompile --------- .. automodule:: translate.tools.pocompile :members: :inherited-members: poconflicts ----------- .. automodule:: translate.tools.poconflicts :members: :inherited-members: pocount ------- .. automodule:: translate.tools.pocount :members: :inherited-members: podebug ------- .. automodule:: translate.tools.podebug :members: :inherited-members: pogrep ------ .. automodule:: translate.tools.pogrep :members: :inherited-members: pomerge ------- .. automodule:: translate.tools.pomerge :members: :inherited-members: porestructure ------------- .. automodule:: translate.tools.porestructure :members: :inherited-members: posegment --------- .. automodule:: translate.tools.posegment :members: :inherited-members: poswap ------ .. automodule:: translate.tools.poswap :members: :inherited-members: poterminology ------------- .. automodule:: translate.tools.poterminology :members: :inherited-members: pretranslate ------------ .. automodule:: translate.tools.pretranslate :members: :inherited-members: pydiff ------ .. automodule:: translate.tools.pydiff :members: :inherited-members: pypo2phppo ---------- .. automodule:: translate.tools.pypo2phppo :members: :inherited-members: translate-3.15.1/docs/commands/000077500000000000000000000000001476453735700163545ustar00rootroot00000000000000translate-3.15.1/docs/commands/android2po.rst000066400000000000000000000037171476453735700211570ustar00rootroot00000000000000 .. _android2po: android2po ********** Converts Android resource files to Gettext PO format. .. _android2po#usage: Usage ===== :: android2po [options] Where: +------------+--------------------------------------------------------------+ | | is a valid Android resource file or directory of those files | +------------+--------------------------------------------------------------+ | | is a directory of PO or POT files | +------------+--------------------------------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: dots, none, bar, names, verbose --errorlevel=ERRORLEVEL show errorlevel as: none, message, exception, traceback -i INPUT, --input=INPUT read from INPUT in xml format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in xml format -S, --timestamp skip conversion if the output file has newer timestamp --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): merge, msgctxt (default: 'msgctxt') .. _android2po#examples: Examples ======== These examples demonstrate the use of android2po: android2po -i strings-en.xml -o en.po to simply convert *strings-en.xml* to *en.po*. To convert a source and target Android resources files into a PO file: android2po -t strings-en.xml -i strings-ca.xml -o ca.po *strings-en.xml* contains the template resource and *strings-ca.xml* the localised resource strings. translate-3.15.1/docs/commands/csv2po.rst000066400000000000000000000121111476453735700203160ustar00rootroot00000000000000 .. _csv2po: .. _po2csv: csv2po ****** Convert between CSV (Comma Separated Value) files and the PO format. This is useful for those translators who can only use a Spreadsheet, a modern spreadsheet can open CSV files for editing. It is also useful if you have other data such as translation memory in CSV format and you wish to use it with your PO translations. If you are starting out with your own CSV files (not created by po2csv), take note of the assumptions of the column layout explained below. .. _csv2po#usage: Usage ===== :: csv2po [options] po2csv [options] Where: +--------+----------------------------------------------+ | | is a file or directory containing CSV files | +--------+----------------------------------------------+ | | is a file or directory containing PO files | +--------+----------------------------------------------+ Options (csv2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in csv format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in po, pot, pot formats -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --charset=CHARSET set charset to decode from csv files --columnorder=COLUMNORDER specify the order and position of columns (location,source,target,context) --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') Options (po2csv): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in csv format -S, --timestamp skip conversion if the output file has newer timestamp --columnorder=COLUMNORDER specify the order and position of columns (location,source,target,context) .. _csv2po#csv_file_layout: CSV file layout =============== The resultant CSV file has the following layout +--------+-----------------+---------------------------------------------+ | Column | Data | Description | +========+=================+=============================================+ | A | Location | All the PO #: location comments. These are | | | | needed to reconstruct or merge the CSV back | | | | into the PO file | +--------+-----------------+---------------------------------------------+ | B | Source Language | The msgid or source string | +--------+-----------------+---------------------------------------------+ | C | Target Language | The msgstr or target language | +--------+-----------------+---------------------------------------------+ The layout can be customized by ``--columnorder``, you can add, or remove columns using that as well, for example ``--columnorder=context,source,target``. .. _csv2po#examples: Examples ======== These examples demonstrate the use of csv2po:: po2csv -P pot csv We use the :opt:`-P` option to recognise POT files found in *pot* and convert them to CSV files placed in *csv*:: csv2po csv po Convert CSV files in *csv* to PO files placed in *po*:: csv2po --charset=windows-1250 -t pot csv po User working on Windows will often return files encoded in everything but Unicode. In this case we convert CSV files found in *csv* from *windows-1250* to UTF-8 and place the correctly encoded files in *po*. We use the templates found in *pot* to ensure that we preserve formatting and other data. Note that UTF-8 is the only available destination encoding. :: csv2po --columnorder=location,target,source fr.csv fr.po In case the CSV file has the columns in a different order you may use ``--columnorder``. .. _csv2po#bugs: Bugs ==== * Translation comments #[space] and KDE comments _: are not available in CSV mode which effects the translators effectiveness * Locations #: that are not conformant to PO (i.e. have spaces) will get messed up by PO tools. translate-3.15.1/docs/commands/csv2tbx.rst000066400000000000000000000064421476453735700205070ustar00rootroot00000000000000 .. _csv2tbx: csv2tbx ******* Convert between CSV (Comma Separated Value) files and the :doc:`/formats/tbx` format for terminology exchange. .. _csv2tbx#usage: Usage ===== :: csv2tbx [--charset=CHARSET] [--columnorder=COLUMNORDER] Where: +--------+------------------------+ | | is a CSV file | +--------+------------------------+ | | is the target TBX file | +--------+------------------------+ Options (csv2tbx): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in csv format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in tbx format -S, --timestamp skip conversion if the output file has newer timestamp --charset=CHARSET set charset to decode from csv files --columnorder=COLUMNORDER specify the order and position of columns (comment,source,target) .. _csv2tbx#csv_file_layout: CSV file layout =============== The CSV file is expected to have three columns (separated by commas, not other characters like semicolons), of which the default layout is +--------+-----------------+-------------------------------------------------+ | Column | Data | Description | +========+=================+=================================================+ | A | Comment | All the PO #: location comments. These are not | | | | used in the TBX files, and can be left empty, | | | | but could be generated by :doc:`po2csv `| +--------+-----------------+-------------------------------------------------+ | B | Source Language | The msgid or source string | +--------+-----------------+-------------------------------------------------+ | C | Target Language | The msgstr or target language | +--------+-----------------+-------------------------------------------------+ .. _csv2tbx#examples: Examples ======== These examples demonstrate the use of csv2tbx:: csv2tbx terms.csv terms.tbx to simply convert *terms.csv* to *terms.tbx*. To convert a directory recursively to another directory with the same structure of files:: csv2tbx csv-dir tbx-target-dir This will convert CSV files in *csv-dir* to TBX files placed in *tbx-target-dir*.:: csv2tbx --charset=windows-1250 csv tbx Users working on Windows will often return files in encoding other the Unicode based encodings. In this case we convert CSV files found in *csv* from *windows-1250* to UTF-8 and place the correctly encoded files in *tbx*. Note that UTF-8 is the only available destination encoding. .. _csv2tbx#two_column_csv: Two column CSV ============== :: csv2tbx --columnorder=source,target foo.csv foo.tbx .. _csv2tbx#notes: Notes ===== For conformance to the standards and to see which features are implemented, see :doc:`/formats/csv` and :doc:`/formats/tbx`. translate-3.15.1/docs/commands/flatxml2po.rst000066400000000000000000000117431476453735700212040ustar00rootroot00000000000000.. _flatxml2po: .. _po2flatxml: flatxml2po ********** Converts flat XML (.xml) files to Gettext PO format, a simple monolingual and single-level XML. .. _flatxml2po#usage: Usage ===== :: flatxml2po [options] po2flatxml [options] [-t ] Where: +-------------+--------------------------------------------------------+ | | is a valid .xml file or directory of those files | +-------------+--------------------------------------------------------+ | | is a directory of PO or POT files | +-------------+--------------------------------------------------------+ | | is a template or the original file before translation. | | | required for roundtrips preserving extraneous data. | +-------------+--------------------------------------------------------+ Options (flatxml2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in xml format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -S, --timestamp skip conversion if the output file has newer timestamp -r ROOT, --root=ROOT name of the XML root element (default: "root") -v VALUE, --value=VALUE name of the XML value element (default: "str") -k KEY, --key=KEY name of the XML key attribute (default: "key") -n NS, --namespace=NS XML namespace uri (default: None) Options (po2flatxml): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in xml format -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in xml format -S, --timestamp skip conversion if the output file has newer timestamp -r ROOT, --root=ROOT name of the XML root element (default: "root") -v VALUE, --value=VALUE name of the XML value element (default: "str") -k KEY, --key=KEY name of the XML key attribute (default: "key") -n NS, --namespace=NS XML namespace uri (default: None) -w INDENT, --indent=INDENT indent width in spaces, 0 for no indent (default: 2) .. _flatxml2po#formats-supported: Formats Supported ================= Check :doc:`flat XML format ` document to see to which extent the XML format is supported. .. _flatxml2po#examples: Examples ======== This example looks at roundtrip of flat XML translations as well as recovery of existing translations. First we need to create a set of POT files.:: flatxml2po -P lang/en pot/ All .xml files found in the ``lang/en`` directory are converted to Gettext POT files and placed in the ``pot`` directory. If you are translating for the first time then you can skip the next step. If you need to recover your existing translations then we do the following:: flatxml2po -t lang/en lang/zu po-zu/ Using the English XML files found in ``lang/en`` and your existing Zulu translation in ``lang/zu`` we create a set of PO files in ``po-zu``. These will now have your translations. Please be aware that in order for that to work 100% you need to have both English and Zulu at the same revision, if they are not you will have to review all translations. You are now in a position to translate your recovered translations or your new POT files. Once translated you can convert back as follows:: po2flatxml -t lang/en po-zu/ lang/zu Your translations found in the Zulu PO directory, ``po-zu``, will be converted to XML using the files in ``lang/en`` as templates and placing your new translations in ``lang/zu``. To update your translations simply redo the POT creation step and make use of :doc:`pot2po` to bring your translation up-to-date. .. _flatxml2po#limitations: Limitations =========== Indentation only supports spaces (specified with ``--indent`` greater than zero) or flattened (no indentation, everything on a single line; specified with ``--indent`` set to zero). Tabs are not supported using po2flatxml. translate-3.15.1/docs/commands/general_usage.rst000066400000000000000000000040171476453735700217110ustar00rootroot00000000000000 .. _general_usage: General Usage ************* The tools follow a general usage convention which is helpful to understand. .. _general_usage#input_&_output: Input & Output ============== The last two arguments of your command are the input and output files/directories:: moz2po You can of course still use the :opt:`-i` and :opt:`-o` options which allows you to reorder commands :: moz2po -o -i .. _general_usage#error_reporting: Error Reporting =============== All tools accept the option :opt:`--errorlevel`. If you find a bug, add this option and send the traceback to the developers. :: moz2po --errorlevel=traceback .. _general_usage#templates: Templates ========= If you are working with any file format and you wish to preserve comments and layout then use your source file as a template. :: po2dtd -t This will use the files in ```` as a template, merge the PO files in ````, and create new DTD files in ```` If you ran this without the templates you would get valid DTD files but they would not preserve the layout or all the comments from the source DTD file The same concept of templates is also used when you merge files. :: pomerge -t This would take the ```` files merge in the ```` and output new PO files, preserving formatting, into ````. You can use the same directory for ```` and ```` if you want the merges to overwrite files in ````. .. _general_usage#source2target: source2target ============= The converters all follow this convention: * source = the format from which you are converting e.g. in :doc:`oo2po ` we are converting from OpenOffice.org SDF/GSI * target = the format into which you are converting e.g. in :doc:`oo2po ` we are converting to Gettext PO .. _general_usage#getting_help: Getting Help ============ The :opt:`--help` option will always list the available commands for the tool. :: moz2po --help translate-3.15.1/docs/commands/html2po.rst000066400000000000000000000120221476453735700204700ustar00rootroot00000000000000 .. _html2po: .. _po2html: html2po, po2html **************** Convert translatable items in HTML to the PO format. Insert translated text into HTML templates. .. _html2po#usage: Usage ===== :: html2po [options] po2html [options] -i -t -o Where: +-------------+---------------------------------------------------------------------------------+ | | is an HTML file or a directory of HTML files, source language | +-------------+---------------------------------------------------------------------------------+ | | is an HTML file or a directory of HTML files, translated to the target language | +-------------+---------------------------------------------------------------------------------+ | | is a PO file or directory of PO files | +-------------+---------------------------------------------------------------------------------+ Options (html2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in htm, html, xhtml formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) -u, --untagged include untagged sections --keepcomments preserve html comments as translation notes in the output --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') --multifile=MULTIFILESTYLE how to split po/pot files (:doc:`single, toplevel or onefile `) (default: 'single'; if set to 'onefile', a single po/pot file will be written. 'toplevel' not used.) Options (po2html): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in htm, html, xhtml formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in htm, html, xhtml formats -S, --timestamp skip conversion if the output file has newer timestamp --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) .. _html2po#examples: Examples ======== :: html2po -P site pot This will find all HTML files (.htm, .html, .xhtml) in *site*, convert them to POT files and place them in *pot*. You can create and update PO files for different languages using the :doc:`pot2po` command. For example, you can create PO files for a translation to Xhosa like this: :: pot2po -i pot -t site -o xh This will merge the POT files in *pot* into the PO files in *xh* (if any). And then, after editing the PO files in *xh*, you can generate the translated version of the web site like so: :: po2html -i xh -t site -o site-xh All the PO translations in *xh* will be converted to HTML using HTML files in *site* as templates and outputting new translated HTML files in *site-xh*. Should you prefer a single PO/POT file for your web site, you can create one like so: :: html2po -P --multifile=onefile site file.pot When po2html is invoked with a single PO file as input, and a directory of template HTML files, it will produce one output file per template file. So to generate translated output files from a single PO file, invoke po2html like so: :: po2html -i xh.po -t site -o site-xh In this example, *xh.po* is the translation file for Xhosa, *site* is the directory where the HTML files in the source language can be found, and *site-xh* is the directory where the translated HTML files will end up. .. _html2po#notes: Notes ===== The :doc:`HTML format description ` gives more details on the format of the localisable HTML content and the capabilities of this converter. .. _html2po#bugs: Bugs ==== Some items end up in the msgid's that should not be translated translate-3.15.1/docs/commands/ical2po.rst000066400000000000000000000102771476453735700204460ustar00rootroot00000000000000 .. _ical2po: .. _po2ical: ical2po ******* .. versionadded:: 1.2 Converts iCalendar (\*.ics) files to Gettext PO format. .. _ical2po#usage: Usage ===== :: ical2po [options] po2ical [options] -t Where: +---------+---------------------------------------------------+ | | is a valid .ics file or directory of those files | +---------+---------------------------------------------------+ | | is a directory of PO or POT files | +---------+---------------------------------------------------+ Options (ical2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in ics format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in ics format -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') Options (po2ical): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in ics format -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in ics format -S, --timestamp skip conversion if the output file has newer timestamp --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) .. _ical2po#examples: Examples ======== This example looks at roundtrip of iCalendar translations. While you can do recovery of translations, its unlikely that you will ever need to do that. First we need to create a set of POT files. :: ical2po -P ical.ics ical.pot The ical.ics file is converted to Gettext POT files called ical.pot. Directories of iCalendar files can also be processed. Begin translating the ical.pot file by first copying it to make a PO file. :: cp ical.pot ical-af.po You are now in a position to translate the file ical-af.po in your favourite translation tool. Once translated you can convert back as follows:: po2ical -t ical.ics ical-af.po ical-af.ics Your translations found in the Afrikaans PO file, ``ical-af.po``, will be converted to .ics using the file ``ical.ics`` as a template and creating your newly translated .ics file ``ical-af.ics``. To update your translations simply redo the POT creation step and make use of :doc:`pot2po` to bring your translation up-to-date. .. _ical2po#notes: Notes ===== The converter will only process events in the calendar file, the file itself can contain many other things that could be localisable. Please raise a bug if you want to extract additional items. The converter does not make use of the LANGUAGE attribute which is permitted in the format. The LANGUAGE attribute does not aid multilingualism in this context so is ignored. The converter could conceivably also process :wp:`vCard ` files, but this has not been implemented for lack of a clear need. Please raise a bug with an example if you have such a file that could benefit from localisation. translate-3.15.1/docs/commands/index.rst000066400000000000000000000140001476453735700202100ustar00rootroot00000000000000.. _commands: .. _commands#converters: Converters ********** .. toctree:: :maxdepth: 1 :hidden: general_usage android2po csv2po csv2tbx flatxml2po html2po ical2po ini2po json2po md2po moz2po odf2xliff oo2po php2po po2tmx po2wordfast pot2po prop2po rc2po resx2po sub2po symb2po tbx2po tiki2po ts2po txt2po web2py2po xliff2po yaml2po .. toctree:: :maxdepth: 1 :hidden: option_accelerator option_duplicates option_errorlevel option_filteraction option_multifile option_personality option_progress Converters change many different formats to PO and back again. Sometimes only one direction is supported, or conversion is done using non-PO formats. The converters follow a :doc:`general pattern of usage `, understanding that will make the converters much easier to use and understand. * :doc:`android2po ` -- Android resources to PO converter * :doc:`csv2po ` -- Comma Separated Value (CSV) converter. Useful for doing translations using a spreadsheet. * :doc:`csv2tbx ` -- Create TBX (TermBase eXchange) files from Comma Separated Value (CSV) files * :doc:`flatxml2po ` -- Flat XML converter * :doc:`html2po ` -- HTML converter * :doc:`ical2po ` -- iCalendar file converter * :doc:`ini2po ` -- Windows INI file converter * :doc:`json2po ` -- JSON file converter * :doc:`md2po ` -- Markdown file converter * :doc:`moz2po ` -- Mozilla .properties and .dtd converter. Works with Firefox and Thunderbird * :doc:`odf2xliff ` -- Convert OpenDocument (ODF) documents to XLIFF and vice-versa. * :doc:`oo2po ` -- OpenOffice.org SDF converter (Also works as ``oo2xliff``). * :doc:`php2po ` -- PHP localisable string arrays converter. * :doc:`po2tmx ` -- TMX (Translation Memory Exchange) converter * :doc:`po2wordfast ` -- Wordfast Translation Memory converter * :doc:`pot2po ` -- initialise PO Template files for translation * :doc:`prop2po ` -- Java property file (.properties) converter * :doc:`rc2po ` -- Windows Resource .rc (C++ Resource Compiler) converter * :doc:`resx2po ` -- .Net Resource (.resx) file converter * :doc:`sub2po ` -- Converter for various subtitle files * :doc:`symb2po ` -- Symbian-style translation to PO converter * :doc:`tiki2po ` -- `TikiWiki `_ language.php converter * :doc:`ts2po ` -- Qt Linguist .ts converter * :doc:`txt2po ` -- Plain text to PO converter * :doc:`web2py2po` -- web2py translation to PO converter * :doc:`xliff2po ` -- XLIFF (XML Localisation Interchange File Format) converter * :doc:`yaml2po ` -- YAML (Yet Another Markup Language) converter .. _commands#tools: Tools ***** The PO tools allow you to manipulate and work with PO files .. _commands#quality_assurance: Quality Assurance ================= .. toctree:: :maxdepth: 1 :hidden: junitmsgfmt poconflicts pofilter pofilter_tests pogrep pomerge porestructure These tools are especially useful for measuring and improving translation quality. * :doc:`junitmsgfmt` -- run msgfmt and provide JUnit type output for use in continuous integration systems like Hudson and Jenkins * :doc:`poconflicts` -- extract messages that have conflicting translation * :doc:`pofilter` -- filter PO files to find common errors using a :doc:`number of tests ` * :doc:`pogrep` -- find strings in your PO files * :doc:`pomerge` -- merge file extracted using pofilter back into the original files * :doc:`porestructure` -- restructures PO files according to poconflict directives .. _commands#other_tools: Other tools =========== .. toctree:: :maxdepth: 1 :hidden: levenshtein_distance option_rewrite poclean pocompile pocount podebug posegment poswap poterminology poterminology_stopword_file pretranslate tmserver * :doc:`levenshtein_distance` -- edit distance algorithms for translation memory matching * :doc:`poclean` -- produces a clean file from an unclean file (Trados/Wordfast) by stripping out the tw4win indicators * :doc:`pocompile` -- create an MO (Machine Object) file from a PO or XLIFF file * :doc:`pocount` -- Count words and strings in PO, XLIFF and other types of translatable files * :doc:`podebug` -- Add debug strings to messages * :doc:`posegment` -- Break a PO or XLIFF files into sentence segments, useful for creating a segmented translation memory * :doc:`poswap` -- uses a translation of another language that you would rather use than English as source language * :doc:`poterminology` -- extracts potential terminology from your translation files * :doc:`pretranslate` -- fill any missing translations from translation memory via fuzzy matching. * :doc:`tmserver` -- a Translation Memory server, can be queried over HTTP using JSON .. _commands#scripts: Scripts ******* .. toctree:: :maxdepth: 1 :hidden: phase pocommentclean pocompendium pomigrate2 popuretext poreencode posplit The scripts are for working with and manipulating PO files. Unlike the ``tools`` which are written in Python, the scripts are written in ``bash``. Some of them are packaged since version 1.0 of the Toolkit, but you might need to download them from version control and do a manual installation . * :doc:`phase` -- Helps manage a project divided into phases of work, including sending, checking, etc * :doc:`pocompendium` -- Creates various types of PO compendium (i.e. combines many PO files into a single PO file) * :doc:`pocommentclean` -- Remove all translator comments from a PO file * :doc:`pomigrate2` -- Migrate older PO files to new POT files * :doc:`popuretext` -- Extracts all the source text from a directory of POT files * :doc:`poreencode` -- Converts PO files to a new character encoding * :doc:`posplit` -- Split a PO file into translate, untranslated and fuzzy files translate-3.15.1/docs/commands/ini2po.rst000066400000000000000000000125521476453735700203130ustar00rootroot00000000000000 .. _ini2po: .. _po2ini: ini2po ****** Converts .ini files to Gettext PO format. .. _ini2po#usage: Usage ===== :: ini2po [options] po2ini [options] -t Where: +---------+---------------------------------------------------+ | | is a valid .ini file or directory of those files | +---------+---------------------------------------------------+ | | is a directory of PO or POT files | +---------+---------------------------------------------------+ Options (ini2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in ini, isl, iss formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in ini, isl, iss formats -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') Options (po2ini): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in ini, isl formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in ini, isl formats -S, --timestamp skip conversion if the output file has newer timestamp --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) .. _ini2po#formats_supported: Formats Supported ================= INI files need to be organized into separate languages per file and in the following format:: [Section] ; a comment a = a string Comment marked with the hash symbol (#) are also allowed, and the colon (:) is also accepted as key-value delimiter:: [Section] # another comment b : a string This variants in comment marks and key-value delimiters can be mixed in one single INI file:: [Section] ; a comment a = a string # another comment b : a string c:'other example with apostrophes' d:"example with double quotes" The spacing between the key-value delimiter and the key, and the between the value and the key-value delimiter is not important since the converter automatically strips the blank spaces. .. note:: A section must be present at the file beginning in order to get ini2po working properly. You may add it by hand at the file beginning. .. note:: Strings marked with double quotes and/or apostrophes will carry these quotation marks to the generated .po file, so they will appear like: .. code-block:: po #: [Section]c msgid "'other example with apostrophes'" msgstr "" #: [Section]d msgid "\"example with double quotes\"" msgstr "" .. _ini2po#examples: Examples ======== This example looks at roundtrip of .ini translations as well as recovery of existing translations. First we need to create a set of POT files. :: ini2po -P ini/ pot/ All .ini files found in the ``ini/`` directory are converted to Gettext POT files and placed in the ``pot/`` directory. If you are translating for the first time then you can skip the next step. If you need to recover your existing translations then we do the following:: ini2po -t lang/ zu/ po-zu/ Using the English .ini files found in ``lang/`` and your existing Zulu translation in ``zu/`` we create a set of PO files in ``po-zu/``. These will now have your translations. Please be aware that in order for the to work 100% you need to have both English and Zulu at the same revision. If they are not, you will have to review all translations. You are now in a position to translate your recovered translations or your new POT files. Once translated you can convert back as follows:: po2ini -t lang/ po-zu/ zu/ Your translations found in the Zulu PO directory, ``po-zu/``, will be converted to .ini using the files in ``lang/`` as templates and placing your newly translated .ini files in ``zu/``. To update your translations simply redo the POT creation step and make use of :doc:`pot2po` to bring your translation up-to-date. .. _ini2po#issues: Issues ====== We do not extract comments from .ini files. These are sometimes needed as developers provide guidance to translators in these comments. translate-3.15.1/docs/commands/json2po.rst000066400000000000000000000100121476453735700204720ustar00rootroot00000000000000 .. _json2po: .. _po2json: json2po ******* Converts .json files to Gettext PO format. .. _json2po#usage: Usage ===== :: json2po [options] po2json [options] -t Where: +---------+---------------------------------------------------+ | | is a valid .json file or directory of those files | +---------+---------------------------------------------------+ | | is a directory of PO or POT files | +---------+---------------------------------------------------+ Options (json2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in JSON format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in JSON format -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --filter=FILTER leaves to extract e.g. 'name,desc': (default: extract everything) --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') Options (po2json): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in JSON format -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in JSON format -S, --timestamp skip conversion if the output file has newer timestamp --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) --removeuntranslated remove untranslated strings from output .. _json2po#examples: Examples ======== This example looks at roundtrip of .json translations as well as recovery of existing translations. First we need to create a set of POT files. :: json2po -P json/ pot/ All .json files found in the ``json/`` directory are converted to Gettext POT files and placed in the ``pot/`` directory. If you are translating for the first time then you can skip the next step. If you need to recover your existing translations then we do the following:: json2po -t lang/ zu/ po-zu/ Using the English .json files found in ``lang/`` and your existing Zulu translation in ``zu/`` we create a set of PO files in ``po-zu/``. These will now have your translations. Please be aware that in order for the to work 100% you need to have both English and Zulu at the same revision. If they are not, you will have to review all translations. You are now in a position to translate your recovered translations or your new POT files. Once translated you can convert back as follows:: po2json -t lang/ po-zu/ zu/ Your translations found in the Zulu PO directory, ``po-zu/``, will be converted to .json using the files in ``lang/`` as templates and placing your newly translated .json files in ``zu/``. To update your translations simply redo the POT creation step and make use of :doc:`pot2po` to bring your translation up-to-date. translate-3.15.1/docs/commands/junitmsgfmt.rst000066400000000000000000000005441476453735700214600ustar00rootroot00000000000000 .. _junitmsgfmt: junitmsgfmt *********** .. versionadded:: 3.9 Added --untranslated flag, to enable reporting of untranslated messages. .. versionadded:: 1.7 Run msgfmt and provide JUnit type output for use in continuous integration systems like Hudson and Jenkins. .. _junitmsgfmt#usage: Usage ===== :: junitmsgfmt po/*.po > msgfmt_junit.xml translate-3.15.1/docs/commands/levenshtein_distance.rst000066400000000000000000000051071476453735700233070ustar00rootroot00000000000000 .. _levenshtein_distance: Levenshtein distance ******************** The :wp:`levenshtein distance ` is used for measuring the *"distance"* or similarity of two character strings. Other similarity algorithms can be supplied to the code that does the matching. This code is used in :doc:`pot2po`, :doc:`tmserver` and `Virtaal `_. It is implemented in the toolkit, but can optionally use the fast C implementation provided by `python-Levenshtein `_ if it is installed. It is strongly recommended to have **python-levenshtein** installed. To exercise the code the classfile *"Levenshtein.py"* can be executed directly with: .. code-block:: console $ python Levenshtein.py "The first string." "The second string" .. note:: Remember to quote the two parameters. The following things should be noted: * Only the first ``MAX_LEN`` characters are considered. Long strings differing at the end will therefore seem to match better than they should. A penalty is awarded if strings are shortened. * The calculation can stop prematurely as soon as it realise that the supplied minimum required similarity cannot be reached. Strings with widely different lengths give the opportunity for this shortcut. This is by definition of the Levenshtein distance: the distance will be at least as much as the difference in string length. Similarities lower than your supplied minimum (or the default) should therefore not be considered authoritative. .. _levenshtein_distance#shortcommings: Shortcommings ============= The following shortcommings have been identified: * **Cases sensitivity:** *'E'* and *'e'* are considered different characters and according differ as much as *'z'* and *'e'*. This is not ideal, as case differences should be considered less of a difference. * **Diacritics:** *'ê'* and *'e'* are considered different characters and according differ as much as *'z'* and *'e'*. This is not ideal, as missing diacritics could be due to small input errors, or even input data that simply do not have the correct diacritics. * **Similar but different words:** Words that have similar characters, but are different, could increase the similarity beyond what is wanted. The sentences *"It is though."* and *"It is dough."* differ markedly semantically, but score similarity of almost 85%. A possible solution is to do an additional calculation based on words, instead of characters. * **Whitespace:** Differences in tabs, newlines, and space usage should perhaps be considered as a special case. translate-3.15.1/docs/commands/md2po.rst000066400000000000000000000117021476453735700201300ustar00rootroot00000000000000 .. _md2po: .. _po2md: md2po, po2md ************ Convert translatable items in Markdown text to the PO format. Insert translated text into Markdown templates. .. _md2po#usage: Usage ===== :: md2po [options] po2md [options] -i -t -o Where: +-----------+----------------------------------------------------------------------------------------+ | | is a Markdown file or a directory of Markdown files, source language | +-----------+----------------------------------------------------------------------------------------+ | | is a Markdown file or a directory of Markdown files, translated to the target language | +-----------+----------------------------------------------------------------------------------------+ | | is a PO file or directory of PO files | +-----------+----------------------------------------------------------------------------------------+ Options (md2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in Markdown format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') --multifile=MULTIFILESTYLE how to split po/pot files (:doc:`single, toplevel or onefile `) (default: 'single'; if set to 'onefile', a single po/pot file will be written. 'toplevel' not used.) Options (po2md): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in Markdown format -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in Markdown format -S, --timestamp skip conversion if the output file has newer timestamp -m MAXLENGTH, --maxlinelength=MAXLENGTH reflow (word wrap) the output to the given maximum line length. set to 0 to disable --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) .. _md2po#examples: Examples ======== :: md2po -P source-md-dir pot This will find all Markdown files (.md, .markdown, .txt, .text) in *source-md-dir*, convert them to POT files (that is, extract all translatable content) and place them in *pot*. See the :doc:`pot2po` command for more information about how to create PO files from the POT files, and to update existing PO files when the POT files have changed. Suppose you have created PO files for translation to Xhosa and placed them in the directory *xh*. You can then generate the translated version of the Markdown documents like so: :: po2md -i xh -t source-md-dir -o xh-md-dir All the PO translations in *xh* will be converted to Markdown using Markdown files in *source-md-dir* as templates and outputting new translated Markdown files in *xh-md-dir*. Should you prefer a single PO/POT file for your collection of Markdown files, this is how to do it: :: md2po -P --multifile=onefile source-md-dir file.pot And similarly, to generate multiple translated output files from a single PO file, invoke po2md like so: :: po2md -i xh.po -t source-md-dir -o xh-md-dir In this example, *xh.po* is the translation file for Xhosa, *source-md-dir* is the directory where the Markdown files in the source language can be found, and *xh-md-dir* is the directory where the translated Markdown files will end up. .. _md2po#notes: Notes ===== The :doc:`Markdown format description ` gives more details on the format of the localisable Markdown content and the capabilities of this converter. translate-3.15.1/docs/commands/moz2po.rst000066400000000000000000000161331476453735700203400ustar00rootroot00000000000000 .. _moz2po: .. _po2moz: moz2po ****** moz2po converts Mozilla files to PO files. It wraps converters that handle .properties, .dtd and some strange Mozilla files. The tool can work with files from Mozilla's Mercurial repository. The tools thus provides a complete roundtrip for Mozilla localisation using PO files and PO editors. .. note:: This page should only be used as a reference to the command-line options for moz2po and po2moz. .. _moz2po#usage: Usage ===== :: moz2po [options] po2moz [options] Where: +---------+---------------------------------------------------+ | | is a directory containing valid Mozilla files | +---------+---------------------------------------------------+ | | is a directory of PO or POT files | +---------+---------------------------------------------------+ .. program:: moz2po Options (moz2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in inc, it, \*, dtd, properties formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in it.po, it.pot, manifest, xhtml.po, xhtml.pot, ini.po, ini.pot, rdf, js, \*, html.po, html.pot, inc.po, inc.pot, dtd.po, dtd.pot, properties.po, properties.pot formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in it, \*, properties, dtd, inc formats -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') .. program:: po2moz Options (po2moz): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in dtd.po, dtd.pot, ini.po, ini.pot, inc.po, inc.pot, manifest, it.po, it.pot, \*, html.po, html.pot, js, rdf, properties.po, properties.pot, xhtml.po, xhtml.pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in dtd, \*, inc, it, properties formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in dtd, \*, inc, it, properties formats -S, --timestamp skip conversion if the output file has newer timestamp -l LOCALE, --locale=LOCALE set output locale (required as this sets the directory names) --removeuntranslated remove untranslated strings from output --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) .. _moz2po#examples: Examples ======== .. _moz2po#creating_pot_files: Creating POT files ------------------ After extracting the en-US l10n files, you can run the following command:: moz2po -P l10n/en-US pot This creates a set of POT (:opt:`-P`) files in the ``pot`` directory from the Mozilla files in ``l10n/en-US`` for use as PO Templates. If you want to create a set of POT files with another base language try the following:: moz2po -P l10n/fr-FR fr-pot This will create a set of POT files in ``fr-pot`` that have French as your source language. .. _moz2po#creating_po_files_from_existing_non-po_translations: Creating PO files from existing non-PO translations --------------------------------------------------- If you have existing translations (Mozilla related or other Babelzilla files) and you wish to convert them to PO for future translation then the following generic instructions will work:: moz2po -t en-US af-ZA af-ZA_pofiles This will combine the untranslated template en-US files from ``en-US`` combine them with your existing translations in ``af-ZA`` and output PO files to ``af-ZA_pofiles``. :: moz2po -t l10n/fr l10n/xh po/xh For those who are not English fluent you can do the same with another languages. In this case ``msgid`` will contain the French text from ``l10n/fr``. This is useful for translating where the translators other languages is not English but French, Spanish or Portuguese. Please make sure that the source languages i.e. the ``msgid`` language is fully translated as against en-US. .. _moz2po#creating_mercurial_ready_translations: Creating Mercurial ready translations ----------------------------------------- :: po2moz -t l10n/en-US po/xh l10n/xh Create Mozilla files using the templates files in ``l10n/en-US`` (see above for how to create them) with PO translations in ``po/xh`` and output them to ``l10n/xh``. The files now in ``l10n/xh`` are ready for submission to Mozilla and can be used to build a language pack or translated version of Mozilla. .. _moz2po#issues: Issues ====== You can perform the bulk of your work (99%) with moz2po. Localisation of XHTML is not yet perfect, you might want to work with the files directly. :issue:`Issue 203 <203>` tracks the outstanding features which would allow complete localisation of Mozilla including; all help, start pages, rdf files, etc. It also tracks some bugs. Accesskeys don't yet work in .properties files and in several cases where the Mozilla .dtd files don't follow the normal conventions, for example in ``security/manager/chrome/pippki/pref-ssl.dtd.po``. You might also want to check the files mentioned in this Mozilla bug `329444 `_ where mistakes in the DTD-definitions cause problems in the matching of accelerators with the text. You might want to give special attention to the following files since it contains customisations that are not really translations. * mail/chrome/messenger/downloadheaders.dtd.po * toolkit/chrome/global/intl.properties.po Also, all width, height and size specifications need to be edited with feedback from testing the translated interfaces. There are some constructed strings in the Mozilla code which we can't do much about. Take good care to read the localisation notes. For an example, see ``mail/chrome/messenger/downloadheaders.dtd.po``. In that specific file, the localisation note from the DTD file is lost, so take good care of those. The file extension of the original Mozilla file is required to tell the Toolkit how to do the conversion. Therefore, a file like foo.dtd must be named foo.dtd.po in order to :doc:`po2moz ` to recognise it as a DTD file. translate-3.15.1/docs/commands/odf2xliff.rst000066400000000000000000000071631476453735700210000ustar00rootroot00000000000000 .. _odf2xliff: .. _xliff2odf: odf2xliff and xliff2odf *********************** Convert OpenDocument (ODF) files to XLIFF localization files. Create translated ODF files by combining the original ODF files with XLIFF files containing translations of strings in the original document. XLIFF is the XML Localization Interchange File Format developed by `OASIS `_ (The Organization for the Advancement of Structured Information Standards) to allow translation work to be standardised no matter what the source format and to allow the work to be freely moved from tool to tool. If you are more used to software translation or l10n, you might want to read a bit about :doc:`/guides/document_translation`. This should help you to get the most out of translating ODF with XLIFF. .. _odf2xliff#usage: Usage ===== :: odf2xliff [options] xliff2odf [options] -t Where: +------------------+---------------------------------------------------------+ | | is an ODF document whose strings have to be translated | +------------------+---------------------------------------------------------+ | | is an XLIFF file | +------------------+---------------------------------------------------------+ | | is an ODF file to generate by replacing the strings in | +------------------+---------------------------------------------------------+ | | with the translated strings in | +------------------+---------------------------------------------------------+ Options (odf2xliff): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in ODF format -o OUTPUT, --output=OUTPUT write to OUTPUT in XLIFF format -S, --timestamp skip conversion if the output file has newer timestamp Options (xliff2odf): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in XLIFF formats -o OUTPUT, --output=OUTPUT write to OUTPUT in ODF format -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in ODF format -S, --timestamp skip conversion if the output file has newer timestamp .. _odf2xliff#examples: Examples ======== :: odf2xliff english.odt english_français.xlf Create an XLIFF file from an ODT file (the source ODF file could also be any of the other ODF files, including ODS, ODG, etc.). :: xliff2odf -t english.odt english_français.xlf français.odt Using english.odt as the template document, and english_français.xlf as the file of translations, create a translated file français.odt. .. _odf2xliff#bugs: Bugs ==== This filter is not yet extensively used -- we appreciate your feedback. For more information on conformance to standards, see the :doc:`/formats/xliff` or :doc:`/formats/odf` pages. translate-3.15.1/docs/commands/oo2po.rst000066400000000000000000000170051476453735700201470ustar00rootroot00000000000000 .. _oo2po: .. _po2oo: .. _oo2xliff: .. _xliff2oo: oo2po ***** Convert between OpenOffice.org GSI/SDF files and the PO format. This tool provides a complete roundtrip; it preserves the structure of the GSI file and creates completely valid PO files. oo2xliff will convert the SDF files to XLIFF format. .. _oo2po#usage: Usage ===== :: oo2po [options] po2oo [options] [-t ] -l or for XLIFF files:: oo2xliff [options] -l xliff2oo [options] [-t ] -l Where: +--------------+-----------------------------------------------------------+ | | is a valid OpenOffice.org GSI or SDF files | +--------------+-----------------------------------------------------------+ | | is a directory for the resultant PO/POT/XLIFF files | +--------------+-----------------------------------------------------------+ | | is a directory of translated PO/XLIFF files | +--------------+-----------------------------------------------------------+ | | is the :wp:`ISO 639 ` language code used in the | | | sdf file, e.g. af | +--------------+-----------------------------------------------------------+ Options (oo2po and oo2xliff): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in oo, sdf formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot, xlf formats -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) (only available in oo2po -l LANG, --language=LANG set target language to extract from oo file (e.g. af-ZA) (required for oo2xliff) --source-language=LANG set source language code (default en-US) --nonrecursiveinput don't treat the input oo as a recursive store --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') --multifile=MULTIFILESTYLE how to split po/pot files (:doc:`single, toplevel or onefile `) Options (po2oo and xliff2oo): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot, xlf formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in oo, sdf formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in oo, sdf formats -S, --timestamp skip conversion if the output file has newer timestamp -l LANG, --language=LANG set target language code (e.g. af-ZA) [required] --source-language=LANG set source language code (default en-US) -T, --keeptimestamp don't change the timestamps of the strings --nonrecursiveoutput don't treat the output oo as a recursive store --nonrecursivetemplate don't treat the template oo as a recursive store --skipsource don't output the source language, but fallback to it where needed --filteraction=ACTION action on pofilter failure: :doc:`none (default), warn, exclude-serious, exclude-all ` --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) --multifile=MULTIFILESTYLE how to split po/pot files (:doc:`single, toplevel or onefile `) .. _oo2po#examples: Examples ======== These examples demonstrate most of the useful invocations of oo2po: .. _oo2po#creating_pot_files: Creating POT files ------------------ :: oo2po -P en-US.sdf pot Extract messages from *en-US.sdf* and place them in a directory called *pot*. The :opt:`-P` option ensures that we create POT files instead of PO files. :: oo2po -P --source-language=fr fr-FR.sdf french-pot Instead of creating English POT files we are now creating POT files that contain French in the msgid. This is useful for translators who are not English literate. You will need to have a fully translated sdf in the source language. .. _oo2po#creating_po_files_from_existing_work: Creating PO files from existing work ------------------------------------ :: oo2po --duplicates=merge -l zu zu-ZA.sdf zulu Extract all existing Zulu (*zu*) messages from *zu-ZA.sdf* and place them in a directory called *zulu*. If you find duplicate messages in a file then merge them into a single message (This is the default behaviour for traditional PO files). You might want to use :doc:`pomigrate2` to ensure that your PO files match the latest POT files.:: cat GSI_af.sdf GSI_xh.sdf > GSI_af-xh.sdf oo2po --source-language=af -l xh GSI_af-xh.sdf af-xh-po Here we are creating PO files with your existing translations but a different source language. Firstly we combine the two SDF files. Then oo2po creates a set of PO files in *af-xh-po* using Afrikaans (*af*) as the source language and Xhosa (*xh*) as the target language from the combined SDF file *GSI_af-xh.sdf* .. _oo2po#creating_a_new_gsi/sdf_file: Creating a new GSI/SDF file --------------------------- :: po2oo -l zu zulu zu_ZA.sdf Using PO files found in *zulu* create an SDF files called *zu_ZA.sdf* for language *zu*:: po2oo -l af -t en-US.sdf --nofuzzy --keeptimestamp --filteraction=exclude-serious afrikaans af_ZA.sdf Create an Afrikaans (*af*) SDF file called *af_ZA.sdf* using *en-US.sdf* as a template and preserving the timestamps within the SDF file while also eliminating any serious errors in translation. Using templates ensures that the resultant SDF file has exactly the same format as the template SDF file. In an SDF file each translated string can have a timestamp attached. This creates a large amount of unuseful traffic when comparing version of the SDF file, by preserving the timestamp we ensure that this does not change and can therefore see the translation changes clearly. We have included the *nofuzzy* option (on by default) that prevent fuzzy PO messages from getting into the SDF file. Lastly the *filteraction* option is set to exclude serious errors: variables failures and translated XML will be excluded from the final SDF. .. _oo2po#helpcontent2: helpcontent2 ============ The escaping of ``helpcontent2`` from SDF files was very confusing, :issue:`295` implemented a fix that appeared in version 1.1.0 (All known issues were fixed in 1.1.1). Translators are now able to translate helpcontent2 with clean escaping. translate-3.15.1/docs/commands/option_accelerator.rst000066400000000000000000000022051476453735700227610ustar00rootroot00000000000000 .. _option_accelerator: --accelerator=ACCELERATOR ************************* +--------------+-----------------------------------------------------------+ | Accelerator | Used by | | Marker | | +==============+===========================================================+ | & | `KDE Desktop `_ and `Mozilla | | | `_ (when using :doc:`moz2po | | | `) | +--------------+-----------------------------------------------------------+ | _ | `GNOME Desktop `_ and other `GTK+ | | | `_ based applications | +--------------+-----------------------------------------------------------+ | ~ | `LibreOffice `_ and `Apache | | | OpenOffice `_ | +--------------+-----------------------------------------------------------+ translate-3.15.1/docs/commands/option_duplicates.rst000066400000000000000000000045531476453735700226420ustar00rootroot00000000000000 .. _option_duplicates: --duplicates=DUPLICATESTYLE *************************** Gettext PO files only allow one message with a common msgid (source string). Many other formats allow duplicate entries. To create a valid PO file you need to merge these duplicate entries into one PO message. However, this often negatively affects the roundtrip or is not what is expected by the user. Thus we have a number of methods of handling duplicates which we call *duplicate styles*. Also affected are conversions in which the source format is empty (allowing possible translation). As the header in a PO file is identified by an empty source string, your message will appear to be a duplicate of the header. In this case duplicate removal is critical. Previously the tools used msgid_comment (KDE style comments) to disambiguate text. However, with the release of Gettext 0.15, the new msgctxt disambiguation is now recommended, especially if you wish to use your files with other Gettext the tools. Many other pieces of software now also support this feature, and will probably become the best choice for almost all circumstances. It is the default in our converters. .. _option_duplicates#merge: merge ===== This is the traditional Gettext approach. All messages with the same source string or English string are merged into one PO message. .. code-block:: po #: file1.dtd:instruction_manual #: file1.dtd:manual_process msgid "Manual" msgstr "" If however the source text is blank (these are often configuration options in Mozilla) then the *merge* style will use KDE comments as used in the *msgid_comment* style in order to create unambiguous entries that can still be used for configuration. .. code-block:: po #: file1.dtd:translators_name msgid "_: file1.dtd:translators_name\n" msgstr "" #: file1.dtd:translators_email msgid "_: file1.dtd:translators_email\n" msgstr "" .. _option_duplicates#msgctxt: msgctxt (default) ================= This uses the msgctxt feature of Gettext that was introduced with Gettext 0.15. Some tools might not support it 100%. This option is the default in recent releases of the Translate Toolkit. .. code-block:: po #: file1.dtd:instruction_manual msgctxt "instruction_manual" msgid "Manual" msgstr "" #: file1.dtd:manual_process msgctxt "manual_process" msgid "Manual" msgstr "" translate-3.15.1/docs/commands/option_errorlevel.rst000066400000000000000000000032501476453735700226570ustar00rootroot00000000000000 .. _option_errorlevel: --errorlevel=ERRORLEVEL *********************** This is a parameter that can be passed to most of the programs in the translate toolkit in order to choose the level of feedback that you need when errors occur. It is mostly useful for debugging. Please report your errors to the developers with :opt:`--errorlevel=traceback`. .. _option_errorlevel#none: none ==== Display no error messages .. _option_errorlevel#message: message ======= Display on the error message :: An error occurred processing PO file .. _option_errorlevel#exception: exception ========= Give the error message and name and Python exception :: ValueError: An error occurred processing PO file .. _option_errorlevel#traceback: traceback ========= Provide a full traceback for debugging purposes :: csv2po: warning: Error processing: nso/readlicense_oo/docs/readme.csv: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/translate/misc/optrecurse.py", line 415, in recursiveprocess success = self.processfile(fileprocessor, options, fullinputpath, fulloutputpath, fulltemplatepath) File "/usr/lib/python2.4/site-packages/translate/misc/optrecurse.py", line 468, in processfile if fileprocessor(inputfile, outputfile, templatefile, **passthroughoptions): File "/usr/lib/python2.4/site-packages/translate/convert/csv2po.py", line 183, in convertcsv outputpo = convertor.convertfile(inputcsv) File "/usr/lib/python2.4/site-packages/translate/convert/csv2po.py", line 159, in convertfile raise ValueError("An error occurred processing PO file") ValueError: An error occurred processing PO file translate-3.15.1/docs/commands/option_filteraction.rst000066400000000000000000000011271476453735700231620ustar00rootroot00000000000000 .. _option_filteraction: --filteraction=ACTION ********************* .. _option_filteraction#none_default: none (default) ============== Take no action. Messages from failing test will appear in the output file .. _option_filteraction#warn: warn ==== Print a warning but otherwise include the message in the output file. .. _option_filteraction#exclude-serious: exclude-serious =============== Only exclude errors that are listed as serious by the convertor. All other are included. .. _option_filteraction#exclude-all: exclude-all =========== Exclude any message that fails a test. translate-3.15.1/docs/commands/option_multifile.rst000066400000000000000000000011451476453735700224710ustar00rootroot00000000000000 .. _option_multifile: --multifile=MULTIFILESTYLE ************************** This options determines how the POT/PO files are split from the source files. In many cases you have source files that generate either too many small files or one large files which you would rather see split up into smaller files. .. _option_multifile#single: single ====== Output individual files. .. _option_multifile#toplevel: toplevel ======== Split the source files at the top level. I.e., you see a number of top level files. .. _option_multifile#onefile: onefile ======= One large file instead of many smaller files. translate-3.15.1/docs/commands/option_personality.rst000066400000000000000000000030321476453735700230450ustar00rootroot00000000000000 .. _option_personality: --personality=TYPE ****************** .. _option_personality#java_default: java (default) ============== Create output strictly according to the specification for .properties files. This will use escaped Unicode for any non-ASCII characters. Thus the following string found in a PO file:: ṽḁḽṻḝ Will appear as follows in the output .properties file:: \u1E7D\u1E01\u1E3D\u1E7B\u1E1D .. _option_personality#mozilla: mozilla ======= Mozilla has made slight adjustments to the Java .properties spec. Mozilla will accept UTF-8 encoded strings in the property file and thus does not need escaped Unicode. Thus the above string -- ṽḁḽṻḝ -- will not be escaped. Mozilla property files are thus more useful for non-Latin languages in that they are actually readable. Of course this style of file is only used by Mozilla and should not be used for other projects that follow the Java spec more strictly. .. _option_personality#skype: skype ===== Skype .lang files are .properties files in UTF-16. The & is used as an accelerator (marked in the PO header). .. _option_personality#flex: flex ==== Flex follows the Mozilla approach, a UTF-8 encoded file with no escaped unicode. We include it as its own dialect for ease of use. .. _option_personality#strings: strings ======= Much Mac OS X and iPhone software is translated using .strings files. These are quite different from properties files and we treat them here as key value files. The files are in UTF-16 with a few minor escaping conventions. translate-3.15.1/docs/commands/option_progress.rst000066400000000000000000000052371476453735700223510ustar00rootroot00000000000000 .. _option_progress: --progress=PROGRESS ******************* All of the programs can give visual feedback. This options allows you to select the style of that feedback. In the examples we are converting and OpenOffice.org 2.0 sdf/gsi file into POT files using :doc:`oo2po `. .. _option_progress#none: none ==== No visual feedback, this is useful if you want to use any of the scripts as part of another script and don't want feedback to interfere with the operation. .. code-block:: console $ oo2po -P --progress=none en-US.sdf pot $ .. _option_progress#dots: dots ==== Use visual dots to represent progress. Each dot represent a file that has been processed. .. code-block:: console $ oo2po -P --progress=dots en-US.sdf pot ............................................................................................. ............................................................................................. ......................................... $ .. _option_progress#bar_default: bar (default) ============= Use a progress bar consisting of hashes (#) to show progress. .. code-block:: console $ oo2po -P --progress=bar en-US.sdf pot processing 227 files... [############################## ] 69% This is the default mode of operation, therefore this command would create the same output. .. code-block:: console $ oo2po -P en-US.sdf pot .. _option_progress#verbose: verbose ======= Combine the hash (#) progress bar form the *bar* option with the actual names of files that have been processed. .. code-block:: console $ oo2po -P --progress=verbose en-US.sdf pot processing 227 files... so3/src.oo dbaccess/source/ui/uno.oo helpcontent2/source/text/shared.oo wizards/source/formwizard.oo sch/source/ui/dlg.oo helpcontent2/source/text/sbasic/shared/01.oo dbaccess/source/core/resource.oo svtools/source/sbx.oo dbaccess/source/ui/relationdesign.oo scp2/source/writer.oo filter/source/xsltdialog.oo [## ] 5% .. _option_progress#names: names ===== Prints out only the filenames without any other progress indicator. This is a good option when outputting to a log file rather than a terminal. .. code-block:: console $ oo2po -P --progress=names en-US.sdf pot so3/src.oo dbaccess/source/ui/uno.oo helpcontent2/source/text/shared.oo wizards/source/formwizard.oo sch/source/ui/dlg.oo helpcontent2/source/text/sbasic/shared/01.oo dbaccess/source/core/resource.oo svtools/source/sbx.oo dbaccess/source/ui/relationdesign.oo scp2/source/writer.oo filter/source/xsltdialog.oo translate-3.15.1/docs/commands/option_rewrite.rst000066400000000000000000000077511476453735700221710ustar00rootroot00000000000000 .. _option_rewrite: --rewrite=STYLE *************** :doc:`podebug` allows you to rewrite the output text in a number of ways. .. _option_rewrite#xxx: xxx === The target text is surrounded by ``xxx`` as follows .. code-block:: po msgid "English" msgstr "xxxEnglishxxx" This is useful when you want to identify which text is localisable. There might be text in your application which you cannot localise this will allow you to quickly identify that text. .. _option_rewrite#en: en == The source text is copied to the target .. code-block:: po msgid "English" msgstr "English" In this way you can create translations that contain only the source text. Useful if you are preparing a roundtrip test or want to start an English derived translation such as British English. It produces the same results as :man:`msgen` but with the advantage that you can add debug markers. .. _option_rewrite#blank: blank ===== This simply empties your current translations .. code-block:: po msgid "English" msgstr "" When you have a set of translation files but no template this allows you to essentially convert a PO into a POT file. This mimics the :opt:`--empty` functionality of :man:`msghack`. .. _option_rewrite#bracket: bracket ======= .. versionadded:: 1.4 Places brackets around the translated text. .. code-block:: po msgid "English" msgstr "[English]" This can be used in the same way as ``xxx`` to check for translatability. It is also useful with very long strings as it allows you to check that the full string in rendered and has not been cutoff by the application. .. _option_rewrite#chef: chef ==== .. versionadded:: 1.2 Rewrites the source text using mock Swedish as popularised by the :wp:`Swedish Chef `. .. code-block:: po msgid "English" msgstr "Ingleesh" This is probably only useful for some fun. It's not guaranteed that every string will be rewritten as the mock Swedish rules might not apply thus its not ideal for identifying untranslatable strings. .. _option_rewrite#flipped: flipped ======= .. versionadded:: 1.4 Change the text into a version that uses equivalent Latin characters that are upside down. .. code-block:: po msgid "English" msgstr "‮Ǝuƃʅısɥ" ``flipped`` can give an output that simulates RTL languages. It inserts RTL characters to try to achieve RTL-like results. Its not perfect but will give you some sense of whether your application can do RTL. Or just use it for fun! For really testing right-to-left GUIs, you want to make sure that the whole application is shown in RTL, not just the strings. Test your pseudo-translated file as a translation of an RTL language like Arabic or Hebrew. In case the application relies on other files coming from libraries (like GTK+), you might need to repeat the process for them, or at least ensure that you have the Arabic/Hebrew .mo files for them installed. .. _option_rewrite#unicode: unicode ======= .. versionadded:: 1.2 Rewrites the source text with Unicode characters that looks like the Latin characters that they are replacing. .. code-block:: po msgid "English" msgstr "Ḗƞɠŀīşħ" This allows a translator or programmer to test a programs ability to use Unicode message strings. By using characters in the Unicode range but that are related to the plain Latin characters that they replace we ensure that the messages are still readable. .. note:: Before version 1.4, the rewrite rule will also rewrite variables and XML tags, which would cause problems in some situations. Run :doc:`pofilter` as a quick method to fix up incorrect changes, or upgrade to version 1.4. .. _option_rewrite#classified: classified ========== .. versionadded:: 3.7.3 Rewrites the source text with black square (▮) that looks like NSA classified files. .. code-block:: po msgid "English" msgstr "▮▮▮▮▮▮▮" This allows a translator or programmer to visually distinguish what is not part of the translation yet. This way it's really easy to spot what strings are missing. translate-3.15.1/docs/commands/phase.rst000066400000000000000000000104311476453735700202050ustar00rootroot00000000000000 .. _phase: phase ***** phase is a script that allows you to perform a number of tasks on a set of PO files that have been broken into phases. You can create a ZIP file for a phase, run checks against a phase, review a phase, edit files in a phase, etc. All the tasks that would be involved in sending work to various translators, receiving work, checking it and committing to CVS. .. _phase#prerequisites: Prerequisites ============= * An environment that will run :man:`bash` * :man:`diff` * :man:`cvs` .. _phase#latest_version: Latest Version ============== phase is not currently distributed as part of the toolkit. You can get the `latest version from Git `_ .. _phase#usage: Usage ===== :: phase [options] Mostly the usage follows the format of:: phase phase A full list of commands and options can be seen by running:: phase --help .. _phase#commands: Commands ======== These are the commands that you can use: * makephaselist -- creates a phase list * listphases -- lists the different phases that appear in the phase-list file * listfiles -- list all files for the given phase in the phase-list file * checkphaselist -- checks to see which files are not included in the phaselist * countpo -- counts PO file in the given phase * countpot -- counts POT file in the given phase * missingpo -- lists files that have not been returned for a phase * packpot -- packs all POT files for a given phase into a ZIP file * packpo -- packs all PO files for a given phase into a ZIP file * packall -- packs all phases found in the phase list * packallpo -- packs all phases found in the phase list for the given language * countmismatch -- compares the source word count between PO and POT to determine if there are any file errors. * editpo -- edit the PO files in a phase * editpochecks -- edit the PO checks output by checkpo * editconflicts -- edit the extracted conflict items * checkpo [pofilter options] -- run pofilter checks against the given phase * mergepo -- merge the checks back into the main language directory * conflictpo [poconflict options] -- run poconflict checks against the given phase * diffpo -- perform a cvs diff for the phase * cvslog -- perform a cvs log against files in the phase * lastlog -- retrieves the last cvs log entry for each file in a phase * cvsadd -- CVS adds files and directories that are not already in CVS * diffpo -- perform a cvs diff for the phase * reviewpo [pofilter options] -- extract items marked for review for the given phase * editreviews -- edit the extracted review items * countreviews -- count the number of strings and words under review * checkinpo -- cvs checkin the files in the given phase * creategsi -- creates a BZ2 GSI/SDF file for the language against the en-US GSI file * reviewsinout -- counts the number of review files returned vs sent and shows which are missing * reviewsdiff -- create a diff between what was sent for review and what was returned .. _phase#bugs: Bugs ==== There are probably lots mostly the bug is that the command line options are pretty inconsistent translate-3.15.1/docs/commands/php2po.rst000066400000000000000000000101141476453735700203130ustar00rootroot00000000000000 .. _php2po: .. _po2php: php2po ****** Converts PHP localisable string arrays to Gettext PO format. .. _php2po#usage: Usage ===== :: php2po [options] po2php [options] Where: +--------+--------------------------------------------------------------+ | | is a valid PHP localisable file or directory of those files | +--------+--------------------------------------------------------------+ | | is a directory of PO or POT files | +--------+--------------------------------------------------------------+ Options (php2po): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in php format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in php format -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') Options (po2php): --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in php format -t TEMPLATE, --template=TEMPLATE read from TEMPLATE in php format -S, --timestamp skip conversion if the output file has newer timestamp --threshold=PERCENT only convert files where the translation completion is above PERCENT --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) .. _php2po#formats_supported: Formats Supported ================= Check :doc:`PHP format ` document to see to which extent the PHP format is supported. .. _php2po#examples: Examples ======== This example looks at roundtrip of PHP translations as well as recovery of existing translations. First we need to create a set of POT files.:: php2po -P lang/en pot/ All .php files found in the ``lang/en`` directory are converted to Gettext POT files and placed in the ``pot`` directory. If you are translating for the first time then you can skip the next step. If you need to recover your existing translations then we do the following:: php2po -t lang/en lang/zu po-zu/ Using the English PHP files found in ``lang/en`` and your existing Zulu translation in ``lang/zu`` we create a set of PO files in ``po-zu``. These will now have your translations. Please be aware that in order for that to work 100% you need to have both English and Zulu at the same revision, if they are not you will have to review all translations. You are now in a position to translate your recovered translations or your new POT files. Once translated you can convert back as follows:: po2php -t lang/en po-zu/ lang/zu Your translations found in the Zulu PO directory, ``po-zu``, will be converted to PHP using the files in ``lang/en`` as templates and placing your new translations in ``lang/zu``. To update your translations simply redo the POT creation step and make use of :doc:`pot2po` to bring your translation up-to-date. translate-3.15.1/docs/commands/po2tmx.rst000066400000000000000000000065151476453735700203460ustar00rootroot00000000000000 .. _po2tmx: po2tmx ****** Convert :doc:`Gettext PO ` files to a :doc:`/formats/tmx` translation memory file. TMX is the Translation Memory eXchange format developed by OSCAR [#f1]_. .. [#f1] OSCAR (Open Standards for Container/Content Allowing Re-use), a special interest group of the now defunct LISA (Localization Industry Standards Association). The Gala `LISA OSCAR Standards `_ page has more details on the possible future for the standards. If you are interested in po2tmx, you might also be interested in :doc:`posegment` that can be used to perform some automated segmentation on sentence level. .. _po2tmx#usage: Usage ===== :: po2tmx [options] --language Where: +-------+----------------+ | | is a PO file | +-------+----------------+ | | is a TMX file | +-------+----------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in tmx format -S, --timestamp skip conversion if the output file has newer timestamp -l LANG, --language=LANG set target language code (e.g. af-ZA) [required] --source-language=LANG set source language code (default: en) --comments=COMMENT set default comment import: none, source, type or others (default: none) .. _po2tmx#examples: Examples ======== :: po2tmx -l xh browser.po browser.tmx Use the Xhosa (*xh*) translations in the PO file *browser.po* to create a TMX file called *browser.tmx* .. _po2tmx#bugs_and_issues: Bugs and issues =============== .. _po2tmx#markup_stripping: Markup stripping ---------------- po2tmx conforms to TMX v1.4 without stripping markup. See the :doc:`/formats/tmx` conformance page for more details. It has not been widely tested so your mileage may vary. .. _po2tmx#tmx_and_po_in_omegat: TMX and PO in OmegaT -------------------- In some tools, like OmegaT, PO files are parsed without expanding escaped sequences, even though such tools use TMX for translation memory. Keep this in mind when using po2tmx, because po2tmx converts ``\n`` and ``\t`` to newlines and tabs in the TMX file. If such a TMX file is used while translating PO files in OmegaT, matching will be less than 100%. In other tools, such as Swordfish, the PO comment "no-wrap" is interpreted in the same way as the equivalent function in XML, which may also lead to mismatches if TMXes from po2tmx are used. There is nothing wrong with po2tmx, but if used in conjunction with tools that handle PO files differently, it may lead to less than perfect matching. .. _po2tmx#tips: Tips ==== .. _po2tmx#tmx_with_only_unique_segments: TMX with only unique segments ----------------------------- To create a TMX with no duplicates (in other words, only unique strings), use msgcat to first create a large PO file with non-uniques removed. translate-3.15.1/docs/commands/po2wordfast.rst000066400000000000000000000031731476453735700213640ustar00rootroot00000000000000 .. _po2wordfast: po2wordfast *********** Convert Gettext PO files to a :doc:`/formats/wordfast` translation memory file. :wp:`Wordfast` is a popular Windows based computer-assisted translation tool. .. _po2wordfast#usage: Usage ===== :: po2wordfast [options] --language Where: +-------------+-------------------------------------+ | | a PO file or directory | +-------------+-------------------------------------+ | | a Wordfast translation memory file | +-------------+-------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in tmx format -S, --timestamp skip conversion if the output file has newer timestamp -l LANG, --language=LANG set target language code (e.g. af-ZA) [required] --source-language=LANG set source language code (default: en) .. _po2wordfast#examples: Examples ======== :: po2wordfast -l xh-ZA browser.po browser.txt Use the Xhosa (*xh-ZA*) translations in the PO file *browser.po* to create a Wordfast translation memory file called *browser.txt* translate-3.15.1/docs/commands/poclean.rst000066400000000000000000000034141476453735700205310ustar00rootroot00000000000000 .. _poclean: poclean ******* This is a rudimentary tool to produce a clean file from an unclean file (Trados/Wordfast) by stripping out the tw4win indicators. .. _poclean#usage: Usage ===== :: poclean Where: +----------+-----------------------------------------------+ | | is the text versions of the unclean RTF files | +----------+-----------------------------------------------+ | | is the intended output file / directory | +----------+-----------------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in pot format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -S, --timestamp skip conversion if the output file has newer timestamp .. _poclean#examples: Examples ======== To create a text version of the unclean RTF file, you need UnRTF, available here: `project site `_ or `here (windows) `_. :: unrtf translation.rtf --text > translation.po You might need to convert the encoding of the file, with iconv, for example:: iconv -f latin1 -t utf-8 translation.po > new_translation.po Now you can clean the file with poclean :: poclean new_translation.po clean_translation.po translate-3.15.1/docs/commands/pocommentclean.rst000066400000000000000000000017101476453735700221110ustar00rootroot00000000000000 .. _pocommentclean: pocommentclean ************** pocommentclean will remove all translator comments from a directory of PO files. .. _pocommentclean#prerequisites: Prerequisites ============= * :man:`sed` .. _pocommentclean#usage: Usage ===== :: pocommentclean [--backup] Where: +-----+-------------------------------------------------------------+ | po | is a directory of existing PO files that you want to clean | +-----+-------------------------------------------------------------+ Options: --backup Create a backup file for each PO file converted, .po.bak .. _pocommentclean#operation: Operation ========= Using sed pocommentclean will delete all lines starting with # but which are not standard Gettext PO format lines. So it won't delete developer comments (#.), obsolete messages (#~), flags (#,) or locations (#:). .. _pocommentclean#bugs: Bugs ==== pocommentclean cannot clean individual PO files, it only cleans directories translate-3.15.1/docs/commands/pocompendium.rst000066400000000000000000000066351476453735700216170ustar00rootroot00000000000000 .. _pocompendium: pocompendium ************ Takes a directory of translated PO files and creates a single PO files called a PO compendium. This compendium can be used to review word choice conflicts or as input during a merge using :doc:`pomigrate2`. .. _pocompendium#prerequisites: Prerequisites ============= GNU Gettext: * :man:`msgattrib` * :man:`msgcat` * :man:`msghack` (may not be present on your installation of Gettext, but is only required for the invert command) * :man:`msgfilter` .. _pocompendium#usage: Usage ===== :: pocompendium [options] output.po <-d po-directory(ies)|po-file(s)> Where: +--------------------+-------------------------------------------------------------+ | output.po | the name of the output PO compendium | +--------------------+-------------------------------------------------------------+ | po-directory(ies) | one or more directories to use as input for the compendium | +--------------------+-------------------------------------------------------------+ | po-file(s) | one or more PO files to use as input for the compendium | +--------------------+-------------------------------------------------------------+ Options: -v, --invert swap the msgid and msgstr in the input PO files -e, --errors only return those msg blocks that have conflicts -i, --ignore-case drops all msgstr's to lowercase -st, -tilde, --strip-accel-amp remove all & style accelerator markers -sa, -amp, --strip-accel-tilde remove all ~ style accelerator markers -su, --strip-accel-under remove all _ style accelerator markers .. _pocompendium#examples: Examples ======== - *Compendium creation* --- create a compendium with all your translations to use as input during a message merge either when migrating an existing project or starting a new one. - *Conflicting translations* --- use :opt:`--errors` to find where you have translated an English string differently. Many times this is OK but often it will pick up subtle spelling mistakes or help you to migrate older translations to a newer choice of words - *Conflicting word choice* --- use :opt:`--invert` and :opt:`--errors` to get a compendium file that show how you have used a translated word for different English words. You might have chosen a word that is valid for both of the English expressions but that in the context of computers would cause confusion for the user. You can now easily identify these words and make changes in the underlying translations. .. _pocompendium#narrowing_results: Narrowing Results ================= PO files treat slight changes in capitalisation, accelerator, punctuation and whitespace as different translations. In cases 2) and 3) above it is sometimes useful to remove the inconsistencies so that you can focus on the errors in translation not on shifts in capitals. To this end you can use the following: :opt:`--ignore-case`, :opt:`--strip-accel-amp`, :opt:`--strip-accel-tilde`, :opt:`--strip-accel-under` .. _pocompendium#operation: Operation ========= pocompendium makes use of the Gettext tool msgcat to perform its task. It traverses the PO directories and cat's all found PO files into the single compendium output file. It then uses msgattrib to extract only certain messages, msghack to invert messages and msgfilter to convert messages to lowercase. .. _pocompendium#bugs: Bugs ==== There are some absolute/relative path name issues translate-3.15.1/docs/commands/pocompile.rst000066400000000000000000000034671476453735700211070ustar00rootroot00000000000000 .. _pocompile: pocompile ********* Compile PO or XLIFF files into MO (Machine Object) files. MO files are installed on your computer and allow a Gettext enabled computer to provide the translations for the application. .. _pocompile#usage: Usage ===== :: pocompile Where: +-------------+------------------------------------------------+ | | is a standard PO file, XLIFF file or directory | +-------------+------------------------------------------------+ | | is the output MO file or directory of MO files | +-------------+------------------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in xlf, po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in mo format -S, --timestamp skip conversion if the output file has newer timestamp --fuzzy use translations marked fuzzy --nofuzzy don't use translations marked fuzzy (default) .. _pocompile#examples: Examples ======== :: pocompile --fuzzy file.po file.mo Creates a new MO file called *file.mo* based on the translation in the PO file *file.po*. By using the :opt:`--fuzzy` option we use all translations including those marked fuzzy. :: pocompile file.xlf file.mo Create an MO file from an XLIFF file called *file.xlf* (available from version 1.1 of the toolkit). translate-3.15.1/docs/commands/poconflicts.rst000066400000000000000000000073161476453735700214400ustar00rootroot00000000000000 .. _poconflicts: poconflicts *********** poconflicts takes a PO file and creates an set of output PO files that contain messages that conflict. During any translation project that involves a large amount of work or a number of translators you will see message conflicts. A conflict is where the same English message has been translated differently (in some languages this may have been intentional). Conflicts occur due to different translation style or a shift in translations as the translators or project mature. poconflicts allows you to quickly identify these problem messages, investigate and correct them. To merge the files back, they have to be restructured into the correct directory structure using :doc:`porestructure` in order to enable merging using :doc:`pomerge`. .. _poconflicts#usage: Usage ===== :: poconflicts [options] Where: +-------------+--------------------------------------------------------------+ | | is a directory of existing PO files or an individual PO file | +-------------+--------------------------------------------------------------+ | | is a directory containing one PO file for each conflict | +-------------+--------------------------------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po format -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po format -I, --ignore-case ignore case distinctions -v, --invert invert the conflicts thus extracting conflicting destination words --accelerator=ACCELERATORS ignores the given :doc:`accelerator characters ` when matching .. _poconflicts#examples: Examples ======== Here are some examples that demonstrate the usefulness of poconflict :: poconflicts --accelerator=~ -I xhosa conflicts This extracts messages from the PO files in the *xhosa* directory and places a new PO file for each identified conflict in *conflicts*. We are working with OpenOffice files and we therefore use the tilde (*~*) as the accelerator marker (with this set *F~ile* is considered the same as *~File*). We are also ignoring the case of the message using :opt:`-I` (thus *File* is considered the same as *file* or *FILE*) Another useful option is to look at the inverted conflicts. This will detect target words that have been used to translate different source words. :: poconflicts --accelerator=~ -I -v xhosa conflicts Now in the *conflicts* directory we will find PO files based on the Xhosa word. We can now check where a Xhosa word has been used for different source or English words. Often there is no problem but you might find cases where the same Xhosa word was used for Delete and Cancel -- clearly a usability issue. The translator makes the needed corrections to the files and then we can proceed to merge the results back into the PO files. Unchanged entries can be removed. Now restructure the files to resemble the original directory structure using :doc:`porestructure`:: porestructure -i conflicts -o conflicts_tree Now merge the changes back using pomerge:: pomerge -t xhosa -i conflicts_tree -o xhosa This takes the corrected files from *conflicts_tree* and merge them into the files in *xhosa* using the same files as templates. translate-3.15.1/docs/commands/pocount.rst000066400000000000000000000130321476453735700205740ustar00rootroot00000000000000 .. _pocount: pocount ******* pocount will count the number of strings and words in translatable files. Supported formates include: PO and XLIFF. Almost all bilingual file formats supported by the Translate Toolkit will work with pocount, including: :doc:`TMX `, :doc:`TBX `, :doc:`Gettext .mo `, :doc:`Qt .qm `, :doc:`Wordfast .txt TM `. A number of other :doc:`formats ` should be countable as the toolkit develops. Note that only multilingual formats based the storage :doc:`base class ` are supported, but that includes almost all storage formats. .. _pocount#usage: Usage ===== :: pocount [options] Where: +------------+--------------------------------------------------------------+ | directory | will recurse and count all files in the specified directory | +------------+--------------------------------------------------------------+ | file(s) | will count all files specified | +------------+--------------------------------------------------------------+ Options: -h, --help show this help message and exit --incomplete skip 100% translated files Output format: --full (default) statistics in full, verbose format --csv statistics in CSV format --short same as --short-strings --short-strings statistics of strings in short format -- one line per file --short-words statistics of words in short format -- one line per file .. _pocount#examples: Examples ======== pocount makes it easy to count the current state of a body of translations. The most interesting options are those that adjust the output style and decide what to count. .. _pocount#easy_counting: Easy counting ------------- To count how much work is to be done in you project:: pocount project/ This will count all translatable files found in the directory *project*/ and output the results in :opt:`--full` format. You might want to be more specific and only count certain files:: pocount *.po This will count all PO files in the current directory but will ignore any other files that 'pocount' can count. You can have full control of the files to count by using some of the abilities of the Unix commandline, these may work on Mac OS X but are unlikely to work on Windows.:: pocount $(find . -name "*.properties.po") This will first find all files that match ``*.properties.po`` and then count them. That would make it easy to count the state of your Mozilla translations of .properties files. .. _pocount#incomplete_work: Incomplete work --------------- To count what still needs to be done, ignoring what is 100% complete you can use the :opt:`--incomplete` option.:: pocount --incomplete --short *.xlf We are now counting all XLIFF files by using the ``*.xlf`` expansion. We are only counting files that are not 100% complete and we're outputting string counts using the :opt:`--short` option. .. _pocount#output_formats: Output formats ============== The output options provide the following types of output .. _pocount#--full: --full ------ This is the normal, or default, mode. It produces the most comprehensive and easy to read data, although the amount of data may overwhelm the user. It produces the following output:: avmedia/source/viewer.po type strings words (source) words (translation) translated: 73465 ( 99%) 538598 ( 99%) 513296 fuzzy: 13 ( 0%) 141 ( 0%) n/a untranslated: 53 ( 0%) 602 ( 0%) n/a Total: 73531 539341 513296 A grand total and file count is provided if the number of files is greater than one. .. _pocount#--csv: --csv ----- This format is useful if you want to reuse the data in a spreadsheet. In CSV mode the following output is shown:: Filename, Translated Messages, Translated Source Words, Translated Target Words, Fuzzy Messages, Fuzzy Source Words, Untranslated Messages, Untranslated Source Words, Review Messages, Review Source Words avmedia/source/viewer.po, 1, 3, 3, 0, 0, 4, 22, 1, 3 Totals are not provided in CSV mode. .. _pocount#--short-strings_alias_--short: --short-strings (alias --short) ------------------------------- The focus is on easily accessible data in a compact form. This will only count strings and uses a short syntax to make it easy for an experienced localiser to read.:: test-po/fuzzy.po strings: total: 1 | 0t 1f 0u | 0%t 100%f 0%u The filename is followed by a word indicating the type of count, here we are counting strings. The total give the total string count. While the letters t, f and u represent 'translated', 'fuzzy' and 'untranslated' and here indicate the string counts for each of those categories. The counts are followed by a percentage representation of the same categories. .. _pocount#--short-words: --short-words ------------- The output is very similar to :opt:`--short-strings` above:: test-po/fuzzy.po source words: total: 3 | 0t 3f 0u | 0%t 100%f 0%u But instead of counting string we are now counting words as indicated by the term 'source words' .. _pocount#bugs: Bugs ==== * There are some miscounts related to word breaks. * When using the short output formats the columns may not be exactly aligned. This is because the number of digits in different columns is unknown before all input files are processed. The chosen tradeoff here was instanteous output (after each processed file) instead of waiting for the last file to be processed. translate-3.15.1/docs/commands/podebug.rst000066400000000000000000000160101476453735700205310ustar00rootroot00000000000000 .. _podebug: podebug ******* Insert :wp:`pseudo translations ` or debug markers into target text in XLIFF, Gettex PO and other localization files. The pseudo translation or debug markers make it easy to reference and locate strings when your translated application is running. Use it to: * *Target your translations*: see what files are being referenced for string appearing in your programs. * *Debug translations*: if you know in what file the message occurs then you can quickly find it and fix it. * *Check that everything is translatable*: any English only text needs to be analysed so that it can be localised. * *Check for Unicode compliance*: by inserting Unicode text outside of the Latin range it allows you to check that your program can handle non-Latin correctly. .. _podebug#usage: Usage ===== :: podebug [options] Where: +-------+----------------------------------------------------------------+ | | is an input directory or localisation file | +-------+----------------------------------------------------------------+ | | is an output directory or localisation file, if missing output | | | will be to standard out. | +-------+----------------------------------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in po, pot formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -S, --timestamp skip conversion if the output file has newer timestamp -f FORMAT, --format=FORMAT specify format string --rewrite=STYLE the translation rewrite style: :doc:`xxx, en, blank, chef (v1.2), unicode (v1.2), classified (dev) ` --ignore=APPLICATION apply tagging ignore rules for the given application: kde, gtk, openoffice, libreoffice, mozilla --preserveplaceholders attempt to exclude characters that are part of placeholders when performing character-level rewrites so that consuming applications can still use the placeholders to generate final output .. _podebug#formats: Formats ======= A format string can have these various options: +---+----------------------------------------------------+ | f | full filename including directory | +---+----------------------------------------------------+ | F | as %f but with .po file extension | +---+----------------------------------------------------+ | b | base of filename | +---+----------------------------------------------------+ | B | base of filename with .po file extension | +---+----------------------------------------------------+ | d | directory name | +---+----------------------------------------------------+ | s | preset OpenOffice.org modifier | +---+----------------------------------------------------+ | c | use only consonants | +---+----------------------------------------------------+ | h | hash value (since version 1.4 -- see notes below) | +---+----------------------------------------------------+ | N | a set number of characters | +---+----------------------------------------------------+ A format string may look like this: * ``%cf`` -- the full filename without vowels * ``[%10cb]`` -- the first ten character after compressing the base of the filename and place it in square brackets with a space before the real message * ``[%5cd - %cB]`` -- the first 5 consonants of the directory, followed by a dash then the consonants of the filename with a .po extension. All surrounded by square brackets with a space before the translations. * ``%4h.`` -- insert a hash value of length 4 Complex format strings may make it too difficult to actually read the translation, so you are probably best served using as short a string as possible. .. _podebug#rewriting_style: Rewriting (style) ================= The rewriting options are designed to change the target text in various ways (c.f. the various :doc:`rewriting styles ` available). This is mostly valuable for debugging English text. The 'xxx' rewriter is useful in that it allows you to identify text that has not localisable as that text will lack the xxx characters. The 'en' rewriter can be used to prepare English hashed (see below) files for quickly finding strings that have spelling or other errors. It can also be used to create a translated English file which can then be used for other purposes such as British English translation. .. _podebug#ignoring_messages: Ignoring messages ================= In some applications their are translations that should not be translated (usually these are configuration options). If you do translate them then the application will fail to compile or run. The :opt:`--ignore` option allows you to specify the application for which you are producing PO debug files. In this case it will then not mark certain of the PO entries with debug messages. In Mozilla we do not mark lone ``.accesskey``, ``.width``, ``.height``, etc since these can really be thought of as configuration options. .. _podebug#hashing: Hashing ======= Sometimes you find an error in a string. But it is difficult to search for the occurrence of the error. In order to make it easy to find a string in your files we can produce a hash on the strings location and other data. This produces unique alphanumeric sequences which are prepended to the target text. Thus now in your application you have your translated text and an alphanumeric value. Its is then easy to search for that value and find your problem string. .. _podebug#preserveplaceholders: Preserving placeholders ======================= Some translations include placeholders for variables, such as ``This is {foo}`` where changing the ``{foo}``-part would mean the translation is invalid and would fail to compile. The ``--preserveplaceholders`` makes sure this kind of variable names are left intact. .. _podebug#more_reading: Usings podebug ============== Here are some more examples in a `series `_ `of `_ `blog posts `_. translate-3.15.1/docs/commands/pofilter.rst000066400000000000000000000115541476453735700207400ustar00rootroot00000000000000 .. _pofilter: pofilter ******** Pofilter allows you to run a :doc:`number of checks ` against your PO, XLIFF or TMX files. These checks are designed to pick up problems with capitalisation, accelerators, variables, etc. Those messages that fail any of the checks are output and marked so that you can correct them. Use ``pofilter -l`` to get a list of available checks. Once you have corrected the errors in your PO files you can merge the corrections into your existing translated PO files using :doc:`pomerge`. .. _pofilter#usage: Usage ===== :: pofilter [options] Where: +-------+-------------------------------------------------------------------+ | | the input file or directory which contains PO or XLIFF files | +-------+-------------------------------------------------------------------+ | | the output file or directory that contains PO or XLIFF files that | | | fail the various tests | +-------+-------------------------------------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in pot, po, xlf, tmx formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot, xlf, tmx formats -l, --listfilters list filters available --review include elements marked for review (default) --noreview exclude elements marked for review --fuzzy include elements marked fuzzy (default) --nofuzzy exclude elements marked fuzzy --nonotes don't add notes about the errors (since version 1.3) --autocorrect output automatic corrections where possible rather than describing issues --language=LANG set target language code (e.g. af-ZA) [required for spell check]. This will help to make pofilter aware of the conventions of your language --openoffice use the standard checks for OpenOffice translations --libreoffice use the standard checks for LibreOffice translations --mozilla use the standard checks for Mozilla translations --drupal use the standard checks for Drupal translations --gnome use the standard checks for Gnome translations --kde use the standard checks for KDE translations --wx use the standard checks for wxWidgets translations -- identical to --kde --excludefilter=FILTER don't use FILTER when filtering -t FILTER, --test=FILTER only use test FILTERs specified with this option when filtering --notranslatefile=FILE read list of untranslatable words from FILE (must not be translated) --musttranslatefile=FILE read list of translatable words from FILE (must be translated) --validcharsfile=FILE read list of all valid characters from FILE (must be in UTF-8) .. _pofilter#example: Example ======= Here are some examples to demonstrate how to use pofilter:: pofilter --openoffice af af-check Use the default settings (accelerator and variables) for OpenOffice.org. Check all PO files in *af* and output any messages that fail the check in *af-check* (create the directory if it does not already exist). :: pofilter -t isfuzzy -t untranslated zu zu-check Only run the *isfuzzy* and *untranslated* checks, this will extract all messages that are either fuzzy or untranslated. :: pofilter --excludefilter=simplecaps --nofuzzy nso nso-check Run all filters except *simplecaps*. You might want to do this if your language does not make use of capitalisation or if the test is creating too many false positives. Also only run the checks against messages that are not marked fuzzy. This is useful if you have already marked problem strings as fuzzy or you know that the fuzzy strings are bad, with this option you don't have to see the obviously wrong messages. :: pofilter --language=fr dir dir-check Tell pofilter that you are checking French translations so that it can take the conventions of the language into account (for things like punctuation, spacing, quoting, etc.) It will also disable some tests that are not meaningful for your language, like capitalisation checks for languages that don't have capital letters. :: pofilter --excludefilter=untranslated Tell pofilter not to complain about your untranslated units. :: pofilter -l List all the available checks. .. _pofilter#bugs: Bugs ==== There are minor bugs in the filters. Most relate to false positives, corner cases or minor changes for better fault description. translate-3.15.1/docs/commands/pofilter_tests.rst000066400000000000000000000623241476453735700221630ustar00rootroot00000000000000 .. _pofilter_tests: .. _descriptions_of_all_pofilter_tests: Descriptions of all pofilter tests ********************************** The following are descriptions of the tests available in :doc:`pofilter`, :ref:`Pootle ` and Virtaal with some details about what type of errors they are useful to test for and the limitations of each test. Keep in mind that the software might point to errors which are not necessarily wrong (false positives). Currently there are 48 tests. You can always get a list of the currently available tests by running:: pofilter -l To see test specific to a specific targeted application or group of applications run:: pofilter --gnome -l .. _adding_new_tests_and_new_language_adaptations: Adding new tests and new language adaptations ============================================= If you have an idea for a new test or want to add target language adaptations for your language then please help us with information about your test idea and the specifics of your language. .. _test_classification: Test Classification =================== Some tests are more important than others so we have classified them to help you determine which to run first. * Critical -- can break a program * :ref:`pofilter_tests#dialogsizes`, :ref:`pofilter_tests#escapes`, :ref:`pofilter_tests#newlines`, :ref:`pofilter_tests#nplurals`, :ref:`pofilter_tests#printf`, :ref:`pofilter_tests#pythonbraceformat`, :ref:`pofilter_tests#tabs`, :ref:`pofilter_tests#variables`, :ref:`pofilter_tests#xmltags` * Functional -- may confuse the user * :ref:`pofilter_tests#accelerators`, :ref:`pofilter_tests#acronyms`, :ref:`pofilter_tests#blank`, :ref:`pofilter_tests#emails`, :ref:`pofilter_tests#filepaths`, :ref:`pofilter_tests#functions`, :ref:`pofilter_tests#gconf`, :ref:`pofilter_tests#kdecomments`, :ref:`pofilter_tests#long`, :ref:`pofilter_tests#musttranslatewords`, :ref:`pofilter_tests#notranslatewords`, :ref:`pofilter_tests#numbers`, :ref:`pofilter_tests#options`, :ref:`pofilter_tests#purepunc`, :ref:`pofilter_tests#sentencecount`, :ref:`pofilter_tests#short`, :ref:`pofilter_tests#spellcheck`, :ref:`pofilter_tests#urls`, :ref:`pofilter_tests#unchanged` * Cosmetic -- make it look better * :ref:`pofilter_tests#brackets`, :ref:`pofilter_tests#doublequoting`, :ref:`pofilter_tests#doublespacing`, :ref:`pofilter_tests#doublewords`, :ref:`pofilter_tests#endpunc`, :ref:`pofilter_tests#endwhitespace`, :ref:`pofilter_tests#puncspacing`, :ref:`pofilter_tests#simplecaps`, :ref:`pofilter_tests#simpleplurals`, :ref:`pofilter_tests#startcaps`, :ref:`pofilter_tests#singlequoting`, :ref:`pofilter_tests#startpunc`, :ref:`pofilter_tests#startwhitespace`, :ref:`pofilter_tests#validchars` * Extraction -- useful mainly for extracting certain types of string * :ref:`pofilter_tests#compendiumconflicts`, :ref:`pofilter_tests#credits`, :ref:`pofilter_tests#hassuggestion`, :ref:`pofilter_tests#isfuzzy`, :ref:`pofilter_tests#isreview`, :ref:`pofilter_tests#untranslated` .. _test_description: Test Description ================ .. _pofilter_tests#accelerators: accelerators ------------ Checks whether :ref:`accelerators ` are consistent between the two strings. Make sure you use the :opt:`--mozilla`, :opt:`--kde`, etc options so that pofilter knows which type of accelerator it is looking for. The test will pick up accelerators that are missing and ones that shouldn't be there. This check alters its default behavior in Mozilla checker for some languages so it instead checks that accelerators are not present in translation. The purpose of this is to ensure that for languages where the accelerators shouldn't be used the accelerators are not present in the translations. This is common for Indic languages. .. _pofilter_tests#acronyms: acronyms -------- Checks that acronyms that appear are unchanged. If an acronym appears in the original this test will check that it appears in the translation. Translating acronyms is a language decision but many languages leave them unchanged. In that case this test is useful for tracking down translations of the acronym and correcting them. .. _pofilter_tests#blank: blank ----- Checks whether a translation is totally blank. This will check to see if a translation has inadvertently been translated as blank i.e. as spaces. This is different from untranslated which is completely empty. This test is useful in that if something is translated as " " it will appear to most tools as if it is translated. .. _pofilter_tests#brackets: brackets -------- Checks that the number of brackets in both strings match. If ``([{`` or ``}])`` appear in the original this will check that the same number appear in the translation. .. _pofilter_tests#compendiumconflicts: compendiumconflicts ------------------- Checks for Gettext compendium conflicts (``#-#-#-#-#``). When you use msgcat to create a PO compendium it will insert ``#-#-#-#-#`` into entries that are not consistent. If the compendium is used later in a message merge then these conflicts will appear in your translations. This test quickly extracts those for correction. .. _pofilter_tests#credits: credits ------- Checks for messages containing translation credits instead of normal translations. Some projects have consistent ways of giving credit to translators by having a unit or two where translators can fill in their name and possibly their contact details. This test allows you to find these units easily to check that they are completed correctly and also disables other tests that might incorrectly get triggered for these units (such as urls, emails, etc.) .. _pofilter_tests#dialogsizes: dialogsizes ----------- Checks that dialog sizes are not translated. This is a Mozilla specific test. Mozilla uses a language called XUL to define dialogues and screens. This can make use of CSS to specify properties of the dialogue. These properties include things such as the width and height of the box. The size might need to be changed if the dialogue size changes due to longer translations. Thus translators can change these settings. But you are only meant to change the number not translate the words 'width' or 'height'. This check capture instances where these are translated. It will also catch other types of errors in these units. .. _pofilter_tests#doublequoting: doublequoting ------------- Checks whether doublequoting is consistent between the two strings. Checks on double quotes ``"`` to ensure that you have the same number in both the original and the translated string. This tests takes into account that several languages use different quoting characters, and will test for them instead. .. _pofilter_tests#doublespacing: doublespacing ------------- Checks for bad double-spaces by comparing to original. This will identify if you have [space][space] in when you don't have it in the original or it appears in the original but not in your translation. Some of these are spurious and how you correct them depends on the conventions of your language. .. _pofilter_tests#doublewords: doublewords ----------- Checks for repeated words in the translation. Words that have been repeated in a translation will be highlighted with this test e.g. "the the", "a a". These are generally typos that need correcting. Some languages may have valid repeated words in their structure, in that case either ignore those instances or switch this test off using the :opt:`--excludefilters` option. .. _pofilter_tests#emails: emails ------ Checks to see that emails are not translated. Generally you should not be translating email addresses. This check will look to see that email addresses e.g. info@example.com are not translated. In some cases of course you should translate the address but generally you shouldn't. .. _pofilter_tests#endpunc: endpunc ------- Checks whether punctuation at the end of the strings match. This will ensure that the ending of your translation has the same punctuation as the original. E.g. if it ends in :[space] then so should yours. It is useful for ensuring that you have ellipses [...] in all your translations, not simply three separate full-stops. You may pick up some errors in the original: feel free to keep your translation and notify the programmers. In some languages, characters such as ? ! are always preceded by a space e.g. [space]? — do what your language customs dictate. Other false positives you will notice are, for example, if through changes in word-order you add "), etc. at the end of the sentence. Do not change these: your language word-order takes precedence. It must be noted that if you are tempted to leave out [full-stop] or [colon] or add [full-stop] to a sentence, that often these have been done for a reason, e.g. a list where fullstops make it look cluttered. So, initially match them with the English, and make changes once the program is being used. This check is aware of several language conventions for punctuation characters, such as the custom question marks for Greek and Arabic, Devenagari Danda, full-width punctuation for CJK languages, etc. Support for your language can be added easily if it is not there yet. .. _pofilter_tests#endwhitespace: endwhitespace ------------- Checks whether whitespace at the end of the strings matches. Operates the same as endpunc but is only concerned with whitespace. This filter is particularly useful for those strings which will evidently be followed by another string in the program, e.g. [Password: ] or [Enter your username: ]. The whitespace is an inherent part of the string. This filter makes sure you don't miss those important but otherwise invisible spaces! If your language uses full-width punctuation (like Chinese), the visual spacing in the character might be enough without an added extra space. .. _pofilter_tests#escapes: escapes ------- Checks whether escaping is consistent between the two strings. Checks escapes such as ``\n`` ``\uNNNN`` to ensure that if they exist in the original string you also have them in the translation. .. _pofilter_tests#filepaths: filepaths --------- Checks that file paths have not been translated. Checks that paths such as ``/home/user1`` have not been translated. Generally you do not translate a file-path, unless it is being used as an example, e.g. [your_user_name/path/to/filename.conf]. .. _pofilter_tests#functions: functions --------- Checks to see that function names are not translated. Checks that function names e.g. ``rgb()`` or ``getEntity.Name()`` are not translated. .. _pofilter_tests#gconf: gconf ----- Checks if we have any gconf config settings translated. Gconf settings should not be translated so this check checks that gconf settings such as "name" or "modification_date" are not translated in the translation. It allows you to change the surrounding quotes but will ensure that the setting values remain untranslated. .. _pofilter_tests#hassuggestion: hassuggestion ------------- Checks if there is at least one suggested translation for this unit. If a message has a suggestion (an alternate translation stored in alt-trans units in XLIFF and .pending files in PO) then these will be extracted. This is used by Pootle and is probably only useful in pofilter when using XLIFF files. .. _pofilter_tests#isfuzzy: isfuzzy ------- Checks if the po element has been marked fuzzy. If a message is marked fuzzy in the PO file then it is extracted. Note this is different from :opt:`--fuzzy` and :opt:`--nofuzzy` options which specify whether tests should be performed against messages marked fuzzy. .. _pofilter_tests#isreview: isreview -------- Checks if the po element has been marked for review. If you have made use of the 'review' flags in your translations:: # (review) reason for review # (pofilter) testname: explanation for translator Then if a message is marked for review in the PO file it will be extracted. Note this is different from :opt:`--review` and :opt:`--noreview` options which specify whether tests should be performed against messages already marked as under review. .. _pofilter_tests#kdecomments: kdecomments ----------- Checks to ensure that no KDE style comments appear in the translation. KDE style translator comments appear in PO files as ``"_: comment\n"``. New translators often translate the comment. This test tries to identify instances where the comment has been translated. .. _pofilter_tests#long: long ---- Checks whether a translation is much longer than the original string. This is most useful in the special case where the translation is multiple characters long while the source text is only 1 character long. Otherwise, we use a general ratio that will catch very big differences but is set conservatively to limit the number of false positives. .. _pofilter_tests#musttranslatewords: musttranslatewords ------------------ Checks that words configured as definitely translatable don't appear in the translation. If for instance in your language you decide that you must translate 'OK' then this test will flag any occurrences of 'OK' in the translation if it appeared in the source string. You must specify a file containing all of the *must translate* words using :opt:`--musttranslatefile`. .. _pofilter_tests#newlines: newlines -------- Checks whether newlines are consistent between the two strings. Counts the number of ``\n`` newlines (and variants such as ``\r\n``) and reports and error if they differ. .. _pofilter_tests#nplurals: nplurals -------- Checks for the correct number of noun forms for plural translations. This uses the plural information in the language module of the toolkit. This is the same as the Gettext nplural value. It will check that the number of plurals required is the same as the number supplied in your translation. .. _pofilter_tests#notranslatewords: notranslatewords ---------------- Checks that words configured as untranslatable appear in the translation too. Many brand names should not be translated, this test allows you to easily make sure that words like: Word, Excel, Impress, Calc, etc. are not translated. You must specify a file containing all of the *no translate* words using :opt:`--notranslatefile`. .. _pofilter_tests#numbers: numbers ------- Checks whether numbers of various forms are consistent between the two strings. You will see some errors where you have either written the number in full or converted it to the digit in your translation. Also changes in order will trigger this error. Some languages don't use latin numbers but instead use different numbers. This check will take that into account. .. _pofilter_tests#options: options ------- Checks that command line options are not translated. In messages that contain command line options, such as :opt:`--help`, this test will check that these remain untranslated. These could be translated in the future if programs can create a mechanism to allow this, but currently they are not translated. If the options has a parameter, e.g. :opt:`--file=FILE`, then the test will check that the parameter has been translated. .. _pofilter_tests#printf: printf ------ Checks whether printf format strings match. If the printf formatting variables are not identical, then this will indicate an error. Printf statements are used by programs to format output in a human readable form (they are place holders for variable data). They allow you to specify lengths of string variables, string padding, number padding, precision, etc. Generally they will look like this: ``%d``, ``%5.2f``, ``%100s``, etc. The test can also manage variables-reordering using the ``%1$s`` syntax. The variables' type and details following data are tested to ensure that they are strictly identical, but they may be reordered. .. seealso:: :ref:`pofilter_tests#pythonbraceformat` .. seealso:: :wp:`printf Format String ` .. _pofilter_tests#puncspacing: puncspacing ----------- Checks for bad spacing after punctuation. In the case of [full-stop][space] in the original, this test checks that your translation does not remove the space. It checks also for [comma], [colon], etc. Some languages don't use spaces after common punctuation marks, especially where full-width punctuation marks are used. This check will take that into account. .. _pofilter_tests#purepunc: purepunc -------- Checks that strings that are purely punctuation are not changed. This extracts strings like "+" or "-" as these usually should not be changed. .. _pofilter_tests#pythonbraceformat: pythonbraceformat ----------------- Checks whether Python brace format strings match. Python supports both a variant of the :ref:`pofilter_tests#printf` formatting system, and its own formatting language which uses placeholders enclosed in braces. The placeholders can be named, numbered, or anonymous; the former two are filled in from positional args, the latter from keyword arguments. Example:: 'the {} {0} hungry {insect}'.format('very', insect='caterpiller') # --> 'the very very hungry caterpiller' The ``pythonbraceformat`` filter checks for the following problems: * named placeholders that are present in the original, but missing in the translation, and vice versa. * originals and translations that require different numbers of positional args. When the translation has variables not in the original, this can lead to program crashes. The translation not using all variables the original uses is safe. Nonetheless, this filter triggers in both cases. .. seealso:: `PEP 3101 -- Advanced String Formatting `_ .. _pofilter_tests#sentencecount: sentencecount ------------- Checks that the number of sentences in both strings match. Adds the number of sentences to see that the sentence count is the same between the original and translated string. You may not always want to use this test, if you find you often need to reformat your translation, because the original is badly-expressed, or because the structure of your language works better that way. Do what works best for your language: it's the meaning of the original you want to convey, not the exact way it was written in the English. .. _pofilter_tests#short: short ----- Checks whether a translation is much shorter than the original string. This is most useful in the special case where the translation is 1 characters long while the source text is multiple characters long. Otherwise, we use a general ratio that will catch very big differences but is set conservatively to limit the number of false positives. .. _pofilter_tests#simplecaps: simplecaps ---------- Checks the capitalisation of two strings isn't wildly different. This will pick up many false positives, so don't be a slave to it. It is useful for identifying translations that don't start with a capital letter (upper-case letter) when they should, or those that do when they shouldn't. It will also highlight sentences that have extra capitals; depending on the capitalisation convention of your language, you might want to change these to Title Case, or change them all to normal sentence case. .. _pofilter_tests#simpleplurals: simpleplurals ------------- Checks for English style plural(s) for you to review. This test will extract any message that contains words with a final "(s)" in the source text. You can then inspect the message, to check that the correct plural form has been used for your language. In some languages, plurals are made by adding text at the beginning of words, making the English style messy. In this case, they often revert to the plural form. This test allows an editor to check that the plurals used are correct. Be aware that this test may create a number of false positives. For languages with no plural forms (only one noun form) this test will simply test that nothing like "(s)" was used in the translation. .. _pofilter_tests#singlequoting: singlequoting ------------- Checks whether singlequoting is consistent between the two strings. The same as doublequoting but checks for the ``'`` character. Because this is used in contractions like it's and in possessive forms like user's, this test can output spurious errors if your language doesn't use such forms. If a quote appears at the end of a sentence in the translation, i.e. ``'.``, this might not be detected properly by the check. .. _pofilter_tests#spellcheck: spellcheck ---------- Checks for words that don't pass a spell-check. This test will check for misspelled words in your translation. The test first checks for misspelled words in the original (usually English) text, and adds those to an exclusion list. The advantage of this exclusion is that many words that are specific to the application will not raise errors e.g. program names, brand names, function names. The checker works with `PyEnchant `_. You need to have PyEnchant installed as well as a dictionary for your language (for example, one of the `Hunspell `_ or `aspell `_ dictionaries). This test will only work if you have specified the :opt:`--language` option. The pofilter error that is created, lists the misspelled word, plus suggestions returned from the spell checker. That makes it easy for you to identify the word and select a replacement. .. _pofilter_tests#startcaps: startcaps --------- Checks that the message starts with the correct capitalisation. After stripping whitespace and common punctuation characters, it then checks to see that the first remaining character is correctly capitalised. So, if the sentence starts with an upper-case letter, and the translation does not, an error is produced. This check is entirely disabled for many languages that don't make a distinction between upper and lower case. Contact us if this is not yet disabled for your language. .. _pofilter_tests#startpunc: startpunc --------- Checks whether punctuation at the beginning of the strings match. Operates as endpunc but you will probably see fewer errors. .. _pofilter_tests#startwhitespace: startwhitespace --------------- Checks whether whitespace at the beginning of the strings matches. As in endwhitespace but you will see fewer errors. .. _pofilter_tests#tabs: tabs ---- Checks whether tabs are consistent between the two strings. Counts the number of ``\t`` tab markers and reports an error if they differ. .. _pofilter_tests#unchanged: unchanged --------- Checks whether a translation is basically identical to the original string. This checks to see if the translation isn't just a copy of the English original. Sometimes, this is what you want, but other times you will detect words that should have been translated. .. _pofilter_tests#untranslated: untranslated ------------ Checks whether a string has been translated at all. This check is really only useful if you want to extract untranslated strings so that they can be translated independently of the main work. .. _pofilter_tests#urls: urls ---- Checks to see that URLs are not translated. This checks only basic URLs (http, ftp, mailto etc.) not all URIs (e.g. afp, smb, file). Generally, you don't want to translate URLs, unless they are example URLs (http://your_server.com/filename.html). If the URL is for configuration information, then you need to query the developers about placing configuration information in PO files. It shouldn't really be there, unless it is very clearly marked: such information should go into a configuration file. .. _pofilter_tests#validchars: validchars ---------- Checks that only characters specified as valid appear in the translation. Often during character conversion to and from UTF-8 you get some strange characters appearing in your translation. This test presents a simple way to try and identify such errors. This test will only run of you specify the :opt:`--validcharsfile` command line option. This file contains all the characters that are valid in your language. You must use UTF-8 encoding for the characters in the file. If the test finds any characters not in your valid characters file then the test will print the character together with its Unicode value (e.g. 002B). .. _pofilter_tests#variables: variables --------- Checks whether variables of various forms are consistent between the two strings. This checks to make sure that variables that appear in the original also appear in the translation. Make sure you use the :opt:`--kde`, :opt:`--openoffice`, etc flags as these define what variables will be searched for. It does not at the moment cope with variables that use the reordering syntax of Gettext PO files. .. _pofilter_tests#xmltags: xmltags ------- Checks that :doc:`XML/HTML ` tags have not been translated. This check finds the number of tags in the source string and checks that the same number are in the translation. If the counts don't match then either the tag is missing or it was mistakenly translated by the translator, both of which are errors. The check ignores tags or things that look like tags that cover the whole string e.g. "" but will produce false positives for things like "An occurred" as here "Error" should be translated. It also will allow translation of the alt attribute in e.g. Image
description or similar translatable attributes in OpenOffice.org help files. translate-3.15.1/docs/commands/pogrep.rst000066400000000000000000000073151476453735700204100ustar00rootroot00000000000000 .. _pogrep: pogrep ****** The pogrep tool extracts messages that match a regular expression into a new set of PO files that can be examined, edited and corrected. These corrections can then be merged using :doc:`pomerge`. .. _pogrep#usage: Usage ===== :: pogrep [options] Where: +------------+-------------------------------------------------------------+ | / | *In* and *out* are either directories or files. *Out* will | | | contain PO/XLIFF files with only those messages that match | | | the regular expression that was you searched for. | +------------+-------------------------------------------------------------+ Options: --version show program's version number and exit -h, --help show this help message and exit --manpage output a manpage based on the help --progress=PROGRESS show progress as: :doc:`dots, none, bar, names, verbose ` --errorlevel=ERRORLEVEL show errorlevel as: :doc:`none, message, exception, traceback ` -i INPUT, --input=INPUT read from INPUT in gmo, mo, po, pot, tmx, xlf, xlff, xliff formats -x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -o OUTPUT, --output=OUTPUT write to OUTPUT in gmo, mo, po, pot, tmx, xlf, xlff, xliff formats --search=SEARCHPARTS searches the given parts (source, target, notes, locations) -I, --ignore-case ignore case distinctions -e, --regexp use regular expression matching -v, --invert-match select non-matching lines --accelerator=ACCELERATORS ignores the given :doc:`accelerator characters ` when matching -k, --keep-translations always extract units with translations .. _pogrep#example: Example ======= :: pogrep --accelerator="_" --search msgid -I -e "software|hardware" only-zu only-zu-check Search for the words "software" or "hardware" in the msgid field. Ignore case (:opt:`-I`) and treat the underscore (_) character as an accelerator key. Search through all PO files in the directory "only-zu" and place any matches in PO files in the directory "only-zu-check". This would be useful to run if you know that the word for software and hardware has been changed during the course of translation and you want to check and correct all these instances. :: pogrep --search=msgid -e '^\w+(\s+\w+){0,3}$' -i templates -o short-words Find all messages in the *templates* directory that have between 1 and 4 words and place them in *short-words*. Use this if you want to see quick results by translating messages that are most likely menu entries or dialogue labels. :: pogrep --search=msgstr -I -e "Ifayile" zu zu-check Search all translations for the occurrence of *Ifayile*. You would use this to check if words have been used correctly. Useful if you find problematic use of the same word for different concepts. You can use :doc:`pocompendium` to find these conflicts. .. _pogrep#notes: Notes ===== .. _pogrep#unicode_normalization: Unicode normalization --------------------- pogrep will normalize Unicode strings. This allows you to search for strings that contain the same character but that are using precomposed Unicode characters or which are composed using another composition recipe. While an individual user will in all likelihood only compose characters in one way, normalization ensures that data created in a team setting can be shared. .. _pogrep#further_reading: Further reading =============== Here is a blog post explaining how pogrep can be used to do more targeted localisation of GNOME: http://translate.org.za/blogs/friedel/en/content/better-lies-about-gnome-localisation translate-3.15.1/docs/commands/pomerge.rst000066400000000000000000000077731476453735700205620ustar00rootroot00000000000000 .. _pomerge: pomerge ******* Pomerge will merge corrected PO, XLIFF, or TMX files (or snippets) into your existing PO, XLIFF, TMX files. Usually you would extract errors using :doc:`pofilter`, make corrections to these PO (or XLIFF, TMX) snippets then merge them back using pomerge. You could also use :doc:`pogrep` to extract a number of messages matching a certain string, make corrections then merge the correction back using pomerge. It is probably best to run pomerge against files stored in some kind of version control system so that you can monitor what changes were made. Pomerge will also attempt to make as small a change as possible to the text, making it easier to see the changes using your version control system. .. _pomerge#usage: Usage ===== :: pomerge [options] [-t