Skip to content

Commit 3e27035

Browse files
authored
Merge pull request #30 from quicktranslate-module/master-3.x
Master 3.x
2 parents d27f4af + 0e0ced9 commit 3e27035

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/QuickTranslateBundle/Resources/public/js/utilities/createDeeplApiUrl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function createDeeplApiUrl(key, type, data, langFrom = null, langTo, autoDetect
5353
if(glossaryId) {
5454
glossaryPart = '&glossary_id=' + glossaryId;
5555
}
56+
data = encodeURIComponent(data)
5657

5758
if (autoDetect) {
5859
return url + '/v2/translate?auth_key=' + key + '&text=' + data + '&target_lang=' + langTo + '&split_sentences=nonewlines&tag_handling=xml' + glossaryPart;

src/QuickTranslateBundle/Resources/public/js/utilities/xmlRegReplace.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,5 @@ function xmlRegReplace(xml, replaceBack = false) {
1919
return xml.replace(/\s\s+/g, "")
2020
.replace(/\r?\n|\r/g, " ")
2121
.replace(/ /g, " ")
22-
.replace(/<br( \/)?>/g, "(br)")
23-
.replace(/&amp;/g, "%26")
24-
.replace(/&/g, "%26")
25-
.replace(/#/g, "(HaShTaG)");
22+
.replace(/<br( \/)?>/g, "(br)");
2623
};

0 commit comments

Comments
 (0)