Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too long translation #11

Closed
Tymcio opened this issue Sep 5, 2017 · 12 comments
Closed

Too long translation #11

Tymcio opened this issue Sep 5, 2017 · 12 comments

Comments

@Tymcio
Copy link
Contributor

Tymcio commented Sep 5, 2017

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

@dpeddi
Copy link
Contributor

dpeddi commented Sep 5, 2017

And so? Thy to short that line.

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

You should make them shorter.

@Tymcio
Copy link
Contributor Author

Tymcio commented Sep 5, 2017

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
Copy link
Contributor

dpeddi commented Sep 5, 2017 via email

@Tymcio
Copy link
Contributor Author

Tymcio commented Sep 5, 2017

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

@dpeddi
Copy link
Contributor

dpeddi commented Sep 5, 2017

1 ZH-CN SYMBOL = 3 BYTES

@winni159
Copy link
Contributor

winni159 commented Sep 5, 2017

@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
Copy link
Contributor Author

Tymcio commented Sep 5, 2017

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

  • Bike = 4
  • 騎行 = 2

@dpeddi
Copy link
Contributor

dpeddi commented Sep 5, 2017

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
Copy link
Contributor Author

Tymcio commented Sep 5, 2017 via email

@dpeddi
Copy link
Contributor

dpeddi commented Sep 5, 2017

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
Copy link
Contributor Author

Tymcio commented Sep 5, 2017

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

@Tymcio
Copy link
Contributor Author

Tymcio commented Sep 5, 2017

And now all is working ok :)

@Tymcio Tymcio closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants