4512: Localization is incorrect in the Admin UI Settings forms

chipx86
rkdhatt

What version are you running?

2.0+

What's the URL of the page containing the problem?

/admin/settings/*

What is the problem?

The forms in reviewboard.admin.forms use ugettext (as _(...)) for the form fields, which means they're localized at application initialization time rather than at page render time. They should be using ugettext_lazy as _(...).

The code inside of functions that use ugettext should continue to do so, since those happen at render time.

So:

  1. We should update the _ alias to be for ugettext_lazy instead of ugettext, for anything used as members of the forms.
  2. We should import ugettext and call that specifically for anything happening within a function.
chipx86
#1 chipx86
  • -New
    +Confirmed
  • +Release-2.0.x
    +Release-2.5.x
    +Release-3.0
  • +Component:Admin
    +EasyFix
brennie
#2 brennie
  • +rkdhatt
brennie
#3 brennie

This has been fixed on Review Board 2.0 (as 72483dbdd36fac52641b4be599e9ddc859145b6b), 2.5 (as 7b16789649d0413305117078a9602df2637b433e), and 3.0 (as f1eb7d66d1b172cc149d932409604084c14d27c4).

  • -Confirmed
    +Fixed