prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Missing translation for 'This field is required' across all languages
  # Bug
  
  ## Description
  
  When navigating to `/login` and pressing submit on an empty, the default (English) error message string is displayed.
  
  ## Steps to Reproduce
  
  1. Click on the localized equivalent of 'Check for a response`
  2. Click submit (while leaving an empty string)
  3. Observe the error message.
  
  ## Expected Behavior
  The error message should be displayed in the localized language.
  
  ## Actual Behavior
  
  The message is displayed in English.
  
  </issue>
  <code>
  [start of securedrop/source_app/forms.py]
  1 from flask_babel import gettext
  2 from flask_wtf import FlaskForm
  3 from wtforms import PasswordField
  4 from wtforms.validators import InputRequired, Regexp, Length
  5 
  6 from db import Source
  7 
  8 
  9 class LoginForm(FlaskForm):
  10     codename = PasswordField('codename', validators=[
  11         InputRequired(message=gettext('This field is required.')),
  12         Length(1, Source.MAX_CODENAME_LEN,
  13                message=gettext('Field must be between 1 and '
  14                                '{max_codename_len} characters long.'.format(
  15                                    max_codename_len=Source.MAX_CODENAME_LEN))),
  16         # Make sure to allow dashes since some words in the wordlist have them
  17         Regexp(r'[\sA-Za-z0-9-]+$', message=gettext('Invalid input.'))
  18     ])
  19
  [end of securedrop/source_app/forms.py]
  [start of securedrop/journalist_app/forms.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 from flask_babel import gettext
  4 from flask_wtf import FlaskForm
  5 from wtforms import (TextAreaField, TextField, BooleanField, HiddenField,
  6                      ValidationError)
  7 from wtforms.validators import InputRequired, Optional
  8 
  9 from db import Journalist
  10 
  11 
  12 def otp_secret_validation(form, field):
  13     strip_whitespace = field.data.replace(' ', '')
  14     if len(strip_whitespace) != 40:
  15         raise ValidationError(gettext('Field must be 40 characters long but '
  16                                       'got {num_chars}.'.format(
  17                                           num_chars=len(strip_whitespace)
  18                                       )))
  19 
  20 
  21 def minimum_length_validation(form, field):
  22     if len(field.data) < Journalist.MIN_USERNAME_LEN:
  23         raise ValidationError(
  24             gettext('Field must be at least {min_chars} '
  25                     'characters long but only got '
  26                     '{num_chars}.'.format(
  27                         min_chars=Journalist.MIN_USERNAME_LEN,
  28                         num_chars=len(field.data))))
  29 
  30 
  31 class NewUserForm(FlaskForm):
  32     username = TextField('username', validators=[
  33         InputRequired(message=gettext('This field is required.')),
  34         minimum_length_validation
  35     ])
  36     password = HiddenField('password')
  37     is_admin = BooleanField('is_admin')
  38     is_hotp = BooleanField('is_hotp')
  39     otp_secret = TextField('otp_secret', validators=[
  40         otp_secret_validation,
  41         Optional()
  42     ])
  43 
  44 
  45 class ReplyForm(FlaskForm):
  46     message = TextAreaField(
  47         u'Message',
  48         id="content-area",
  49         validators=[
  50             InputRequired(message=gettext('You cannot send an empty reply.')),
  51         ],
  52     )
  53
  [end of securedrop/journalist_app/forms.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/securedrop/journalist_app/forms.py b/securedrop/journalist_app/forms.py
  --- a/securedrop/journalist_app/forms.py
  +++ b/securedrop/journalist_app/forms.py
  @@ -1,6 +1,6 @@
   # -*- coding: utf-8 -*-
   
  -from flask_babel import gettext
  +from flask_babel import lazy_gettext
   from flask_wtf import FlaskForm
   from wtforms import (TextAreaField, TextField, BooleanField, HiddenField,
                        ValidationError)
  @@ -12,25 +12,26 @@
   def otp_secret_validation(form, field):
       strip_whitespace = field.data.replace(' ', '')
       if len(strip_whitespace) != 40:
  -        raise ValidationError(gettext('Field must be 40 characters long but '
  -                                      'got {num_chars}.'.format(
  -                                          num_chars=len(strip_whitespace)
  -                                      )))
  +        raise ValidationError(lazy_gettext(
  +            'Field must be 40 characters long but '
  +            'got {num_chars}.'.format(
  +                num_chars=len(strip_whitespace)
  +            )))
   
   
   def minimum_length_validation(form, field):
       if len(field.data) < Journalist.MIN_USERNAME_LEN:
           raise ValidationError(
  -            gettext('Field must be at least {min_chars} '
  -                    'characters long but only got '
  -                    '{num_chars}.'.format(
  -                        min_chars=Journalist.MIN_USERNAME_LEN,
  -                        num_chars=len(field.data))))
  +            lazy_gettext('Field must be at least {min_chars} '
  +                         'characters long but only got '
  +                         '{num_chars}.'.format(
  +                             min_chars=Journalist.MIN_USERNAME_LEN,
  +                             num_chars=len(field.data))))
   
   
   class NewUserForm(FlaskForm):
       username = TextField('username', validators=[
  -        InputRequired(message=gettext('This field is required.')),
  +        InputRequired(message=lazy_gettext('This field is required.')),
           minimum_length_validation
       ])
       password = HiddenField('password')
  @@ -47,6 +48,7 @@
           u'Message',
           id="content-area",
           validators=[
  -            InputRequired(message=gettext('You cannot send an empty reply.')),
  +            InputRequired(message=lazy_gettext(
  +                'You cannot send an empty reply.')),
           ],
       )
  diff --git a/securedrop/source_app/forms.py b/securedrop/source_app/forms.py
  --- a/securedrop/source_app/forms.py
  +++ b/securedrop/source_app/forms.py
  @@ -1,4 +1,4 @@
  -from flask_babel import gettext
  +from flask_babel import lazy_gettext
   from flask_wtf import FlaskForm
   from wtforms import PasswordField
   from wtforms.validators import InputRequired, Regexp, Length
  @@ -8,11 +8,12 @@
   
   class LoginForm(FlaskForm):
       codename = PasswordField('codename', validators=[
  -        InputRequired(message=gettext('This field is required.')),
  +        InputRequired(message=lazy_gettext('This field is required.')),
           Length(1, Source.MAX_CODENAME_LEN,
  -               message=gettext('Field must be between 1 and '
  -                               '{max_codename_len} characters long.'.format(
  -                                   max_codename_len=Source.MAX_CODENAME_LEN))),
  +               message=lazy_gettext(
  +                   'Field must be between 1 and '
  +                   '{max_codename_len} characters long.'.format(
  +                       max_codename_len=Source.MAX_CODENAME_LEN))),
           # Make sure to allow dashes since some words in the wordlist have them
  -        Regexp(r'[\sA-Za-z0-9-]+$', message=gettext('Invalid input.'))
  +        Regexp(r'[\sA-Za-z0-9-]+$', message=lazy_gettext('Invalid input.'))
       ])
  
verification_info: {"golden_diff": "diff --git a/securedrop/journalist_app/forms.py b/securedrop/journalist_app/forms.py\n--- a/securedrop/journalist_app/forms.py\n+++ b/securedrop/journalist_app/forms.py\n@@ -1,6 +1,6 @@\n # -*- coding: utf-8 -*-\n \n-from flask_babel import gettext\n+from flask_babel import lazy_gettext\n from flask_wtf import FlaskForm\n from wtforms import (TextAreaField, TextField, BooleanField, HiddenField,\n                      ValidationError)\n@@ -12,25 +12,26 @@\n def otp_secret_validation(form, field):\n     strip_whitespace = field.data.replace(' ', '')\n     if len(strip_whitespace) != 40:\n-        raise ValidationError(gettext('Field must be 40 characters long but '\n-                                      'got {num_chars}.'.format(\n-                                          num_chars=len(strip_whitespace)\n-                                      )))\n+        raise ValidationError(lazy_gettext(\n+            'Field must be 40 characters long but '\n+            'got {num_chars}.'.format(\n+                num_chars=len(strip_whitespace)\n+            )))\n \n \n def minimum_length_validation(form, field):\n     if len(field.data) < Journalist.MIN_USERNAME_LEN:\n         raise ValidationError(\n-            gettext('Field must be at least {min_chars} '\n-                    'characters long but only got '\n-                    '{num_chars}.'.format(\n-                        min_chars=Journalist.MIN_USERNAME_LEN,\n-                        num_chars=len(field.data))))\n+            lazy_gettext('Field must be at least {min_chars} '\n+                         'characters long but only got '\n+                         '{num_chars}.'.format(\n+                             min_chars=Journalist.MIN_USERNAME_LEN,\n+                             num_chars=len(field.data))))\n \n \n class NewUserForm(FlaskForm):\n     username = TextField('username', validators=[\n-        InputRequired(message=gettext('This field is required.')),\n+        InputRequired(message=lazy_gettext('This field is required.')),\n         minimum_length_validation\n     ])\n     password = HiddenField('password')\n@@ -47,6 +48,7 @@\n         u'Message',\n         id=\"content-area\",\n         validators=[\n-            InputRequired(message=gettext('You cannot send an empty reply.')),\n+            InputRequired(message=lazy_gettext(\n+                'You cannot send an empty reply.')),\n         ],\n     )\ndiff --git a/securedrop/source_app/forms.py b/securedrop/source_app/forms.py\n--- a/securedrop/source_app/forms.py\n+++ b/securedrop/source_app/forms.py\n@@ -1,4 +1,4 @@\n-from flask_babel import gettext\n+from flask_babel import lazy_gettext\n from flask_wtf import FlaskForm\n from wtforms import PasswordField\n from wtforms.validators import InputRequired, Regexp, Length\n@@ -8,11 +8,12 @@\n \n class LoginForm(FlaskForm):\n     codename = PasswordField('codename', validators=[\n-        InputRequired(message=gettext('This field is required.')),\n+        InputRequired(message=lazy_gettext('This field is required.')),\n         Length(1, Source.MAX_CODENAME_LEN,\n-               message=gettext('Field must be between 1 and '\n-                               '{max_codename_len} characters long.'.format(\n-                                   max_codename_len=Source.MAX_CODENAME_LEN))),\n+               message=lazy_gettext(\n+                   'Field must be between 1 and '\n+                   '{max_codename_len} characters long.'.format(\n+                       max_codename_len=Source.MAX_CODENAME_LEN))),\n         # Make sure to allow dashes since some words in the wordlist have them\n-        Regexp(r'[\\sA-Za-z0-9-]+$', message=gettext('Invalid input.'))\n+        Regexp(r'[\\sA-Za-z0-9-]+$', message=lazy_gettext('Invalid input.'))\n     ])\n", "issue": "Missing translation for 'This field is required' across all languages\n# Bug\r\n\r\n## Description\r\n\r\nWhen navigating to `/login` and pressing submit on an empty, the default (English) error message string is displayed.\r\n\r\n## Steps to Reproduce\r\n\r\n1. Click on the localized equivalent of 'Check for a response`\r\n2. Click submit (while leaving an empty string)\r\n3. Observe the error message.\r\n\r\n## Expected Behavior\r\nThe error message should be displayed in the localized language.\r\n\r\n## Actual Behavior\r\n\r\nThe message is displayed in English.\n", "before_files": [{"content": "from flask_babel import gettext\nfrom flask_wtf import FlaskForm\nfrom wtforms import PasswordField\nfrom wtforms.validators import InputRequired, Regexp, Length\n\nfrom db import Source\n\n\nclass LoginForm(FlaskForm):\n    codename = PasswordField('codename', validators=[\n        InputRequired(message=gettext('This field is required.')),\n        Length(1, Source.MAX_CODENAME_LEN,\n               message=gettext('Field must be between 1 and '\n                               '{max_codename_len} characters long.'.format(\n                                   max_codename_len=Source.MAX_CODENAME_LEN))),\n        # Make sure to allow dashes since some words in the wordlist have them\n        Regexp(r'[\\sA-Za-z0-9-]+$', message=gettext('Invalid input.'))\n    ])\n", "path": "securedrop/source_app/forms.py"}, {"content": "# -*- coding: utf-8 -*-\n\nfrom flask_babel import gettext\nfrom flask_wtf import FlaskForm\nfrom wtforms import (TextAreaField, TextField, BooleanField, HiddenField,\n                     ValidationError)\nfrom wtforms.validators import InputRequired, Optional\n\nfrom db import Journalist\n\n\ndef otp_secret_validation(form, field):\n    strip_whitespace = field.data.replace(' ', '')\n    if len(strip_whitespace) != 40:\n        raise ValidationError(gettext('Field must be 40 characters long but '\n                                      'got {num_chars}.'.format(\n                                          num_chars=len(strip_whitespace)\n                                      )))\n\n\ndef minimum_length_validation(form, field):\n    if len(field.data) < Journalist.MIN_USERNAME_LEN:\n        raise ValidationError(\n            gettext('Field must be at least {min_chars} '\n                    'characters long but only got '\n                    '{num_chars}.'.format(\n                        min_chars=Journalist.MIN_USERNAME_LEN,\n                        num_chars=len(field.data))))\n\n\nclass NewUserForm(FlaskForm):\n    username = TextField('username', validators=[\n        InputRequired(message=gettext('This field is required.')),\n        minimum_length_validation\n    ])\n    password = HiddenField('password')\n    is_admin = BooleanField('is_admin')\n    is_hotp = BooleanField('is_hotp')\n    otp_secret = TextField('otp_secret', validators=[\n        otp_secret_validation,\n        Optional()\n    ])\n\n\nclass ReplyForm(FlaskForm):\n    message = TextAreaField(\n        u'Message',\n        id=\"content-area\",\n        validators=[\n            InputRequired(message=gettext('You cannot send an empty reply.')),\n        ],\n    )\n", "path": "securedrop/journalist_app/forms.py"}]}