Fixed Localization in the Admin UI Settings forms
Review Request #8639 — Created Jan. 20, 2017 and submitted
The forms in reviewboard.admin.forms use ugettext (as _(...)) for the form fields, which means they're not localized at page render time. To fix this, I updated the _ alias to be for ugettext_lazy instead of ugettext and imported ugettext.
I compared translations in the webpage with django's translation log (reviewboard/locale/it_IT/LC_MESSAGES/django.po:msgstr), and ensured translations from the log are also visible in the webpage.
Description | From | Last Updated |
---|---|---|
Make sure the description and testing text wraps to ideally <= 70 characters (a standard line length for Git commits), … |
chipx86 | |
This is happening within a method (not the top-level class), so we should make it use the regular ugettext(). |
david | |
Should use ugettext(). |
david | |
Should use ugettext(). |
david | |
Should use ugettext(). |
david | |
Should use ugettext(). |
david | |
Should use ugettext(). |
david | |
Should use ugettext(). |
david | |
Should use ugettext(). |
david | |
Should use ugettext(). |
david | |
Col: 44 W292 no newline at end of file |
reviewbot | |
Col: 55 W292 no newline at end of file |
reviewbot | |
Can you remove this blank line? (so the function definition is adjacent to the property set) |
david | |
There's no ugettext import. The code as up for review cannot work. Make sure you test every code path! |
chipx86 | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
Make sure text is aligned properly. |
chipx86 | |
Col: 80 E501 line too long (86 > 79 characters) |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
undefined name 'ugettext' |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Make sure text is aligned properly. |
chipx86 | |
Col: 44 W292 no newline at end of file |
reviewbot | |
django is a third-party module, so it should be in its own import group, above reviewboard, separated by a blank … |
chipx86 | |
Strings should ideally be single quotes. Can you fix up the old one as well? |
chipx86 | |
Col: 55 W292 no newline at end of file |
reviewbot | |
Strings should ideally be single quotes. |
chipx86 | |
Strings should ideally be single quotes. |
chipx86 | |
Col: 25 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 19 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 19 E128 continuation line under-indented for visual indent |
reviewbot | |
There shouldn't be a blank line here (both "django" and "djblets" are "3rd party libraries" from the perspective of the … |
david | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
It was already like this, but can you fix this string to only end in a single period? |
david | |
Please undo this line addition. |
david |
- Change Summary:
-
"Replaced _() with ugettext() in forms.py methods and removed blank line."
- Testing Done:
-
- Compared translations in the webpage with django's translation log (reviewboard/locale/it_IT/LC_MESSAGES/django.po:msgstr)
- Ensured translations from the log are also visible in the webpage.
+ - "Replaced _() with ugettext() in forms.py methods and removed blank line."
- Commit:
-
30e9d58b4ba3592ec2fe223bafab9cb2f525bfaac5d63b15f5ddbe3796e1459a2b6bb84475f48349
- Diff:
-
Revision 2 (+53 -18)
-
Tool: Pyflakes Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bugs:
-
-
Make sure the description and testing text wraps to ideally <= 70 characters (a standard line length for Git commits), as this will be used for the Git commit.
The description should also tell a story about your change, rather than being effectively a bullet point list of the changes made. See https://www.notion.so/reviewboard/Writing-Good-Change-Descriptions-10529e7c207743fa8ca90153d4b21fea for information on requirements and examples.
-
There's no
ugettext
import. The code as up for review cannot work. Make sure you test every code path! -
-
-
django
is a third-party module, so it should be in its own import group, abovereviewboard
, separated by a blank line. -
-
-
- Description:
-
~ Replaced django.utils.translation's ugettext module with ugettext_lazy in admin forms.py.
~ The forms in reviewboard.admin.forms use ugettext (as _(...)) for the form fields, which means they're not localized at page render time. To fix this, I updated the _ alias to be for ugettext_lazy instead of ugettext and imported ugettext.
- Added attributes verbose_name and verbose_name_plural in class Meta for each non-base .py file in reviews/models. - Testing Done:
-
~ - Compared translations in the webpage with django's translation log (reviewboard/locale/it_IT/LC_MESSAGES/django.po:msgstr)
~ I compared translations in the webpage with django's translation log (reviewboard/locale/it_IT/LC_MESSAGES/django.po:msgstr), and ensured translations from the log are also visible in the webpage.
- - Ensured translations from the log are also visible in the webpage.
- - "Replaced _() with ugettext() in forms.py methods and removed blank line."
- Commit:
-
c5d63b15f5ddbe3796e1459a2b6bb84475f483493be18ab7a5ea0d6915b7e651327414320aa1dc46
- Diff:
-
Revision 3 (+61 -22)
-
Tool: Pyflakes Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py
-
-
-
- Commit:
-
3be18ab7a5ea0d6915b7e651327414320aa1dc46dc601ff3aad4c518bbb3ec5be0994d1f45641305
- Diff:
-
Revision 4 (+61 -22)
-
Tool: Pyflakes Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py
-
- Commit:
-
dc601ff3aad4c518bbb3ec5be0994d1f456413050e908a7dcd3d38f24a99ed418effb8fa39ef5805
- Diff:
-
Revision 5 (+62 -22)
-
Tool: Pyflakes Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py
- Commit:
-
0e908a7dcd3d38f24a99ed418effb8fa39ef580560573e8eac9bf187702fee85c0a6e7ae8b2638a3
- Diff:
-
Revision 6 (+60 -22)
-
Tool: Pyflakes Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py Tool: PEP8 Style Checker Processed Files: reviewboard/admin/forms.py reviewboard/reviews/models/screenshot.py reviewboard/reviews/models/review_request_draft.py reviewboard/scmtools/models.py reviewboard/scmtools/admin.py reviewboard/reviews/models/file_attachment_comment.py reviewboard/reviews/models/group.py reviewboard/reviews/models/diff_comment.py reviewboard/reviews/models/review_request.py reviewboard/reviews/models/status_update.py reviewboard/reviews/models/default_reviewer.py reviewboard/reviews/models/general_comment.py reviewboard/reviews/models/screenshot_comment.py reviewboard/reviews/models/review.py