Force "vouvoiement" Google cloud translation API

Viewed 173

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.

1 Answers

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.

Related