Page 1 of 1

is this a mistranslation?

Posted: Thu Jan 05, 2023 12:45 am
by BarryK

Hi guys,
I have been experimenting with 'translate-shell'
What do you think about these two translations:

Code: Select all

# trans -b -s en -t fr -j life\'s but a walking shadow, a poor player
la vie n'est qu'une ombre qui marche, un mauvais joueur
# 
# trans -b -s en -t fr -j life\'s but a walking \"shadow\", a poor player
la vie n'est qu'une "ombre" ambulante, un mauvais joueur

"ambulante" in English means "itinerant", not what is intended!

Note, translate-shell is available here:
https://github.com/soimort/translate-shell


Re: is this a mistranslation?

Posted: Thu Jan 05, 2023 1:25 am
by BarryK

Here is another question.
I figured out a way to force 'trans' to ignore certain text, by using 'base64' to change the string to something untranslatable. Example:

Code: Select all

# echo 'Puppy Linux' | base64 -w 0
UHVwcHkgTGludXgK# 
# trans -b -s en -t fr -j The UHVwcHkgTGludXgK operating system is great
Le système d'exploitation UHVwcHkgTGludXgK est génial

Afterward, the base64 string can be converted back:

Code: Select all

# echo 'UHVwcHkgTGludXgK' | base64 -d -w 0
Puppy Linux

Then inserted:

Code: Select all

Le système d'exploitation Puppy Linux est génial

...however, does that still read correctly in French?
or, if not quite correct, is it passable?


Re: is this a mistranslation?

Posted: Thu Jan 05, 2023 1:51 am
by BologneChe
BarryK wrote: Thu Jan 05, 2023 1:25 am

Here is another question.
I figured out a way to force 'trans' to ignore certain text, by using 'base64' to change the string to something untranslatable. Example:

Code: Select all

# echo 'Puppy Linux' | base64 -w 0
UHVwcHkgTGludXgK# 
# trans -b -s en -t fr -j The UHVwcHkgTGludXgK# operating system is great
Le système d'exploitation UHVwcHkgTGludXgK# est génial

Afterward, the base64 string can be converted back:

Code: Select all

# echo 'UHVwcHkgTGludXgK#' | base64 -d -w 0
Puppy Linux

Then inserted:

Code: Select all

Le système d'exploitation Puppy Linux est génial

...however, does that still read correctly in French?
or, if not quite correct, is it passable?

Le système d'exploitation Puppy Linux est génial

The translation is good and consistent in this example!


Re: is this a mistranslation?

Posted: Thu Jan 05, 2023 5:30 am
by MochiMoppel
BarryK wrote: Thu Jan 05, 2023 1:25 am

I figured out a way to force 'trans' to ignore certain text, by using 'base64' to change the string to something untranslatable

Hmmm...I figured that enclosing words with capital letters helps in most cases:

Code: Select all

 # txt='The quick brown fox jumps over the lazy dog
> The ZZquickZZ ZZbrownZZ ZZfoxZZ jumps over the lazy dog
> The quick brown ZZfoxZZ jumps over the ZZlazyZZ ZZdogZZ'
# trans   -b -s en -t fr -j -- "$txt" | sed -r 's/ZZ//g'
Le renard brun rapide saute par-dessus le chien paresseux
Le quick brown fox saute par-dessus le chien paresseux
Le fox brun rapide saute par-dessus le lazy dog

I first tried enclosing with XX but this can lead to embarrising translations :oops:


Re: is this a mistranslation?

Posted: Thu Jan 05, 2023 9:02 am
by BarryK

I discovered that 'base32' is better than 'base64', as the former encodes entirely in capital letters:

Code: Select all

# echo 'Puppy Linux' | busybox base32
KB2XA4DZEBGGS3TVPAFA====# 
# echo 'Puppy Linux' | busybox base64
UHVwcHkgTGludXgK#

Capital letters will ensure that the string is treated as untranslatable.


Re: is this a mistranslation?

Posted: Thu Jan 05, 2023 12:37 pm
by BologneChe
BarryK wrote: Thu Jan 05, 2023 12:45 am

Hi guys,
I have been experimenting with 'translate-shell'
What do you think about these two translations:

Code: Select all

# trans -b -s en -t fr -j life\'s but a walking shadow, a poor player
la vie n'est qu'une ombre qui marche, un mauvais joueur
# 
# trans -b -s en -t fr -j life\'s but a walking \"shadow\", a poor player
la vie n'est qu'une "ombre" ambulante, un mauvais joueur

"ambulante" in English means "itinerant", not what is intended!

Note, translate-shell is available here:
https://github.com/soimort/translate-shell

The first translation is correct but the second is not. Not consistent.