Apostrophes are printed as special caracters (FR)

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend, cli

Research direction

Start by reproducing the output through translate-cli and the Translator Python API using the examples in the issue, then trace where the MyMemory response becomes the returned translation. Done means apostrophes are displayed as apostrophes rather than the HTML entity ' in both entry points, with a regression test if the existing test structure supports it.

Written by the indexing model from the issue text.

Description

Hello :)

First of all what a great module really !!! The default translator is awesome for basic usage (so is mine)
I just had one small disappointment about the apostrophes printed as special caracters when trying to translate in french

(gl) guillaume@A320MA:~$ translate-cli -t fr "That's his fault not mine"

Translation: C'est sa faute pas la mienne
-------------------------
Translated by: MyMemory

I thought this could have something to do with the terminal's encoding so I tried in pure python3/utf-8 and got the same result

>>> translator= Translator(to_lang="fr")
>>> translation = translator.translate("That's cool isn't it ?")
>>> print(translation)
C'est cool non ?

It's very surprising to me since even mandarin seems to print properly

I was using translate, version 3.5.0 on Ubuntu x86 LTS20 with python 3.7.1 (anaconda)

For now I can use a small hotfix (a simple ".replace("'","'") should do) but maybe it could be fixed idk ? :)

Thanks again for the good work however 👍

Dominant language
Python
Stars
759
Forks
152
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from terryyin/translate-python

All issues in terryyin/translate-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.