Skip to content

Commit

Permalink
fix splitting of en locale codes according to DeepL requierements
Browse files Browse the repository at this point in the history
  • Loading branch information
cgeomar committed Nov 7, 2023
1 parent e1051b0 commit 5a78a67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wagtail_localize/machine_translators/deepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


def language_code(code, is_target=False):
# DeepL supports targeting Brazillian Portuguese but doesn't have this for other languages
if is_target and code in ["pt-pt", "pt-br"]:
# DeepL supports targeting Brazillian Portuguese and requieres to specifically request American or British English.
if is_target and code in ["pt-pt", "pt-br", "en-us", "en-gb"]:
return code

return code.split("-")[0].upper()
Expand Down

0 comments on commit 5a78a67

Please sign in to comment.