pax_global_header00006660000000000000000000000064125245743470014527gustar00rootroot0000000000000052 comment=eae434f362fac8ffb60f92cc80b732f1c1035376 translate-1.13.0/000077500000000000000000000000001252457434700136065ustar00rootroot00000000000000translate-1.13.0/.coveragerc000066400000000000000000000002351252457434700157270ustar00rootroot00000000000000[run] omit = tests/* translate/test_* translate/*/test_* translate/*/*/test_* translate/misc/selector.py translate/misc/wsgiserver/* translate-1.13.0/.gitignore000066400000000000000000000012251252457434700155760ustar00rootroot00000000000000# / /LICENSE # /docs/ /docs/_build/ # Python *.py[cod] *.egg-info # pytest .cache/ # vim .*.swp *~ # distutils /build/ /dist/ MANIFEST MANIFEST.in # Requirements generation .reqs requirements/min-versions.txt # Coverage .coverage* ############################## # 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-1.13.0/.gitmodules000066400000000000000000000001441252457434700157620ustar00rootroot00000000000000[submodule "docs/_themes"] path = docs/_themes url = git://github.com/translate/sphinx-themes.git translate-1.13.0/.isort.cfg000066400000000000000000000005611252457434700155070ustar00rootroot00000000000000[settings] line_length=80 force_to_top=file1.py,file2.py skip=docs,selector.py,wsgiserver known_standard_library=thread known_third_party=iniparse,lxml,vobject known_first_party=mylib1,mylib2 indent=' ' multi_line_output=0 length_sort= forced_separate=django.contrib,django.utils default_section=FIRSTPARTY order_by_type=1 combine_as_imports=1 lines_after_imports=2 translate-1.13.0/.travis.yml000066400000000000000000000017571252457434700157310ustar00rootroot00000000000000# https://travis-ci.org/#!/translate/translate language: python python: - 2.6 - 2.7 env: matrix: - USECPO=0 MINVERSION=1 - USECPO=0 MINVERSION= #- USECPO=1 #- USECPO=2 matrix: exclude: - python: 2.6 env: USECPO=0 MINVERSION=1 before_install: - sudo apt-get install python-aeidon install: - pip install coveralls - if [[ $MINVERSION ]]; then make requirements/min-versions.txt; cat requirements/min-versions.txt; CFLAGS="-O0" pip install -r requirements/min-versions.txt; pip install --upgrade pytest; fi - if [[ ! $MINVERSION ]]; then CFLAGS="-O0" pip install -r requirements/dev.txt; fi # Still need to handle with indexing engines - pip freeze script: - python -m compileall -q -f . # Compile all the files - python setup.py --quiet build - py.test --cov=. -r EfsxX - pip install . - make test-functional - ./tools/pep8.sh travis - make docs after_success: coveralls notifications: email: on_failure: always on_success: change translate-1.13.0/COPYING000066400000000000000000000431101252457434700146400ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 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 Ty Coon, 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-1.13.0/CREDITS000066400000000000000000000033011252457434700146230ustar00rootroot00000000000000Translate 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 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-1.13.0/LICENSES000066400000000000000000000013161252457434700147370ustar00rootroot00000000000000================================== Licenses of Toolkit and Other Code ================================== The Translate Toolkit is released the license listed in COPYING. Other licenses ============== We import or have used code from the following projects: CherryPy -------- This is used by tmserver. Depending on the whole of CherryPy was overkill for just needing this server component. License: BSD copy in translate/misc/wsgiserver/LICENSE.txt Used in: translate/misc/wsgiserver/* From: CherryPy 3.2.4 https://pypi.python.org/packages/source/C/CherryPy/CherryPy-3.2.4.tar.gz#md5=e2c8455e15c39c9d60e0393c264a4d16 The code has been changed slightly: 1. from cherrypy import -> from translate.misc import translate-1.13.0/Makefile000066400000000000000000000057071252457434700152570ustar00rootroot00000000000000DOCS_DIR = docs FORMATS=--formats=bztar .PHONY: all build docs requirements help publish-pypi sort-imports all: help build: docs python setup.py sdist ${FORMATS} docs: # Make sure that the submodule with docs theme is pulled and up-to-date. git submodule update --init # The following creates the HTML docs. # NOTE: cd and make must be in the same line. cd ${DOCS_DIR}; make SPHINXOPTS="-W -q" html ${TAIL} docs-review: docs python -mwebbrowser file://$(shell pwd)/${DOCS_DIR}/_build/html/index.html publish-pypi: python setup.py sdist ${FORMATS} upload sort-imports: isort -rc . help: @echo "Help" @echo "----" @echo @echo " build - create sdist with required prep" @echo " docs - build Sphinx docs" @echo " docs-review - launch webbrowser to review docs" @echo " requirements - (re)generate pinned and minimum requirements" @echo " sort-imports - sort Python imports" @echo " publish-pypi - publish on PyPI" @echo " test - run unit test suite" @echo " test-functional - run the functional test suite" # Perform forced build using -W for the (.PHONY) requirements target requirements: $(MAKE) -W $(REQFILE) requirements/min-versions.txt requirements.txt REQS=.reqs REQFILE=requirements/recommended.txt requirements.txt: $(REQFILE) @set -e; \ case `pip --version` in \ "pip 0"*|"pip 1.[012]"*) \ virtualenv --no-site-packages --clear $(REQS); \ source $(REQS)/bin/activate; \ echo starting clean install of requirements from PyPI; \ pip install --use-mirrors -r $(REQFILE); \ : trap removes partial/empty target on failure; \ trap 'if [ "$$?" != 0 ]; then rm -f $@; fi' 0; \ pip freeze | grep -v '^wsgiref==' | sort > $@ ;; \ *) \ : only pip 1.3.1+ processes --download recursively; \ rm -rf $(REQS); mkdir $(REQS); \ echo starting download of requirements from PyPI; \ pip install --download $(REQS) -r $(REQFILE); \ : trap removes partial/empty target on failure; \ trap 'if [ "$$?" != 0 ]; then rm -f $@; fi' 0; \ (cd $(REQS) && ls *.tar* | \ sed -e 's/-\([0-9]\)/==\1/' -e 's/\.tar.*$$//') > $@; \ esac; requirements/min-versions.txt: requirements/*.txt @if grep -q '>[0-9]' $^; then \ echo "Use '>=' not '>' for requirements"; exit 1; \ fi @echo "creating $@" @echo "# Automatically generated: DO NOT EDIT" > $@ @echo "# Regenerate using 'make requirements'" >> $@ @echo "# ====================================" >> $@ @echo "# Minimum Requirements" >> $@ @echo "# ====================================" >> $@ @echo "#" >> $@ @echo "# These are the minimum versions of dependencies that the developers" >> $@ @echo "# claim will work." >> $@ @echo "#" >> $@ @echo "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $@ @echo "#" >> $@ @echo >> $@ @cat $^ | sed -n '/=/{s/>=/==/;s/,<.*//;s/,!=.*//;p;};/^[-#]/d;/^$$/d;/=/d;p;' >> $@ test: @py.test --boxed -r EfsxX test-functional: @tests/cli/run_tests.sh translate-1.13.0/README.rst000066400000000000000000000256341252457434700153070ustar00rootroot00000000000000Translate Toolkit ----------------- .. image:: https://travis-ci.org/translate/translate.png :alt: Build Status :target: https://travis-ci.org/translate/translate .. image:: https://coveralls.io/repos/translate/translate/badge.png?branch=master :alt: Coverage Status :target: https://coveralls.io/r/translate/translate?branch=master .. image:: https://pypip.in/download/translate-toolkit/badge.png :alt: Downloads :target: https://pypi.python.org/pypi/translate-toolkit/ .. image:: https://pypip.in/py_versions/translate-toolkit/badge.png :alt: Supported Python versions :target: https://pypi.python.org/pypi/translate-toolkit/ .. image:: https://pypip.in/status/translate-toolkit/badge.png :alt: Development Status :target: https://pypi.python.org/pypi/translate-toolkit/ .. image:: https://pypip.in/license/translate-toolkit/badge.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.sourceforge.net project, hosted at . The software includes programs to covert 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. Download -------- The latest version of the Translate Toolkit can be downloaded from: . The latest documentation is always available at http://docs.translatehouse.org/projects/translate-toolkit/en/latest/ (Documentation is also included in the doc directory). Copying ------- The Translate Toolkit is developed and Copyright:: Zuza Software Foundation (Translate.org.za), and St James Software and is released under the GPL license. The Translate Toolkit Documentation is Copyright:: Dwayne Bailey Javier SOLA David Fraser Friedel Wolff and others and is released under the GPL. Where useful emails have been quoted we have attempted to preserve the authors name and assume that their work may be republished. 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 ------------ .. note:: Please check ``requirements/*.txt``:: pip install -r requirements/recommended.txt Will install all recommended requirements, while ``optional.txt`` will also install support for all other formats. Python 2.6 or later is required. Python 2.5 is no longer supported by the Python Software Foundation, while the Toolkit may work in versions before Python 2.6 this is not supported. The package lxml is needed for XML file processing. You should install version 2.2.0 or later. Depending on your platform, the easiest way to install might be through your system's package management. Alternatively you can try :: easy_install lxml which should install the newest version from the web. See the easy_install documentation for more details on how to force installation of a certain version, or to specify upgrade options, etc. 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. http://code.google.com/p/iniparse/ 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 iso-codes 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 iso-codes package for your distribution, but it is optional. Alternatively, it is also available from http://packages.debian.org/unstable/source/iso-codes The package vobject is needed for ical2po and po2ical. Versions from 0.6.0 have been tested, 0.6.5 is required to fix an issue related to Lotus Notes calendars. The aeidon package (or gaupol if aeidon is not available) is needed for sub2po and po2sub. Some Unicode encoded files (including most files from ) require version 0.14 or later. Gaupol might need the 'Universal Encoding Detector' Trados TXT TM support requires the BeautifulSoup parser The programs have been tested on Linux and Windows. Installation ------------ To install the Translate Toolkit * Windows Double click on translate-toolkit-N.N-setup.exe (the larger download file). This installer contains all dependencies you will need, including Python. To use any of the command line tools, just type their name in a command window. For example:: moz2po --version Alternatively you can install the smaller translate-toolkit-N.N.N.win32.exe This needs an existing Python installation, and assumes you will install all the dependencies yourself. You will probably need to edit your PATH environment variable to be able to use the tools in any command window. * Linux :: tar xzf translate-N.N.tar.gz cd translate-N.N su -c ./setup.py install If you get an error along the lines of :: Unable to open /usr/lib/python2.N/config/Makefile (no such file or directory) while running setup.py, you need to install python-dev or libpython2.N-devel package. Try to install python2.N-dev or libpython2.N-devel or something similar with your distribution's package manager. Bugs ---- We think there might be some :) Please send your bug reports to: translate-devel at lists.sourceforge.net or report them at Some help in writing useful bug reports are mentioned here: Documentation ------------- Please read our documentation online at http://docs.translatehouse.org/projects/translate-toolkit/en/latest/. There they are constantly being updated. Please feel free to contribute new sections and suggest corrections. Most tools support the options ``--help`` and ``--manpage`` of which the output is automatically generated. The output of ``--manpage`` produces output suitable for formatting as a standard manpage. This can be viewed on UNIX platforms with :: nroff -Tutf8 -mandoc With pot2po as example:: pot2po --manpage | nroff -Tutf8 -mandoc | less This is probably most useful for packagers to help them generate manual pages for the packaged versions. 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) 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-1.13.0/docs/000077500000000000000000000000001252457434700145365ustar00rootroot00000000000000translate-1.13.0/docs/Makefile000066400000000000000000000131571252457434700162050ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = 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-1.13.0/docs/_ext/000077500000000000000000000000001252457434700154755ustar00rootroot00000000000000translate-1.13.0/docs/_ext/translate_docs.py000066400000000000000000000020741252457434700210570ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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-1.13.0/docs/_static/000077500000000000000000000000001252457434700161645ustar00rootroot00000000000000translate-1.13.0/docs/_static/README.txt000066400000000000000000000000671252457434700176650ustar00rootroot00000000000000In this directory go static files, for example images. translate-1.13.0/docs/_themes/000077500000000000000000000000001252457434700161625ustar00rootroot00000000000000translate-1.13.0/docs/api/000077500000000000000000000000001252457434700153075ustar00rootroot00000000000000translate-1.13.0/docs/api/convert.rst000066400000000000000000000120261252457434700175220ustar00rootroot00000000000000convert ======= .. 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: 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: poreplace --------- .. automodule:: translate.convert.poreplace :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: 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: translate-1.13.0/docs/api/filters.rst000066400000000000000000000014221252457434700175100ustar00rootroot00000000000000filters ======= .. 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-1.13.0/docs/api/index.rst000066400000000000000000000014501252457434700171500ustar00rootroot00000000000000.. _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 filters ^^^^^^^ .. automodule:: translate.filters lang ^^^^ .. automodule:: translate.lang misc ^^^^ .. automodule:: translate.misc search ^^^^^^ .. automodule:: translate.search services ^^^^^^^^ .. automodule:: translate.services storage ^^^^^^^ .. automodule:: translate.storage tools ^^^^^ .. automodule:: translate.tools Module list ------------ All the modules included in the Translated Toolkit are listed here. .. toctree:: :maxdepth: 3 convert filters lang misc search services storage tools translate-1.13.0/docs/api/lang.rst000066400000000000000000000063651252457434700167740ustar00rootroot00000000000000lang ==== .. 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-1.13.0/docs/api/misc.rst000066400000000000000000000026401252457434700167760ustar00rootroot00000000000000misc ==== .. automodule:: translate.misc :show-inheritance: autoencode ---------- .. automodule:: translate.misc.autoencode :members: :inherited-members: dictutils --------- .. automodule:: translate.misc.dictutils :members: :inherited-members: file_discovery -------------- .. automodule:: translate.misc.file_discovery :members: :inherited-members: lru --- .. automodule:: translate.misc.lru :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: sparse ------ .. automodule:: translate.misc.sparse :members: :inherited-members: stdiotell --------- .. automodule:: translate.misc.stdiotell :members: :inherited-members: wsgi ---- .. automodule:: translate.misc.wsgi :members: :inherited-members: wStringIO --------- .. automodule:: translate.misc.wStringIO :members: :inherited-members: xml_helpers ----------- .. automodule:: translate.misc.xml_helpers :members: :inherited-members: translate-1.13.0/docs/api/search.rst000066400000000000000000000020341252457434700173050ustar00rootroot00000000000000search ====== .. automodule:: translate.search :show-inheritance: indexing -------- .. automodule:: translate.search.indexing :show-inheritance: CommonIndexer ~~~~~~~~~~~~~ .. automodule:: translate.search.indexing.CommonIndexer :members: :inherited-members: PyLuceneIndexer1 ~~~~~~~~~~~~~~~~ .. automodule:: translate.search.indexing.PyLuceneIndexer1 :members: :inherited-members: PyLuceneIndexer ~~~~~~~~~~~~~~~ .. automodule:: translate.search.indexing.PyLuceneIndexer :members: :inherited-members: XapianIndexer ~~~~~~~~~~~~~ .. automodule:: translate.search.indexing.XapianIndexer :members: :inherited-members: lshtein ------- .. automodule:: translate.search.lshtein :members: :inherited-members: match ----- .. automodule:: translate.search.match :members: :inherited-members: segment ------- .. automodule:: translate.search.segment :members: :inherited-members: terminology ----------- .. automodule:: translate.search.terminology :members: :inherited-members: translate-1.13.0/docs/api/services.rst000066400000000000000000000002611252457434700176630ustar00rootroot00000000000000services ======== .. automodule:: translate.services :show-inheritance: tmserver -------- .. automodule:: translate.services.tmserver :members: :inherited-members: translate-1.13.0/docs/api/storage.rst000066400000000000000000000163361252457434700175160ustar00rootroot00000000000000storage ======= .. 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: 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: statsdb ------- .. automodule:: translate.storage.statsdb :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: versioncontrol -------------- .. automodule:: translate.storage.versioncontrol :members: :show-inheritance: bzr ~~~ .. automodule:: translate.storage.versioncontrol.bzr :members: :inherited-members: cvs ~~~ .. automodule:: translate.storage.versioncontrol.cvs :members: :inherited-members: darcs ~~~~~ .. automodule:: translate.storage.versioncontrol.darcs :members: :inherited-members: git ~~~ .. automodule:: translate.storage.versioncontrol.git :members: :inherited-members: hg ~~ .. automodule:: translate.storage.versioncontrol.hg :members: :inherited-members: svn ~~~ .. automodule:: translate.storage.versioncontrol.svn :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-1.13.0/docs/api/tools.rst000066400000000000000000000032201252457434700171760ustar00rootroot00000000000000tools ===== .. 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-1.13.0/docs/changelog.rst000066400000000000000000000577101252457434700172310ustar00rootroot00000000000000 .. _changelog: Changelog ********* The Translate Toolkit might have changed how it functions in certain cases. This page lists what has changed, how it might affect you and how to work around the change either to bring your files in line or to use the old behaviour if required. .. note:: For newer Translate Toolkit versions changes please check the :doc:`Release notes `. .. _changelog#1.6.0: 1.6.0 ===== .. _changelog#po_files_now_always_have_headers: PO files now always have headers -------------------------------- Generated PO files now always contain headers. This will mainly affect the output of pofilter and pogrep. This should allow better interoperability with gettext tools, and allowed for some improvement in the code. You should still be able to use headerless files in msgmerge, although it is recommended that PO files are consistently handled with headers wherever possible. .. _changelog#1.4.1: 1.4.1 ===== .. _changelog#csv_column_header_names: CSV column header names ----------------------- The names given to CSV column headers have been changed. Early releases of :doc:`/commands/csv2po` would name the columns "comment,original,translation". This was done mostly to make it easy for non-technical translators. However, comments in the command line help used terms like source and target. This release changes the column header names to "location,source,target", this aligns with terms used throughout the toolkit. If you have CSV file generated by older versions of the toolkit then a header entry of "comment,original,translation" will be turned into a unit instead of being ignored. You can either change your CSV file to use the headers "location,source,target" or delete the header row completely. Once this is done the files will work as expected. .. _changelog#1.4.0: 1.4.0 ===== .. _changelog#java_and_mozilla_.properties: Java and Mozilla .properties ---------------------------- Unusual keys, separators and spacing should all be handled correctly now. Some Mozilla .properties files might now have changed. Regenerate your Mozilla l10n files from fresh POT files without any changes to your PO files to ensure that you can see and review these changes. .. _changelog#hashing_in_podebug: Hashing in podebug ------------------ The :opt:`--hash` option in :doc:`/commands/podebug` has been replaced by a format specifier %h to be able to better control the positioning of the hash value. .. _changelog#1.3.0: 1.3.0 ===== Several duplicate styles were removed as has been warned about long before. Please check the recommendations posted at the time that msgctxt was added on how to migrate. .. _changelog#1.2: 1.2 === .. _changelog#new_formats: New formats ----------- The toolkit now supports: * :doc:`/formats/qt_phrase_book` * :doc:`/formats/ts` v1.1 This allows reading, counting and working on these formats. The :doc:`/commands/ts2po` converter has not been changed so you will not be able to benefit from the new .ts support. However, you can use the format for translation memory, etc as its is now fully base class compliant. .. _changelog#stats_database_change: Stats database change --------------------- There were some changes in the database used by pocount for storing statistics. The location of the database might also have changed, depending on what the last version is that you used. Remove the file stats.db from any of ~/.translate_toolkit, ~/.wordforge (or the corresponding directories on your Windows installation. .. _changelog#valid_accelerators: Valid accelerators ------------------ The :doc:`/commands/pofilter` accelerator test is now able to make use of a list of valid accelerators. This allows translators to control the behaviour of the test for their language and add or remove characters that can be used as accelerators. Please define the :ref:`valid accelerators ` for your language and these will then be included in future releases of the toolkit. By default the old process is followed so that if you take no action then this check will continue to work as expected. .. _changelog#branches: branches ======== These are branches that contain quite invasive changes that will most likely be merged into the main development and be released sometime in the future. .. _changelog#toolkit-c-po: toolkit-C-po ------------ Converting the current Python based PO parser to the Gettext C based parser for PO. This offers quite a dramatic speed improvement and conformance to the output found in Gettext itself. For most users there will be a number of changes in layout of the files as they will now conform fully to Gettext layout. The 'keep' option in :opt:`--duplicatestyle` will no longer be supported as this is not valid Gettext output. .. _changelog#1.1.1: 1.1.1 ===== .. _changelog#premature_termination_of_dtd_entities: Premature termination of DTD entities ------------------------------------- Although this does not occur frequently a case emerged where some DTD entities where not fully extracted from the DTD source. This was fixed in :issue:`331`. We expect this change to create a few new fuzzy entries. There is no action required from the user as the next update of your PO files will bring the correct text into your translations, if you are using a translation memory your translation might be recovered from obsolete translations. .. _changelog#1.1: 1.1 === .. _changelog#oo2po_help_helpcontent2_escaping_fixed: oo2po Help (helpcontent2) escaping fixed ---------------------------------------- OpenOffice.org Help (helpcontent2) has notoriously contained some unreadable esacping, e.g. ``\\\\``. The escaping has been fixed and oo2po now understands helpcontent2 escaping while leaving the current GUI escape handling unaltered. If you have not translated helpcontent2 then you are unaffected by this change. If you have translated this content then you will need to follow these instructions when upgrading. If you follow normal procedures of creating POT files and upgrading your PO files using pot2po then your strings will not match and you will obtain files with many fuzzies. To avoid this do the following: #. Make sure your PO files contain no fuzzy entries #. Use po2oo from the previous release to create and SDF file #. Upgrade to the latest Translate Toolkit with new po2oo #. Use ``po2oo -l xx-YY your.sdf po`` to create a new set of PO files with correct escaping You can choose to do this with only your helpcontent2 PO files if needed, this will allow you to leave your GUI work in its current state. Simply do the above procedure and discard all PO files except helpcontent2, then move these new helpcontent2 files into your current work. .. _changelog#prop2po_uses_developer_comments: prop2po uses developer comments ------------------------------- prop2po used to place comments found in the source .properties file in traditional translator comments, they should of course go into developer comments. The reason for this change is twofold, it allows these comments to be correctly managed and it is part of the process of cleaning up these formats so that they are closer to the base class and can thus work with XLIFF. For the user there will be fairly large changes as one comment format moves to the next. It is best to :doc:`cleanup translator comments ` and get your translations into a fit state, i.e. no fuzzies, and then proceed with any migrations. .. _changelog#moz2po_no_longer_uses_kde_comments: moz2po no longer uses KDE comments ---------------------------------- moz2po has traditionally used KDE style comments for storing comments aimed at translators. Many translators confuse these and try to translate them. Thus these have been moved into automatic or developer comments. The result for many people migrating Mozilla PO files will be that many strings will become fuzzy, you can avoid much of this by using pot2po which should intelligently be able to match without considering the KDE comments. The best strategy is to get your translations into a relatively good shape before migration. You can then migrate them first to a new set of POT files generated from the same source files that the translation is based on. Eliminate all fuzzies as these should only relate to the changes in layout. Then proceed to migrate to a new set of POT files. If you cannot work against the original source files then the best would be to also first eliminate fuzzy matches before proceeding to translation. Your fuzzies will include changes in layout and changes in content so proceed carefully. At the end of this you should have PO files that conform to the Gettext standard without KDE comments. .. _changelog#read_and_write_mo_files: Read and Write MO files ----------------------- You can read and write Gettext MO files (compiled PO files). Thus pocount can now count files on your filesystem and you can also compile MO files using pocompile. MO files can be compiled from either PO or XLIFF sources. MO will now also produce correct output for msgctxt and plural forms found in PO files. .. _changelog#read_qt_.qm_files: Read Qt .qm files ----------------- We can now read Qt .qm files, thus pocount can count the contents of compiled files. We cannot however write .qm files at this time. .. _changelog#1.0.1: 1.0.1 ===== .. _changelog#pot2po_will_create_new_empty_po_files_if_needed: pot2po will create new empty PO files if needed ----------------------------------------------- From version 1.0.1, pot2po will create empty PO files corresponding to new POT files that might have been introduced. If some new POT files are present in the input to pot2po, you will see a new PO file appear in your output directory that was not in your old PO files. You will not lose any data but in the worst case you will see new files on projects that you thought were fully translated. .. _changelog#1.0: 1.0 === .. _changelog#improved_xliff_support: Improved XLIFF support ---------------------- Many toolkit tools that only worked with PO files before, can now also work with XLIFF files. pogrep, pocount, pomerge, and pofilter all work with XLIFF, for example. .. _changelog#pretty_xml_output: Pretty XML output ----------------- All XML formats should now be more human readable, and the converters to Qt .ts files should work correctly again. .. _changelog#fuzzy_matching_in_pot2po_is_optional: Fuzzy matching in pot2po is optional ------------------------------------ Fuzzy matching can now be entirely disabled in :doc:`/commands/pot2po` with the :opt:`--nofuzzymatching` parameter. This should make it much faster, although pot2po is **substantially** faster than earlier versions, especially if :doc:`python-Levenshtein ` is installed. .. _changelog#old_match/levenshtein.py*_can_cause_name_clash: Old match/Levenshtein.py* can cause name clash ---------------------------------------------- The file previously called match/Levenshtein.py was renamed to lshtein.py in order to use the python-Levenshtein package mentioned above. If you follow the basic installation instructions, the old file will not be overwritten, and can cause problems. Ensure that you remove all files starting with Levenshtein.py in the installation path of the translate toolkit, usually something like /usr/lib/python2.4/site-packages/translate/search/. It could be up to three files. .. _changelog#po_file_layout_now_follows_gettext_more_closely: PO file layout now follows Gettext more closely ----------------------------------------------- The toolkits output PO format should now resemble Gettext PO files more closely. Long lines are wrapped correctly, messages with long initial lines will start with a 'msgid ""' entry. The reason for this change is to ensure that differences in files relate to content change not format change, no matter what tool you use. To understand the problem more clearly. If a user creates POT files with e.g. :doc:`/commands/oo2po`. She then edits them in a PO editor or manipulate them with the Gettext tools. The layout of the file after manipulation was often different from the original produced by the Toolkit. Thus making it hard to tell what where content changes as opposed to layout changes. The changes will affect you as follows: #. They will only impact you when using the Toolkit tools. #. You manipulate your files with a tool that follows Gettext PO layout * your experience should now improve as the new PO files will align with your existing files * updates should now only include real content changes not layout changes #. You manipulate your files using Toolkit related tools or manual editing * your files will go through a re-layout the first time you use any of the tools * subsequent usage should continue as normal * any manipulation using Gettext tools will leave your files correctly layed out. Our suggestion is that if you are about to suffer a major reflow that your initial merge contain only reflow and update changes. Do content changes in subsequent steps. Once you have gone through the reflow you should see no layout changes and only content changes. .. _changelog#language_awareness: Language awareness ------------------ The toolkit is gradually becoming more aware of the differences between languages. Currently this mostly affects pofilter checks (and therefore also Pootle) where tests involving punctuation and capitalisation will be more aware of the differences between English and some other languages. Provisional customisation for the following languages are in place and we will welcome more work on the language module: Amharic, Arabic, Greek, Persian, French, Armenian, Japanese, Khmer, Vietnamese, all types of Chinese. .. _changelog#new_pofilter_tests:_newlines_and_tabs: New pofilter tests: newlines and tabs ------------------------------------- The escapes test has been refined with two new tests, ``newlines`` and ``tabs``. This makes identifying the errors easier and makes it easier to control the results of the tests. You shouldn't have to change your testing behaviour in any way. .. _changelog#merging_can_change_fuzzy_status: Merging can change fuzzy status ------------------------------- pomerge now handles fuzzy states:: pomerge -t old -i merge -o new Messages that are fuzzy in *merge* will now also be fuzzy in *new*. Similarly if a fuzzy state is present in *old* but removed in *merge* then the message in *new* will not be fuzzy. Previously no fuzzy states were changed during a merge. .. _changelog#pofilter_will_make_mozilla_accelerators_a_serious_failure: pofilter will make Mozilla accelerators a serious failure --------------------------------------------------------- If you use :doc:`/commands/pofilter` with the :opt:`--mozilla` option then accelerator failures will produce a serious filter error, i.e. the message will be marked as ``fuzzy``. This has been done because accelerator problems in your translations have the potential to break Mozilla applications. .. _changelog#po2prop_can_output_mozilla_or_java_style_properties: po2prop can output Mozilla or Java style properties --------------------------------------------------- We have added the :opt:`--personality` option to allow a user to select output in either :opt:`java`, or :opt:`mozilla` style (Java property files use escaped Unicode, while Mozilla uses actual Unicode characters). This functionality was always available but was not exposed to the user and we always defaulted to the Mozilla style. When using :doc:`po2moz ` the behaviour is not changed for the user as the programs will ensure that the properties convertor uses Mozilla style. However, when using :doc:`po2prop ` the default style is now ``java``, thus if you are converting a single ``.properties`` file as part of a Mozilla conversion you will need to add :opt:`--personality=mozilla` to your conversion. Thus:: po2prop -t moz.properties moz.properties.po my-moz.properties Would become:: po2prop --personality=mozilla -t moz.properties moz.properties.po my-moz.properties .. note:: Output in java style escaped Unicode will still be usable by Mozilla but will be harder to read. .. _changelog#support_for_compressed_files: Support for compressed files ---------------------------- There is some initial support for reading from and writing to compressed files. Single files compressed with gzip or bzip2 compression is supported, but not tarballs. Most tools don't support it, but pocount and the :opt:`--tm` parameter to pot2po will work with it, for example. Naturally it is slower than working with uncompressed files. Hopefully more tools can support it in future. .. _changelog#0.11: 0.11 ==== .. _changelog#po2oo_defaults_to_not_check_for_errors: po2oo defaults to not check for errors -------------------------------------- In po2oo we made the default :opt:`--filteraction=none` i.e. do nothing and don't warn. Until we have a way of clearly marking false positives we'll have to disable this functionality as there is no way to quiet the output or mark non errors. Also renamed exclude to exclude-all so that it is clearer what it does i.e. it excludes 'all' vs excludes 'serious'. .. _changelog#pofilter_xmltags_produces_less_false_positives: pofilter xmltags produces less false positives ---------------------------------------------- In the xmltags check we handle the case where we had some false positives. E.g. "" which looks like XML/HTML but should actually be translated. These are handled by #. identifying them as being the same length as the source text, #. not containing any '=' sign. Thus the following would not be detected by this hack. "An occurred" -> "", but these ones need human eyes anyway. .. _changelog#0.10: 0.10 ==== .. _changelog#po_to_xliff_conversion: PO to XLIFF conversion ---------------------- Conversion from PO to XLIFF is greatly improved in 0.10 and this was done according to the specification at http://xliff-tools.freedesktop.org/wiki/Projects/XliffPoGuide -- please let us know if there are features lacking. .. _changelog#pot2po_can_replace_msgmerge: pot2po can replace msgmerge --------------------------- :doc:`/commands/pot2po` has undergone major changes which means that it now respects your header entries, can resurrect obsolete messages, does fuzzy matching using :doc:`Levenshtein distance ` algorithm, will correctly match messages with KDE style comments and can use an external Translation Memory. You can now use pot2po instead of Gettext's msgmerge and it can also replace :doc:`/commands/pomigrate2`. You may still want to use pomigrate2 if there where file movements between versions as pot2po can still not do intelligent matching of PO and POT files, pomigrate2 has also been adapted so that it can use pot2po as it background merging tool. :: pomigrate2 --use-compendium --pot2po This will migrate file with a compendium built from PO files in ** and will use pot2po as its conversion engine. .. _changelog#.properties_pretty_formatting: .properties pretty formatting ----------------------------- When using templates for generating translated .properties files we will now preserve the formatting around the equal sign. .. code-block:: properties # Previously if the template had property = value .. code-block:: properties # We output property=translation .. code-block:: properties # We will now output property = translation This change ensures that there is less noise when checking differences against the template file. However, there will be quite a bit of noise when you make your first .properties commits with the new pretty layout. Our suggestion is that you make a single commit of .properties files without changes of translations to gt the formatting correct. .. _changelog#0.9: 0.9 === .. _changelog#escaping_-_dtd_files_are_no_longer_escaped: Escaping -- DTD files are no longer escaped ------------------------------------------- Previously each converter handled escaping, which made it a nightmare every time we identified an escaping related error or added a new format. Escaping has now been moved into the format classes as much as possible, the result being that formats exchange Python strings and manage their own escaping. I doing this migration we revisited some of the format migration. We found that we were escaping elements in our output DTD files. DTD's should have no escaping i.e. ``\n`` is a literal ``\`` followed by an ``n`` not a newline. A result of this change is that older PO files will have different escaping to what po2moz will now expect. Probably resulting in bad output .dtd files. We did not make this backward compatible as the fix is relatively simple and is one you would have done for any migration of your PO files. 1. Create a new set of POT files :: moz2po -P mozilla pot 2. Migrate your old PO files :: pomigrate2 old new pot 3. Fix all the fuzzy translations by editing your PO files 4. Use pofilter to check for escaping problems and fix them :: pofilter -t escapes new new-check 5. Edit file in new-check in your PO editor :: pomerge -t new -i new-check -o new-check .. _changelog#migration_to_base_class: Migration to base class ----------------------- All filters are/have been migrate to a base class. This move is so that it is easier to add new format, interchange formats and to create converters. Thus xx2po and xx2xlf become easier to create. Also adding a new format should be as simple as working towards the API exposed in the base class. An unexpected side effect will be the Pootle should be able to work directly with any base class file (although that will not be the normal Pootle operation) We have checks in place to ensure the the current operation remains correct. However, nothing is perfect and unfortunately the only way to really expose all bugs is to release this software. If you discover a bug please report it on Bugzilla or on the Pootle mailing list. If you have the skills please check on HEAD to see if it is not already fixed and if you regard it as critical discuss on the mailing list backporting the fix (note some fixes will not be backported because they may be too invasive for the stable branch). If you are a developer please write a test to expose the bug and a fix if possible. .. _changelog#duplicate_merging_in_po_files_-_merge_now_the_default: Duplicate Merging in PO files -- merge now the default ------------------------------------------------------ We added the :opt:`--duplicatestyle` option to allow duplicate messages to be merged, commented or simply appear in the PO unmerged. Initially we used the msgid_comments options as the default. This adds a KDE style comment to all affected messages which created a good balance allowing users to see duplicates in the PO file but still create a valid PO file. 'msgid_comments' was the default for 0.8 (FIXME check), however it seemed to create more confusion then it solved. Thus we have reverted to using 'merge' as the default (this then completely mimics Gettext behaviour). As Gettext will soon introduce the msgctxt attribute we may revert to using that to manage disambiguation messages instead of KDE comments. This we feel will put us back at a good balance of usefulness and usability. We will only release this when msgctxt version of the Gettext tools are released. .. _changelog#.properties_files_no_longer_use_escaped_unicode: .properties files no longer use escaped Unicode ----------------------------------------------- The main use of the .properties converter class is to translate Mozilla files, although .properties files are actually a Java standard. The old Mozilla way, and still the Java way, of working with .properties files is to escape any Unicode characters using the ``\uNNNN`` convention. Mozilla now allows you to use Unicode in UTF-8 encoding for these files. Thus in 0.9 of the Toolkit we now output UTF-8 encoded properties files. :issue:`Issue 193 <193>` tracks the status of this and we hope to add a feature to prop2po to restore the correct Java convention as an option. translate-1.13.0/docs/commands/000077500000000000000000000000001252457434700163375ustar00rootroot00000000000000translate-1.13.0/docs/commands/csv2po.rst000066400000000000000000000116321252457434700203100ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in csv format -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -tTEMPLATE, --template=TEMPLATE read from TEMPLATE in pot, po, pot formats -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 (location,source,target) --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 ` -iINPUT, --input=INPUT read from INPUT in po, pot formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in csv format -S, --timestamp skip conversion if the output file has newer timestamp -P, --pot output PO Templates (.pot) rather than PO files (.po) --columnorder=COLUMNORDER specify the order and position of columns (location,source,target) .. _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 | +--------+-----------------+---------------------------------------------+ .. _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 :option:`--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-1.13.0/docs/commands/csv2tbx.rst000066400000000000000000000064361252457434700204750ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in csv format -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --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-1.13.0/docs/commands/general_usage.rst000066400000000000000000000040161252457434700216730ustar00rootroot00000000000000 .. _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 us 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-1.13.0/docs/commands/html2po.rst000066400000000000000000000072541252457434700204660ustar00rootroot00000000000000 .. _html2po: .. _po2html: html2po ******* Convert translatable items in HTML to the PO format. .. _html2po#usage: Usage ===== :: html2po [options] po2html [options] Where: +---------+-----------------------------------------------+ | | is an HTML file or a directory of HTML files | +---------+-----------------------------------------------+ | | 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 ` -iINPUT, --input=INPUT read from INPUT in htm, html, xhtml formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --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 --duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): :doc:`merge, msgctxt ` (default: 'msgctxt') 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 ` -iINPUT, --input=INPUT read from INPUT in po, pot formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in htm, html formats -tTEMPLATE, --template=TEMPLATE read from TEMPLATE in htm, html formats -S, --timestamp skip conversion if the output file has newer timestamp -wWRAP, --wrap=WRAP set number of columns to wrap html at --notidy don't use tidy to clean up HTML, even if installed (new in version 1.2.1) --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*:: po2html -t site xh 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* .. _html2po#bugs: Bugs ==== We don't hide enough of some of the tags, e.g. tags have too much exposed, we should expose only what needs to be translated and allow the changing on position of the tag within the translation block. Similarly there is some markup that could be excluded e.g. tags that appear at the start and end of a msgid, i.e. they don't need placement from the translator. If the HTML is indented you get very odd msgid's Some items end up in the msgid's that should not be translated It might be worth investigating http://opensource.bureau-cornavin.com/html2pot-po2html/index.html which uses XSLT to transform XHTML to Gettext PO translate-1.13.0/docs/commands/ical2po.rst000066400000000000000000000102751252457434700204270ustar00rootroot00000000000000 .. _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 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 (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 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) .. _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-ad.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 calender 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-1.13.0/docs/commands/index.rst000066400000000000000000000136641252457434700202120ustar00rootroot00000000000000.. _commands: .. _commands#converters: Converters ********** .. toctree:: :maxdepth: 1 :hidden: general_usage moz2po oo2po odf2xliff prop2po php2po sub2po txt2po po2wordfast po2tmx pot2po csv2po csv2tbx html2po ical2po ini2po json2po web2py2po rc2po resx2po symb2po tiki2po ts2po xliff2po .. toctree:: :maxdepth: 1 :hidden: option_errorlevel option_duplicates option_progress option_filteraction option_multifile option_personality option_accelerator 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:`moz2po ` -- Mozilla .properties and .dtd converter. Works with Firefox and Thunderbird * :doc:`oo2po ` -- OpenOffice.org SDF converter (Also works as ``oo2xliff``). * :doc:`odf2xliff ` -- Convert OpenDocument (ODF) documents to XLIFF and vice-versa. * :doc:`prop2po ` -- Java property file (.properties) converter * :doc:`php2po ` -- PHP localisable string arrays converter. * :doc:`sub2po ` -- Converter for various subtitle files * :doc:`txt2po ` -- Plain text to PO converter * :doc:`po2wordfast ` -- Wordfast Translation Memory converter * :doc:`po2tmx ` -- TMX (Translation Memory Exchange) converter * :doc:`pot2po ` -- initialise PO Template files for translation * :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:`html2po ` -- HTML converter * :doc:`ical2po ` -- iCalendar file converter * :doc:`ini2po ` -- Windows INI file converter * :doc:`json2po ` -- JSON file converter * :doc:`web2py2po` -- web2py translation to PO converter * :doc:`rc2po ` -- Windows Resource .rc (C++ Resource Compiler) converter * :doc:`resx2po ` -- .Net Resource (.resx) file converter * :doc:`symb2po ` -- Symbian-style translation to PO converter * :doc:`tiki2po ` -- `TikiWiki `_ language.php converter * :doc:`ts2po ` -- Qt Linguist .ts converter * :doc:`xliff2po ` -- XLIFF (XML Localisation Interchange File Format) 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: poconflicts pofilter pofilter_tests pogrep pomerge porestructure junitmsgfmt These tools are especially useful for measuring and improving translation quality. * :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 * :doc:`junitmsgfmt` -- run msgfmt and provide JUnit type output for use in continuous integration systems like Hudson and Jenkins .. _commands#other_tools: Other tools =========== .. toctree:: :maxdepth: 1 :hidden: tmserver poterminology poterminology_stopword_file pocount podebug option_rewrite posegment pocompile poswap poclean pretranslate levenshtein_distance * :doc:`tmserver` -- a Translation Memory server, can be queried over HTTP using JSON * :doc:`poterminology` -- extracts potential terminology from your translation files * :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:`pocompile` -- create an MO (Machine Object) file from a PO or XLIFF file * :doc:`poswap` -- uses a translation of another language that you would rather use than English as source language * :doc:`poclean` -- produces a clean file from an unclean file (Trados/Wordfast) by stripping out the tw4win indicators * :doc:`pretranslate` -- fill any missing translations from translation memory via fuzzy matching. * :doc:`levenshtein_distance` -- edit distance algorithms for translation memory matching .. _commands#scripts: Scripts ******* .. toctree:: :maxdepth: 1 :hidden: mozilla_l10n_scripts moz-l10n-builder phase pocompendium pocommentclean 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:`moz-l10n-builder` -- Create Mozilla XPIs and rebuild Windows installers from existing translations * :doc:`mozilla_l10n_scripts` -- Build Mozilla products Firefox and Thunderbird * :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-1.13.0/docs/commands/ini2po.rst000066400000000000000000000125061252457434700202750ustar00rootroot00000000000000 .. _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 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 (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 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) .. _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-1.13.0/docs/commands/json2po.rst000066400000000000000000000077141252457434700204740ustar00rootroot00000000000000 .. _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) .. _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-1.13.0/docs/commands/junitmsgfmt.rst000066400000000000000000000004031252457434700214350ustar00rootroot00000000000000 .. _junitmsgfmt: junitmsgfmt *********** .. 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-1.13.0/docs/commands/levenshtein_distance.rst000066400000000000000000000051051252457434700232700ustar00rootroot00000000000000 .. _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:: bash $ 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 can not 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-1.13.0/docs/commands/moz-l10n-builder.rst000066400000000000000000000105501252457434700220730ustar00rootroot00000000000000 .. _moz-l10n-builder: moz-l10n-builder **************** Take a set of Mozilla (Firefox, Thunderbird, SeaMonkey, etc.) localisation and migrate them to the latest Mozilla source, building XPIs and repackaging hte Windows .exe file as needed. Please also check the page on `creating a language pack `_ on the Mozilla wiki, to stay abreast of the latest Mozilla way of doing things. .. note:: This page is only applicable to Mozilla products with its source hosted in CVS. This includes Firefox versions before 3.1 and Thunderbird versions before 3.0. For information about working with the new source trees in Mercurial, see the :doc:`mozilla_l10n_scripts` page. .. _moz-l10n-builder#prerequisites: Prerequisites ============= * Translation update component and building XPIs * :doc:`Translate Toolkit ` * Existing Mozilla translations in PO format * A checkout of `Mozilla sources `_ updated to the correct `BRANCH or RELEASE `_ * Building Windows executables * Firefox or Thunderbird `en-US .exe `_ file e.g. `Firefox 2.0 en-US `_ * `upx `_ for executable compression * `Nullsoft installer `_ to package the installer. * `7zip `_ for various compression * Linux: `WINE `_ to run the Nullsoft installer * Directory structure under the directory you want to run moz-l10n-builder in: +-----------+--------------------------------------------------------------+ | l10n/ | Contains Mozilla l10n files for available/needed language(s) | +-----------+--------------------------------------------------------------+ | mozilla/ | The Mozilla source tree | +-----------+--------------------------------------------------------------+ | po/ | Contains your PO files (output from moz2po) | +-----------+--------------------------------------------------------------+ | potpacks/ | Where POT-archives go | +-----------+--------------------------------------------------------------+ Note these instructions are for building on Linux, they may work on Windows. All software should be available through your distribution. You will need to use Wine to install the Nullsoft installer and may need to sort out some path issues to get it to run correctly. .. _moz-l10n-builder#latest_version: Latest Version ============== moz-l10n-builer is not currently distributed as part of the toolkit. You can get the `latest version from Git `_ and you will also need this `minor patch `_ to the mozilla source code. .. _moz-l10n-builder#usage: Usage ===== :: moz-l10n-builder [language-code|ALL] Where: +----------------+-----------------------------------------------------------+ | language-code | build only the supplied languages, or build ALL if | | | specified or if no option is supplied | +----------------+-----------------------------------------------------------+ Your translations will not be modified. .. _moz-l10n-builder#operation: Operation ========= moz-l10n-builder does the following: * Updates the mozilla/ directory * Creates POT files * Migrates your translations to this new POT file * Converts the migrated POT files to .dtd and .properties files * Builds XPI and .exe files * Performs various hacks to cater for the anomalies of file formats * Outputs a diff of you migrated PO files and your newly generated Mozilla l10n/ files .. _moz-l10n-builder#bugs: Bugs ==== Currently it is too Translate.org.za specific and not easily configurable without editing. It is also not intelligent enough to work our that you want Firefox vs Thunderbird generation. A lot of this functionality should be in the Mozilla source code itself. We hope over time that this might happen. translate-1.13.0/docs/commands/moz2po.rst000066400000000000000000000164751252457434700203340ustar00rootroot00000000000000 .. _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. For more about using the Translate Toolkit and PO files for translating Mozilla products, please see the page on :doc:`mozilla_l10n_scripts`. .. _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 ` -iINPUT, --input=INPUT read from INPUT in inc, it, \*, dtd, properties formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --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 -tTEMPLATE, --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 ` -iINPUT, --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 -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in dtd, \*, inc, it, properties formats -tTEMPLATE, --template=TEMPLATE read from TEMPLATE in dtd, \*, inc, it, properties formats -S, --timestamp skip conversion if the output file has newer timestamp -lLOCALE, --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 ------------------ .. seealso:: :doc:`Creating Mozilla 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 ouput 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-1.13.0/docs/commands/mozilla_l10n_scripts.rst000066400000000000000000000227371252457434700231540ustar00rootroot00000000000000 .. _mozilla_l10n_scripts: Mozilla L10n Scripts ******************** .. _mozilla_l10n_scripts#introduction: Introduction ============ This page describes the purpose and usage of scripts available in the Translate Toolkit specifically for making the translation of Mozilla products easier. Mozilla's move from CVS to Mercurial made a lot of these scripts necessary. For more information about Mozilla l10n from CVS, see the :doc:`moz-l10n-builder` page. All of these scripts are available on Subversion from `here `_. We are currently generating POT files for most major betas, RCs and releases of Firefox and Thunderbird. They are available here: http://l10n.mozilla.org/pootle/pot/ As a start you might want to just use these POT files and gradually learn more about the processes described below. Contact us for more help on using these. .. _mozilla_l10n_scripts#requirements: Requirements ============ * The :doc:`Translate Toolkit ` (>=1.3) * All scripts in the ``tools/mozilla`` directory (from the project sources) should be executable and in your ``PATH``. .. _build_ff3.1_langs.sh: build_ff3.1_langs.sh ==================== .. _build_ff3.1_langs.sh#description: Description ----------- This is a simple bash script that embodies most of the Mozilla l10n process and does the following: #. Update Mozilla sources #. Update language files from `Mozilla's L10n `_ Mercurial repository. #. Replace old l10n en-US files with a fresh copy from the updated source tree. #. :doc:`Create new POT files ` from the :ref:`en-US ` l10n files. #. Create archives of the POT files. #. For each language: #. Update existing PO files if the checked out from a CVS, Subversion or Mercurial repository. #. :doc:`Migrate ` PO files to new POT files. #. :doc:`Create Mozilla l10n files ` for the language based on the migrated PO files. #. Create archives of the PO files. #. :ref:`Build langpack ` for the language. This script is used on the l10n.mozilla.org server to create most (if not all) of the files available from http://l10n.mozilla.org/pootle/. It was originally written as a stable way to provide these files and as such making it as general as possible was not the biggest requirement. This is evident in the script's very narrow focus. .. _build_ff3.1_langs.sh#usage: Usage ----- This script takes no command-line parameters and is only configurable via the variables at the top and, failing that, custom hacking of the script. The variables are used in the following ways: +--------------------+-------------------------------------------------------+ | ``BUILD_DIR`` | The base build directory from where building is done. | +--------------------+-------------------------------------------------------+ | ``MOZCENTRAL_DIR`` | The directory containing a checkout of the Mozilla | | | source tree http://hg.mozilla.org/mozilla-central/ | +--------------------+-------------------------------------------------------+ | ``HG_LANGS`` | A space-separated list of language codes to build | | | for. | +--------------------+-------------------------------------------------------+ | ``L10N_DIR`` | The directory where Mozilla l10n files | | | (from l10n-central) should be collected. | +--------------------+-------------------------------------------------------+ | ``PO_DIR`` | The directory containing the externally-hosted or | | | previously available source PO files (e.g. PO files | | | managed in another VCS repository). It contains a | | | sub-directory for each language. | +--------------------+-------------------------------------------------------+ | ``POPACK_DIR`` | The output directory for PO archives. | +--------------------+-------------------------------------------------------+ | ``PORECOVER_DIR`` | The directory to put recovered PO files in. It | | | contains a sub-directory for each language. | +--------------------+-------------------------------------------------------+ | ``POT_INCLUDES`` | A space-separated list of files to be included in POT | | | archives. | +--------------------+-------------------------------------------------------+ | ``POTPACK_DIR`` | The output directory for POT archives. | +--------------------+-------------------------------------------------------+ | ``POUPDATED_DIR`` | The directory to use for updated PO files. It | | | contains a sub-directory for each language. | +--------------------+-------------------------------------------------------+ | ``LANGPACK_DIR`` | The directory to put langpacks (XPIs) in. | +--------------------+-------------------------------------------------------+ | ``FF_VERSION`` | The version of Firefox that is being built for. This | | | is used in the file names of archives. | +--------------------+-------------------------------------------------------+ .. note:: It is **strongly** recommended that you mirror the directory structure specified by the default values of the ``*_DIR`` variables. For example the default value for ``L10N_DIR`` is ``${BUILD_DIR}/l10n``, then you should put your l10n-central check-outs in the ``l10n`` directory under your main build directory (``BUILD_DIR``). Basically, you should have an ideally separate build directory containing the following sub-directories: ``l10n``, ``mozilla-central``, ``po``, ``popacks``, ``potpacks``, ``po-updated`` and ``xpi`` (if used). This way the only variable that need to be changed is ``BUILD_DIR``. .. _build_tb3_langs.sh: build_tb3_langs.sh ================== This is the script that the ``build_ff3.1_langs.sh`` script above was actually adapted from. It is 90% similar with the obvious exception that it is aimed at building Thunderbird 3.0 packages in stead of Firefox 3.1. Also note that this script uses the comm-central repository in stead of mozilla-central. .. _buildxpi.py: buildxpi.py =========== .. _buildxpi.py#description: Description ----------- Creates XPI language packs from Mozilla sources and translated l10n files. This script has only been tested with Firefox 3.1 beta sources. It is basically the scripted version of the process described on Mozilla's `"Creating a language pack" `_ page. This script is used by ``build_ff3.1_langs.sh`` to build language packs in its final step. .. note:: This script uses the ``.mozconfig`` file in your home directory. Any existing ``.mozconfig`` is renamed to ``.mozconfig.bak`` during operation and copied back afterwards. .. _buildxpi.py#usage: Usage ----- :: buildxpi.py [] [ ...] Example:: buildxpi.py -L /path/to/l10n -s /path/to/mozilla-central -o /path/to/xpi_output af ar Options: -h, --help show this help message and exit -L L10NBASE, --l10n-base=L10NBASE The directory containing the subdirectory. -o OUTPUTDIR, --output-dir=OUTPUTDIR The directory to copy the built XPI to (default: current directory). -p MOZPRODUCT, --mozproduct=MOZPRODUCT The Mozilla product name (default: "browser"). -s SRCDIR, --src=SRCDIR The directory containing the Mozilla l10n sources. -d, --delete-dest Delete output XPI if it already exists. -v, --verbose Be more noisy .. _get_moz_enus.py: get_moz_enUS.py =============== .. _get_moz_enus.py#description: Description ----------- A simple script to collect the en-US l10n files from a Mozilla source tree (``'comm-central``' or ``'mozilla-central``') by traversing the product's ``l10n.ini`` file. .. _get_moz_enus.py#usage: Usage ----- :: get_moz_enUS.py [options] Options: -h, --help show this help message and exit -s SRCDIR, --src=SRCDIR The directory containing the Mozilla l10n sources. -d DESTDIR, --dest=DESTDIR The destination directory to copy the en-US locale files to. -p MOZPRODUCT, --mozproduct=MOZPRODUCT The Mozilla product name. --delete-dest Delete the destination directory (if it exists). -v, --verbose Be more noisy .. _moz-l10n-builder#deprecated: moz-l10n-builder ================ This is the pre-Mercurial build script originally written by Dwayne Bailey. This is the script that all the others on this page replaces for post-CVS Mozilla l10n. .. note:: This script is **not** applicable to the l10n process of any Mozilla products after the move to Mercurial. For more information about this script see its :doc:`dedicated page `. .. _moz_l10n_builder.py: moz_l10n_builder.py =================== This script was intended to be a simple and direct port of the ``moz-l10n-builder`` script from above. It has pro's and cons in comparison to the original, but is very similar for the most part. So for more information about this script, see the original script's :doc:`page `. translate-1.13.0/docs/commands/odf2xliff.rst000066400000000000000000000071631252457434700207630ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/oo2po.rst000066400000000000000000000166051252457434700201370ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in oo format -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --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) (only available in oo2po -lLANG, --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 ` -iINPUT, --input=INPUT read from INPUT in po, pot formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in oo format -tTEMPLATE, --template=TEMPLATE read from TEMPLATE in oo format -S, --timestamp skip conversion if the output file has newer timestamp -lLANG, --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 --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-1.13.0/docs/commands/option_accelerator.rst000066400000000000000000000022051252457434700227440ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/option_duplicates.rst000066400000000000000000000045531252457434700226250ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/option_errorlevel.rst000066400000000000000000000032471252457434700226500ustar00rootroot00000000000000 .. _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 occured processing PO file") ValueError: An error occurred processing PO file translate-1.13.0/docs/commands/option_filteraction.rst000066400000000000000000000011271252457434700231450ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/option_multifile.rst000066400000000000000000000011441252457434700224530ustar00rootroot00000000000000 .. _option_multifile: --multifile=MULTIFILESTYLE ************************** This options determines how the POT/PO files are spli 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. Ie you see a number of top level files. .. _option_multifile#onefiles: onefiles ======== One large file instead of many smaller files. translate-1.13.0/docs/commands/option_personality.rst000066400000000000000000000030321252457434700230300ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/option_progress.rst000066400000000000000000000054651252457434700223370ustar00rootroot00000000000000 .. _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:: bash [dwayne@laptop OOo20]$ oo2po -P --progress=none en-US.sdf pot [dwayne@laptop OOo20]$ .. _option_progress#dots: dots ==== Use visual dots to represent progress. Each dot represent a file that has been processed. .. code-block:: bash [dwayne@laptop OOo20]$ oo2po -P --progress=dots en-US.sdf pot ............................................................................................. ............................................................................................. ......................................... [dwayne@laptop OOo20]$ .. _option_progress#bar_default: bar (default) ============= Use a progress bar consisting of hashes (#) to show progress. .. code-block:: bash [dwayne@laptop OOo20]$ 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:: bash [dwayne@laptop OOo20]$ 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:: bash [dwayne@laptop OOo20]$ 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:: bash [dwayne@laptop OOo20]$ 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-1.13.0/docs/commands/option_rewrite.rst000066400000000000000000000071241252457434700221460ustar00rootroot00000000000000 .. _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. translate-1.13.0/docs/commands/phase.rst000066400000000000000000000104311252457434700201700ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/php2po.rst000066400000000000000000000101141252457434700202760ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/po2tmx.rst000066400000000000000000000062221252457434700203240ustar00rootroot00000000000000 .. _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. .. [*] 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 possble 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 ` -iINPUT, --input=INPUT read from INPUT in po, pot formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in tmx format -lLANG, --language=LANG set target language code (e.g. af-ZA) [required] --source-language=LANG set source language code (default: en) .. _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-1.13.0/docs/commands/po2wordfast.rst000066400000000000000000000031671252457434700213520ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in po, pot formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in tmx format -S, --timestamp skip conversion if the output file has newer timestamp -lLANG, --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-1.13.0/docs/commands/poclean.rst000066400000000000000000000034031252457434700205120ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in pot format -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -tTEMPLATE, --template=TEMPLATE read from TEMPLATE in po, pot formats .. _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-1.13.0/docs/commands/pocommentclean.rst000066400000000000000000000017101252457434700220740ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/pocompendium.rst000066400000000000000000000066351252457434700216020ustar00rootroot00000000000000 .. _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-1.13.0/docs/commands/pocompile.rst000066400000000000000000000033471252457434700210670ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in xlf, po, pot formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in mo format --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-1.13.0/docs/commands/poconflicts.rst000066400000000000000000000073131252457434700214200ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in po format -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --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-1.13.0/docs/commands/pocount.rst000066400000000000000000000130311252457434700205560ustar00rootroot00000000000000 .. _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 outputing 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-1.13.0/docs/commands/podebug.rst000066400000000000000000000147331252457434700205260ustar00rootroot00000000000000 .. _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 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 ` -iINPUT, --input=INPUT read from INPUT in po, pot formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats -P, --pot output PO Templates (.pot) rather than PO files (.po) -fFORMAT, --format=FORMAT specify format string --rewrite=STYLE the translation rewrite style: :doc:`xxx, en, blank, chef (v1.2), unicode (v1.2) ` --ignore=APPLICATION apply tagging ignore rules for the given application: kde, gtk, openoffice, libreoffice, mozilla --hash=LENGTH add an md5 hash to translations (only until version 1.3.0 -- see %h below) .. _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 occurance 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 a alphanumeric value. Its is then easy to search for that value and find your problem string. .. _podebug#more_reading: Usings podebug ============== Here are some more examples in a `series `_ `of `_ `blog posts `_. translate-1.13.0/docs/commands/pofilter.rst000066400000000000000000000117031252457434700207170ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in pot, po, xlf, tmx formats -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --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 --header include a PO header in the output (always the case since version 1.6) --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 -tFILTER, --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-1.13.0/docs/commands/pofilter_tests.rst000066400000000000000000000614461252457434700221520ustar00rootroot00000000000000 .. _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 :ref:`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 targetted 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. .. _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 occurances 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. .. _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 :wiki:`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-1.13.0/docs/commands/pogrep.rst000066400000000000000000000073101252457434700203660ustar00rootroot00000000000000 .. _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 ` -iINPUT, --input=INPUT read from INPUT in po, pot, xlf formats (XLIFF since version 1.0) -xEXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths -oOUTPUT, --output=OUTPUT write to OUTPUT in po, pot, xlf formats (XLIFF since version 1.0) --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-1.13.0/docs/commands/pomerge.rst000066400000000000000000000075721252457434700205420ustar00rootroot00000000000000 .. _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