We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
GetText check fails incorrectly on newline
https://pontoon.mozilla.org/en-GB/all-projects/all-resources/?string=286055

If you copy the source string, an extra line is added at the back, and that fails the checks for GetText.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pontoon/translations/forms.py`
Content:
```
1 from django import forms
2 from django.contrib.postgres.forms import SimpleArrayField
3 
4 from pontoon.base.models import (
5     Entity,
6     Locale,
7 )
8 
9 
10 class CreateTranslationForm(forms.Form):
11     """
12     Form for parameters to the `entities` view.
13     """
14 
15     entity = forms.IntegerField()
16     locale = forms.CharField()
17     plural_form = forms.CharField()
18 
19     # Some file formats allow empty original strings and translations.
20     # We must allow both here. Validation is handled in pontoon.checks module.
21     original = forms.CharField(required=False)
22     translation = forms.CharField(required=False)
23 
24     ignore_warnings = forms.BooleanField(required=False)
25     approve = forms.BooleanField(required=False)
26     force_suggestions = forms.BooleanField(required=False)
27     paths = forms.MultipleChoiceField(required=False)
28     machinery_sources = SimpleArrayField(forms.CharField(max_length=30), required=False)
29 
30     def clean_paths(self):
31         try:
32             return self.data.getlist("paths[]")
33         except AttributeError:
34             # If the data source is not a QueryDict, it won't have a `getlist` method.
35             return self.data.get("paths[]") or []
36 
37     def clean_entity(self):
38         try:
39             return Entity.objects.get(pk=self.cleaned_data["entity"])
40         except Entity.DoesNotExist:
41             raise forms.ValidationError(f"Entity `{self.entity}` could not be found")
42 
43     def clean_locale(self):
44         try:
45             return Locale.objects.get(code=self.cleaned_data["locale"])
46         except Locale.DoesNotExist:
47             raise forms.ValidationError(f"Locale `{self.entity}` could not be found")
48 
49     def clean_plural_form(self):
50         if self.cleaned_data["plural_form"] == "-1":
51             return None
52         return self.cleaned_data["plural_form"]
53 
54     def clean_translation(self):
55         return self.data.get("translation", "")
56
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pontoon/translations/forms.py b/pontoon/translations/forms.py
--- a/pontoon/translations/forms.py
+++ b/pontoon/translations/forms.py
@@ -51,5 +51,8 @@
             return None
         return self.cleaned_data["plural_form"]
 
+    def clean_original(self):
+        return self.data.get("original", "")
+
     def clean_translation(self):
         return self.data.get("translation", "")

{"golden_diff": "diff --git a/pontoon/translations/forms.py b/pontoon/translations/forms.py\n--- a/pontoon/translations/forms.py\n+++ b/pontoon/translations/forms.py\n@@ -51,5 +51,8 @@\n             return None\n         return self.cleaned_data[\"plural_form\"]\n \n+    def clean_original(self):\n+        return self.data.get(\"original\", \"\")\n+\n     def clean_translation(self):\n         return self.data.get(\"translation\", \"\")\n", "issue": "GetText check fails incorrectly on newline\nhttps://pontoon.mozilla.org/en-GB/all-projects/all-resources/?string=286055\r\n\r\nIf you copy the source string, an extra line is added at the back, and that fails the checks for GetText.\n", "before_files": [{"content": "from django import forms\nfrom django.contrib.postgres.forms import SimpleArrayField\n\nfrom pontoon.base.models import (\n    Entity,\n    Locale,\n)\n\n\nclass CreateTranslationForm(forms.Form):\n    \"\"\"\n    Form for parameters to the `entities` view.\n    \"\"\"\n\n    entity = forms.IntegerField()\n    locale = forms.CharField()\n    plural_form = forms.CharField()\n\n    # Some file formats allow empty original strings and translations.\n    # We must allow both here. Validation is handled in pontoon.checks module.\n    original = forms.CharField(required=False)\n    translation = forms.CharField(required=False)\n\n    ignore_warnings = forms.BooleanField(required=False)\n    approve = forms.BooleanField(required=False)\n    force_suggestions = forms.BooleanField(required=False)\n    paths = forms.MultipleChoiceField(required=False)\n    machinery_sources = SimpleArrayField(forms.CharField(max_length=30), required=False)\n\n    def clean_paths(self):\n        try:\n            return self.data.getlist(\"paths[]\")\n        except AttributeError:\n            # If the data source is not a QueryDict, it won't have a `getlist` method.\n            return self.data.get(\"paths[]\") or []\n\n    def clean_entity(self):\n        try:\n            return Entity.objects.get(pk=self.cleaned_data[\"entity\"])\n        except Entity.DoesNotExist:\n            raise forms.ValidationError(f\"Entity `{self.entity}` could not be found\")\n\n    def clean_locale(self):\n        try:\n            return Locale.objects.get(code=self.cleaned_data[\"locale\"])\n        except Locale.DoesNotExist:\n            raise forms.ValidationError(f\"Locale `{self.entity}` could not be found\")\n\n    def clean_plural_form(self):\n        if self.cleaned_data[\"plural_form\"] == \"-1\":\n            return None\n        return self.cleaned_data[\"plural_form\"]\n\n    def clean_translation(self):\n        return self.data.get(\"translation\", \"\")\n", "path": "pontoon/translations/forms.py"}], "after_files": [{"content": "from django import forms\nfrom django.contrib.postgres.forms import SimpleArrayField\n\nfrom pontoon.base.models import (\n    Entity,\n    Locale,\n)\n\n\nclass CreateTranslationForm(forms.Form):\n    \"\"\"\n    Form for parameters to the `entities` view.\n    \"\"\"\n\n    entity = forms.IntegerField()\n    locale = forms.CharField()\n    plural_form = forms.CharField()\n\n    # Some file formats allow empty original strings and translations.\n    # We must allow both here. Validation is handled in pontoon.checks module.\n    original = forms.CharField(required=False)\n    translation = forms.CharField(required=False)\n\n    ignore_warnings = forms.BooleanField(required=False)\n    approve = forms.BooleanField(required=False)\n    force_suggestions = forms.BooleanField(required=False)\n    paths = forms.MultipleChoiceField(required=False)\n    machinery_sources = SimpleArrayField(forms.CharField(max_length=30), required=False)\n\n    def clean_paths(self):\n        try:\n            return self.data.getlist(\"paths[]\")\n        except AttributeError:\n            # If the data source is not a QueryDict, it won't have a `getlist` method.\n            return self.data.get(\"paths[]\") or []\n\n    def clean_entity(self):\n        try:\n            return Entity.objects.get(pk=self.cleaned_data[\"entity\"])\n        except Entity.DoesNotExist:\n            raise forms.ValidationError(f\"Entity `{self.entity}` could not be found\")\n\n    def clean_locale(self):\n        try:\n            return Locale.objects.get(code=self.cleaned_data[\"locale\"])\n        except Locale.DoesNotExist:\n            raise forms.ValidationError(f\"Locale `{self.entity}` could not be found\")\n\n    def clean_plural_form(self):\n        if self.cleaned_data[\"plural_form\"] == \"-1\":\n            return None\n        return self.cleaned_data[\"plural_form\"]\n\n    def clean_original(self):\n        return self.data.get(\"original\", \"\")\n\n    def clean_translation(self):\n        return self.data.get(\"translation\", \"\")\n", "path": "pontoon/translations/forms.py"}]}