Skip to content

Commit

Permalink
Fix Google Translate request not using html
Browse files Browse the repository at this point in the history
Fixed Google translate request 'mimeType' which was set to 'text/plain', but needs to be 'text/html' to be able to use tags such as 'notranslate'.
  • Loading branch information
ThioJoe committed Jan 27, 2023
1 parent 42df19a commit 053674a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def translate_dictionary(inputSubsDict, langDict, skipTranslation=False):
'contents': chunk,
'sourceLanguageCode': originalLanguage,
'targetLanguageCode': targetLanguage,
'mimeType': 'text/plain',
'mimeType': 'text/html',
#'model': 'nmt',
#'glossaryConfig': {}
}
Expand Down Expand Up @@ -194,7 +194,7 @@ def translate_dictionary(inputSubsDict, langDict, skipTranslation=False):
'contents':textToTranslate,
'sourceLanguageCode': originalLanguage,
'targetLanguageCode': targetLanguage,
'mimeType': 'text/plain',
'mimeType': 'text/html',
#'model': 'nmt',
#'glossaryConfig': {}
}
Expand Down

0 comments on commit 053674a

Please sign in to comment.