Skip to content

Commit

Permalink
Add html as format for libretranslate
Browse files Browse the repository at this point in the history
  • Loading branch information
Hafnernuss authored and zerolab committed Jun 13, 2024
1 parent d5ade2a commit 2c4ea31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions wagtail_localize/machine_translators/libretranslate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def translate(self, source_locale, target_locale, strings):
"source": self.language_code(source_locale.language_code),
"target": self.language_code(target_locale.language_code),
"api_key": self.options["API_KEY"],
"format": "html",
}
),
headers={"Content-Type": "application/json"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_translate_text(self, mock_post):
"source": "en",
"target": "fr",
"api_key": LIBRETRANSLATE_SETTINGS_ENDPOINT["OPTIONS"]["API_KEY"],
"format": "html",
}
),
headers={"Content-Type": "application/json"},
Expand Down Expand Up @@ -139,6 +140,7 @@ def test_translate_html(self, mock_post):
"source": "en",
"target": "fr",
"api_key": LIBRETRANSLATE_SETTINGS_ENDPOINT["OPTIONS"]["API_KEY"],
"format": "html",
}
),
headers={"Content-Type": "application/json"},
Expand Down

0 comments on commit 2c4ea31

Please sign in to comment.