Remove all localizations from rbext.

Review Request #11425 — Created Feb. 1, 2021 and submitted

Information

Review Board
release-4.0.x

Reviewers

Django's localization support expects to be run within the context of an
HTTP request. Middleware activates a locale based on the headers sent by
the browser. Activation also requires that the app registry is fully
activated, which in turns requires settings to be populated. As none of
that is safe for extension testing, we need to disable localization at
the command level.

This change removes all the localization support in rbext, ensuring
nothing is trying to activate at command parsing or execution time. This
solves the inability to get help output, which was a problem when we
upgraded to Django 1.11.

Ideally, we'll revisit this down the road and more carefully activate
localization, avoiding the Django requirements (which is doable), but
the work required is non-trivial.

It's also worth noting that Django's own management commands explicitly
disable localization as well by default, and avoid localizing any
strings involved in command initialization or argument parsing.

Ran rbext --help, both as-is and for each subcommand. Verified that
the output was correct, and that I could execute the commands successfully.

Summary ID
Remove all localizations from rbext.
Django's localization support expects to be run within the context of an HTTP request. Middleware activates a locale based on the headers sent by the browser. Activation also requires that the app registry is fully activated, which in turns requires settings to be populated. As none of that is safe for extension testing, we need to disable localization at the command level. This change removes all the localization support in rbext, ensuring nothing is trying to activate at command parsing or execution time. Ideally, we'll revisit this down the road and more carefully activate localization, avoiding the Django requirements (which is doable), but the work required is non-trivial. It's also worth noting that Django's own management commands explicitly disable localization as well by default, and avoid localizing any strings involved in command initialization or argument parsing.
b195e2fd3f51fe16dde8dfd1a44b872748e0b2f1
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (c9f3c4f)