-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
90 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# deepl_translate() errors well | ||
|
||
Code | ||
deepl_translate("non-existing-file") | ||
Condition | ||
Error in `deepl_translate()`: | ||
! Can't find path "non-existing-file". | ||
|
||
--- | ||
|
||
Code | ||
deepl_translate(file, glossary_name = "non-existing-glossary", source_lang = "en", | ||
target_lang = "es") | ||
Condition | ||
Error in `deepl_translate()`: | ||
! Can't find glossary_name "non-existing-glossary". | ||
i Check the spelling, or create it with `upsert_glossary()`. | ||
|
||
--- | ||
|
||
Code | ||
deepl_translate(file, formality = "non-existing-formality", source_lang = "en", | ||
target_lang = "es") | ||
Condition | ||
Error in `deepl_translate()`: | ||
! `formality` must be one of "default", "more", "less", "prefer_more", or "prefer_less", not "non-existing-formality". | ||
|
||
# deepl_translate() handles equations well | ||
|
||
Code | ||
math_lines[4] | ||
Output | ||
[1] "" | ||
|
||
--- | ||
|
||
Code | ||
sub(".*que ", "", math_lines[7]) | ||
Output | ||
[1] "$i_t = j_t$" | ||
|
||
--- | ||
|
||
Code | ||
math_lines[9] | ||
Output | ||
[1] "" | ||
|
||
# deepl_translate() handles equations+footnote well | ||
|
||
Code | ||
foot_math_lines | ||
Output | ||
[1] "See $a$ an equation with a note afterwards [^1] ." | ||
[2] "" | ||
[3] "[^1]: a footnote." | ||
[4] "" | ||
[5] "" | ||
|
||
# deepl_translate() handles equations with curly well | ||
|
||
Code | ||
foot_curly_lines[5] | ||
Output | ||
[1] "$a_{ij}$" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
tests/testthat/fixtures/example-equations-footnote/api/translate-37ec3f-POST.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"translations": [ | ||
{ | ||
"detected_source_language": "FR", | ||
"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n<document xmlns=\"http://commonmark.org/xml/1.0\">\n <paragraph>\n <text xml:space=\"preserve\">See <\/text>\n <math asis=\"true\" math=\"true\">$a$<\/math>\n <text xml:space=\"preserve\">\n <text xml:space=\"preserve\"> an equation with a note afterwards <\/text>\n <squary>\n <notranslate>^1<\/notranslate>\n <\/squary>\n <text>.<\/text>\n <\/text>\n <\/paragraph>\n <paragraph>\n <text xml:space=\"preserve\">\n <squary><notranslate>^1<\/notranslate>:<\/squary>\n <text> a footnote.<\/text>\n <\/text>\n <\/paragraph>\n<\/document>\n" | ||
} | ||
] | ||
} |
8 changes: 0 additions & 8 deletions
8
tests/testthat/fixtures/example-equations-footnote/api/translate-746e3b-POST.json
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
tests/testthat/fixtures/example-equations/api/translate-a9b85c-POST.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"translations": [ | ||
{ | ||
"detected_source_language": "EN", | ||
"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE document SYSTEM \"CommonMark.dtd\">\n<document xmlns=\"http://commonmark.org/xml/1.0\">\n <paragraph>\n <text xml:space=\"preserve\">Algo de texto.<\/text>\n <\/paragraph>\n <paragraph>\n <math xml:space=\"preserve\" asis=\"true\" math=\"true\">$$<\/math>\n <math asis=\"true\" math=\"true\"/>\n <math xml:space=\"preserve\" asis=\"true\" math=\"true\">E = m \\times c^2<\/math>\n <math asis=\"true\" math=\"true\"/>\n <math xml:space=\"preserve\" asis=\"true\" math=\"true\">$$<\/math>\n <\/paragraph>\n <paragraph>\n <text xml:space=\"preserve\">¿Te parece bonita esta ecuación? Observa que <\/text>\n <math asis=\"true\" math=\"true\">$\\alpha=1$<\/math>\n <text> y <\/text>\n <math asis=\"true\" math=\"true\">$b$<\/math>\n <text> no está definida.<\/text>\n <\/paragraph>\n <paragraph>\n <text xml:space=\"preserve\"/>\n <math asis=\"true\" math=\"true\">$i_t = j_t$<\/math>\n <text/>\n <\/paragraph>\n<\/document>\n" | ||
} | ||
] | ||
} |
8 changes: 0 additions & 8 deletions
8
tests/testthat/fixtures/example-equations/api/translate-f741d7-POST.json
This file was deleted.
Oops, something went wrong.