prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  localization: various problems
  # Bug
  
  ## Description
  
  This issue is to collect the various localization problems found before the 0.4.4 release and after the **string freeze**
  
  They should be fixed in a pull request right after the 0.4.4 release.
  
  </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]
  </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/source_app/forms.py b/securedrop/source_app/forms.py
  --- a/securedrop/source_app/forms.py
  +++ b/securedrop/source_app/forms.py
  @@ -11,7 +11,7 @@
           InputRequired(message=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} 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.'))
  
verification_info: {"golden_diff": "diff --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@@ -11,7 +11,7 @@\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} 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", "issue": "localization: various problems\n# Bug\r\n\r\n## Description\r\n\r\nThis issue is to collect the various localization problems found before the 0.4.4 release and after the **string freeze**\r\n\r\nThey should be fixed in a pull request right after the 0.4.4 release.\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"}]}