Commit Graph

41 Commits

Author SHA1 Message Date
Mike Hansen 35d36d9462 Refs #30585 -- Updated project templates and tests to use (block)translate tags. 2019-12-18 13:15:38 +01:00
Mike Hansen d291c72bf2 Fixed #30585 -- Added {% translate %} and {% blocktranslate %} template tags. 2019-12-18 13:15:38 +01:00
Claude Paroz c651331b34 Converted usage of ugettext* functions to their gettext* aliases
Thanks Tim Graham for the review.
2017-02-07 09:04:04 +01:00
Claude Paroz 4731e9d82e Fixed #26341 (again) -- Addressed multiple occurrences per line use case 2016-05-02 19:39:56 +02:00
Claude Paroz b16b124996 Fixed #26341 -- Fixed makemessages breaking location comments for HTML files
Thanks Sylvain Garancher for the report and Veranika Sabiashchanskaya for the
initial patch.
2016-04-30 12:08:20 +02:00
Claude Paroz 104eddbdf6 Fixed #26093 -- Allowed escape sequences extraction by gettext on Python 3
Thanks Sylvain Fankhauser for the report and Tim Graham for the review.
2016-01-23 14:00:55 +01:00
Claude Paroz cd3c042b04 Fixed #25915 -- Allowed language not in Django's default LANGUAGES
This fixes a regression introduced by a5f6cbce07.
Thanks Gavin Wahl for the report and Tim Graham for the review.
2015-12-18 17:50:16 +01:00
Josh Soref 93452a70e8 Fixed many spelling mistakes in code, comments, and docs. 2015-12-03 12:48:24 -05:00
Claude Paroz fa08d27fb7 Fixed #25677 -- Prevented decoding errors in/after Popen calls
Thanks Gavin Wahl for the report and Tim Graham for the review.
2015-11-19 15:17:47 +01:00
Alexandre Pocquet e7b7f94678 Fixed #25297 -- Allowed makemessages to work with {% trans %} tags that use template filters. 2015-09-04 15:09:09 -04:00
Sergey Kolosov e75882332c Fixed #17375 -- Changed makemessages to use xgettext with --files-from
Changed the way makemessages invokes xgettext from one call per
translatable file to one call per locale directory (using --files-from).
This allows to avoid https://savannah.gnu.org/bugs/index.php?35027 and,
as a positive side effect, speeds up localization build.
2015-08-28 15:41:58 -04:00
Doug Beck b7508896fb Fixed #24257 -- Corrected i18n handling of percent signs.
Refactored tests to use a sample project.

Updated extraction:
* Removed special handling of single percent signs.
* When extracting messages from template text, doubled all percent signs
  so they are not interpreted by gettext as string format flags. All
  strings extracted by gettext, if containing a percent sign, will now
  be labeled "#, python-format".

Updated translation:
* Used "%%" for "%" in template text before calling gettext.
* Updated {% trans %} rendering to restore "%" from "%%".
2015-08-12 10:23:34 -04:00
Matthew Somerville 40f0a84cb1 Fixed #24159 -- Made compilemessages run across all apps.
Updated the command to match the documentation, which states it
runs over all .po files.
2015-06-04 21:02:02 -04:00
Ramiro Morales 6fb9dee470 Fixed #23271 -- Don't corrupt PO files on Windows when updating them.
Make sure PO catalog text fetched from gettext programs via standard
output isn't corrupted by mismatch between assumed (UTF-8) and real
(CP1252) encodings. This can cause mojibake to be written when creating
or updating PO files.

Also fixes #23311.

Thanks to contributor with Trac nick 'danielmenzel' for the report,
excellent research and fix.
2014-12-29 12:24:50 -03:00
Anton Baklanov d63703f1cd Fixed #18714 -- Added 'fuzzy' compilemessages option 2014-11-18 22:44:16 +01:00
Claude Paroz 5ec367ccdd Fixed #23788 -- Used new JavaScript support in recent gettext
JavaScript string extraction support has been added in gettext
0.18.3.
Thanks Aymeric Augustin for the review.
2014-11-11 22:52:30 +01:00
Claude Paroz 8b4cc9df9c Fixed #23583 -- More selectively ignored static/media roots
Fixed a regression introduced by 28efafa24c.
Thanks Michal Čihař for the report and initial patch, and
Collin Anderson and Tim Graham for the reviews.
2014-10-21 20:18:21 +02:00
Justin Hamade 8fe406864c Fixed #22336 -- Added path matching for makemessages ignore option
This fixes a regression introduced by 9012a9e200.
2014-08-08 22:54:30 +02:00
Claude Paroz c5d8e4a0d1 Added forgotten files from commit 28efafa24c 2014-07-16 13:50:53 +02:00
Claude Paroz daaeb84158 Fixed #22773 -- Forced templatize() to return unicode 2014-06-06 08:42:52 +02:00
Claude Paroz 621c5cf4a5 Fixed #21732 -- Made compilemessages complain about non-writable location
Instead of crashing with a CommandError, now a non-writable location
of mo files will only make compilemessages complain and continue.
Thanks Ramiro Morales for the review.
2014-02-18 13:38:06 +01:00
Bouke Haarsma 91c38ce4b2 Fixed 21406 -- Made blocktrans 'trimmed' option preserve line numbers.
Thanks Bouke Haarsma for report, fix and initial patch.
2013-12-04 08:36:20 -03:00
Bouke Haarsma 7a7c789d5a Fixed #5849 -- Strip whitespace from blocktrans
Add the trimmed option to the blocktrans tag to trim any newlines and
whitespace from its content.

This allows the developer to indent the blocktrans tag without adding
new lines and whitespace to the msgid in the PO file.

Thanks to mpessas for the initial patch and Dmitri Fedortchenko for the
report.
2013-11-08 00:52:17 +02:00
Claude Paroz 0336d0d95e Rearranged some i18n tests
Compilation/extraction tests are now properly skipped when gettext
commands are unavailable.
2013-10-28 14:17:48 +01:00
Alex Gaynor 9d740eb8b1 Fix all violators of E231 2013-10-26 12:15:03 -07:00
Tim Graham ae48d77ef8 Fixed E225 pep8 warnings. 2013-10-23 06:09:29 -04:00
Ramiro Morales b5f52647fe Decode from UTF-8 explicitly when reading a text file in makemessages.
This shows itself with Python 3 under Windows where UTF-8 usually isn't
the default file I/O encoding and caused one failure and three errors
in our test suite under that platform setup.
2013-10-22 06:09:21 -03:00
Ramiro Morales a3690168cb Fixed an I18N test class tearDown method. 2013-10-21 01:18:44 -03:00
Ramiro Morales 651bed0918 Made test for issue 19552 compatible with Windows.
Take in account platform path separator. Refs #19552.
2013-10-02 07:29:40 -03:00
Ramiro Morales 0f46ec315e Made skipping of symlink-related makemessages test smarter.
os.symlink() is available starting with Windows Vista but can fail at
runtime.
2013-10-02 07:17:08 -03:00
Ramiro Morales 4b715fc05a Fixed #21209 -- .po file path comments on Windows.
Literals from source files with Django template language syntax don't
have a '.py' suffix anymore.

Also, the '.\' prefix is preserved to respect GNU gettext behavior on
that platform.

Refs #16903.
2013-10-01 20:37:43 -03:00
Ramiro Morales 1559f84d8b Fixed #20311 -- Make sure makemessages doesn't create duplicate Plural-Forms .po file headers.
Thanks naktinis for the report and initial patch.
2013-06-22 18:45:41 -03:00
Claude Paroz 51998dffe7 Removed check for 0.15 version of gettext tools
gettext 0.15 has been released in July 2006.
2013-05-22 18:21:33 +02:00
Baptiste Mispelon 9012a9e200 Fixed #20422 -- Applied makemessage's --ignore patterns to full path
Fix makemessage's --ignore patterns being applied to the full path
instead of the file name. Thanks to nnseva for the report and the
original patch.
2013-05-18 10:40:16 +02:00
Tai Lee 99a6f0e77c Fixed #20354 -- `makemessages` no longer crashes with `UnicodeDecodeError`
Handle the `UnicodeDecodeError` exception, send a warning to `stdout` with the
file name and location, and continue processing other files.
2013-05-07 21:22:05 +02:00
Baptiste Mispelon d5683bd06b Fix #20058: Make compilemessages use stdout instead of stderr. 2013-03-16 19:48:40 +01:00
Ramiro Morales 7fca4416c7 Made (make|compile)messages check for availability of gettext commands.
Refs #19584.
2013-03-10 17:31:11 -03:00
Ramiro Morales a28e2e7c4d Removed a .mo file incorrectly put under Git control. 2013-02-26 22:45:08 -03:00
Ramiro Morales f0bd553922 Simplified compilemessages tests a bit. 2013-02-26 22:30:49 -03:00
Ramiro Morales dfa9324966 Don't use os.system() in compilemessages.
Fixes #19584.

This implies stop storing file path command line arguments in envvars as
a security measure to start relying on with Popen's shell=False instead,
and addition of an 'utils' module.

Thanks kmichel_wgs for the report.
2013-02-26 21:31:53 -03:00
Florian Apolloner 89f40e3624 Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00