Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for using either plaintext or HTML output in the translation #13

Closed
rawr51919 opened this issue Mar 19, 2019 · 4 comments
Closed

Comments

@rawr51919
Copy link

rawr51919 commented Mar 19, 2019

Would it be possible to add in a parameter that allows for either plaintext or HTML output from this API? If done, this will fix matheuss#81. In that issue, it's suggested that the fix could be an additional format parameter that switches between plaintext and HTML output format.

@rawr51919
Copy link
Author

Could this be looked into at some point?

@vitalets
Copy link
Owner

By refs to translate format option in matheuss#81 it looks like HTML is supported by default.
@coltongit could you provide the code showing when this is needed?

@vitalets
Copy link
Owner

Closing as outdated.

@JakovGlavac
Copy link

Yeah It would be nice to add format query parametar, because on simple tags like

<p>hello</p>

everything works fine, but when you nest a couple of tags like this (doesn't have to be this extreme):

<p><strong>bold</strong></p><p><em>italic</em></p><p><s>s-prekriženo</s></p><p><code>code</code></p><react-component formula="\frac{{x}^{{2}}}{{69}}" description="" defaultmode="ascii">x^2/69</react-component><img src="https://ucarecdn.com/e7a7f06d-ded8-483f-830b-7817cbcb9c72/-/preview/-/quality/smart/-/format/webp/"><p><sup>na kvadrat</sup></p><p><sub>ispod kvadrata</sub></p><p><a target="_blank" rel="noopener noreferrer nofollow" href="http://localhost:3000/en/question/cl6y814m01718zwvc1zcx3kxj">http://localhost:3000/en/question/cl6y814m01718zwvc1zcx3kxj</a></p><p><math-inline class="math-node">x^2/69</math-inline></p>

google just ignores it. Or if you have something like this:

<p><strong>Bok kaj ima? </strong></p>

google thinks that because of this strong tag this is english language, when it is croatian.
or if you want to translate latin language to Cyrillic (for example Serbian), google translates the tags to Cyrillic as well.

<p><strong>Bok kaj ima? </strong></p>
<п><стронг>Здраво, шта има? </стронг></п>

So yeah without this parameter it would be pain in my assholes to extract all the text and then translate it, so I could put it back in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants