#16903 closed New feature (fixed)
Add '--no-location' option for 'makemessages' command
| Reported by: | Alpár Jüttner | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | 1.3 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | yes |
| Needs tests: | yes | Patch needs improvement: | yes |
| Easy pickings: | yes | UI/UX: | no |
Description
The attached patch adds a --no-location option for the makemessages management command. It is against svn trunk revision -r16861. Please consider adding it to the svn repo.
Rational: Location comments in the .po files can are very annoying when they are version controlled, because changes in the source codes will trigger a lot of changes in the .po files, even when the strings to be translated are not affected. The obvious remedy for this is using --no-location.
Attachments (3)
Change History (14)
by , 14 years ago
| Attachment: | no-location.patch added |
|---|
follow-up: 4 comment:1 by , 14 years ago
| Needs tests: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
follow-up: 3 comment:2 by , 14 years ago
A novice question. Assume I have a sole checkout of django svn trunk. What is the easiest way to run its tests? (All of them, or just a specific one, such as NoWrapExtractorTests).
comment:3 by , 14 years ago
The fastest way to run all the tests is:
% cd tests % PYTHONPATH=.. python runtests.py --settings=test_sqlite
That will take some time, because there are more than 4000 tests. You can find more details — in particular, how to run a subset of the tests — in the contributing guide: https://docs.djangoproject.com/en/1.3/internals/contributing/#running-the-unit-tests
follow-up: 5 comment:4 by , 14 years ago
Replying to aaugustin:
It would be nice to add a test in tests/regressiontests/i18n/commands.
The newly attached patch also performs some basic tests. Let me know if this is sufficient or not.
(Thanks for the help on testing.)
comment:5 by , 14 years ago
Is there anything to do for me in order to get this patch merged into the svn version?
comment:6 by , 14 years ago
| Needs documentation: | set |
|---|---|
| Patch needs improvement: | set |
The patch and tests look good. One note though: the tests currently can be running until you import NoLocationExtractorTests in regressiontests.i18n.tests.py under the if can_run_extraction_tests condition. Could you also update the test method names to test_location_enabled() and test_location_disabled().
Finally, some documentation should be added for this new option: https://docs.djangoproject.com/en/dev/ref/django-admin/#makemessages
Thanks for the great work!
comment:7 by , 14 years ago
Please find the revised patch attached.
Changes compared to the previous version:
- Doc added to
docs/ref/django-admin.txt - Import
NoLocationExtractorTestsfromtests/regressiontests/i18n/tests.py - Change the test function names to the suggested ones.
It would be nice to add a test in tests/regressiontests/i18n/commands.