3

I have a lot of dialog files to translate from English to French. Google cloud translation API works fine but sometimes the translation returns "tu" and other times it returns "vous". In a nutshell, "tu" is informal and singular, while "vous" is formal and/or plural.

How to force the vous (formal) in all translations?

I checked documentation about glossaries, but it does not seem to be supported.

It is supported in this translator, but their API is not free.

Ilya Berdichevsky
  • 1,249
  • 10
  • 24
Jack Bow
  • 41
  • 3
  • Can you add few examples? – Ilya Berdichevsky Aug 23 '20 at 20:39
  • yes, here it is : I want to translate : "As you wish. Just tell me when to stop." in french, it returns me : "Comme **vous** le souhaitez. **Dis**-moi juste quand arrêter." – Jack Bow Aug 23 '20 at 21:17
  • About my code, I'm using C# language and use 3 lines of codes : service = new TranslateService(new BaseClientService.Initializer { ApiKey = _myKey_ }); client = new TranslationClientImpl(service, TranslationModel.ServiceDefault); TranslationResult result = client.TranslateText("As you wish. Just tell me when to stop.", "fr", "en"); – Jack Bow Aug 24 '20 at 06:48

1 Answers1

0

Just checked myself and I don't believe this is possible with the API to simply favour formality, unfortunately.

Your best bet, if you don't want to use an alternative service, is to replace all instances of "tu" with "vous".

To achieve this, without replacing "tu" inside other words, you'll want to match and replace only "tu" as a standalone word, ensuring the size of each match is a length of 2.

Otherwise, you may end up creating things like tulip -> vouslip.

Unfortunately vous/tu is not a direct translation of a single word so the dictionary approach doesn't seem viable.

Jordan
  • 2,245
  • 6
  • 19
  • I see what you mean but it doesn't solve the probleme about *verb conjugation* ? – Jack Bow Aug 26 '20 at 18:51
  • Not at all, sorry. I'm not a linguist nor do I have any idea about French but you brought back some highschool memories and I now get what you mean. That will pose a little bit of a problem. There doesn't appear to be anyway to solve it with the Google API as per my answer though. I believe you'll be stuck seeking alternatives if this functionality is 100% required :) – Jordan Aug 26 '20 at 18:57
  • Sorry to not be able to bring more positive news! – Jordan Aug 26 '20 at 18:58
  • Haha, no problem, finally I paid 5€ and use Deepl API with the argument "formality=more". It is fine but I can't use the glossare with this subscritption.. and no more the free translation, it doesn't make sense but anyway it works. – Jack Bow Aug 31 '20 at 19:42