amazfitbip / tools

GNU General Public License v2.0
126 stars 58 forks source link

Too long translation #11

Closed Tymcio closed 7 years ago

Tymcio commented 7 years ago

When I am checking length of translation (en, pl) it shows me, that it's too long. https://scr.hu/d5Gkpn

dpeddi commented 7 years ago

And so? Thy to short that line.

On your file you should see some line with # simbol.

You should make them shorter.

Tymcio commented 7 years ago

Ok, I found what is the problem ;) In Chinese word "Bike" is "騎行" = 2 characters. That why 99% of our translation will be too long.

dpeddi commented 7 years ago

Should be 4 bytes. 1 unicode = 2 bytes.

Il 05 set 2017 11:41 AM, "Marcin" notifications@github.com ha scritto:

Ok, I found what is the problem ;) In Chinese word "Bike" is "騎行" = 2 characters. That why 99% of our translation will be too long.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/amazfitbip/tools/issues/11#issuecomment-327125781, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCVXy0v06hv2jr3jlp-45XyYCC--LRTks5sfRdhgaJpZM4PMq0C .

Tymcio commented 7 years ago

@dpeddi so how should you suggest to solve this? :) Checking "騎行" = 6 bytes ;)

dpeddi commented 7 years ago

1 ZH-CN SYMBOL = 3 BYTES

winni159 commented 7 years ago

@Tymcio Hi, the problem is that you use special polish characters, like ł in "Długie przyc". ł = 2 BYTES and the lenght of string "Długie przyc" is 13 BYTES but the length of chinese "長按按鍵" is 12 BYTES. Try to replace this characters ł -> l

Tymcio commented 7 years ago

@winni159 the problem still appears :) As the code isn't checking the bytes, but characters:

dpeddi commented 7 years ago

The problem isn't in the code but in your translation: 1- It seems the Bip doesn't support special character so probably ł will become [?] on your watch . 2- Due to binary patching your translation MUST fit the width of the original chinese string

Tymcio commented 7 years ago

But as I said - English translation gives errors as well, and it's working :)

Pozdrawiam serdecznie, Marcin Tymków On 05.09.2017 17:19:58, dpeddi notifications@github.com napisał/a: The problem isn't in the code but in your translation: 1- It seems the Bip doesn't support special character so probably ł will become [?] on your watch . 2- Due to binary patching your translation MUST fit the width of the original chinese string — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [https://github.com/amazfitbip/tools/issues/11#issuecomment-327209494], or mute the thread [https://github.com/notifications/unsubscribe-auth/ABz6v5c9QndmzxbV4tdFQrf3_Y3pmRaAks5sfWadgaJpZM4PMq0C].

dpeddi commented 7 years ago

Are you sure about it?

./zh-check_translation.py -i zh-cn2en.txt.0.0.8.74 OK!

try to start the tool with: ./zh-cn2en.py -i zh-cn2pl.txt.0.0.8.74 -l pl -t

the original file will be rewritten with "#" in front of translation fo fix. On screen you'll see the lenght in bytes of original string and the lenght in bytes of your translation EG:

E9 95 B7 E6 8C 89 E6 8C 89 E9 8D B5 => 長按按鍵(12) = Długie przyc.(14)

E9 95 BF E6 8C 89 E6 8C 89 E9 94 AE => 长按按键(12) = Długie przyc.(14)

E9 96 8B E5 95 9F E6 96 B9 E5 BC 8F => 開啟方式(12) = Jak otworzyć?(14)

As you can see you need to short your translation

Tymcio commented 7 years ago

Ok :) I did 2nd code and now rewriting translation, thanks! :)

Tymcio commented 7 years ago

And now all is working ok :)