Gadgetbridge: Suggestion: RTL support

Created on 5 Feb 2018  ·  16Comments  ·  Source: Freeyourgadget/Gadgetbridge

Hi, i use amazfit bip and its really annoying that it does not support rtl.
Since we can modify font files now, my suggestion is to do the ltr-rtl translation of the notification inside the app (for the required languages)

Thanks.

Most helpful comment

(Kudos go to @roigreenberg!)

All 16 comments

you did not understand me
i have installed hebrew font on AMAZFIT BIP
but, unlike most of the languages which are written Left-To-Right, hebrew is written Right-to-Left
so all hebrew notification are shown backwards,
Therefor, my suggestion is fixing the notification module to send hebrew characters from right to left.

oh, okay, I understand what you mean. But even if you reverse the characters, it will still flow LTR. Also, doing that won't work with RTL languages. But I understand what you mean now.

Hi all.
Can someone help me adding the font to my bip or will it still be backward ?
Should I stay with my basic eng version.

Hi.
I wish to work on this, and my idea is to "convert" the notification before it being sent to the phone.

Can you please help me and tell me where in the code should I look?
@ashimokawa

Have a look at the LanguageUtils.java class, especially the methods about transliteration. At some point we're going to make this a bit more configurable and structured, but this is probably one of the better places to look at implementing RTL support.

Thanks.
Actually I found it yesterday, and done it on both languageType and
NotificationType(inside truncate)

I managed to reverse the message, the only issue left is that it now starts
from bottom to top.
I need a way to know(or estimate) the width of the line..

בתאריך יום ב׳, 20 באוג׳ 2018, 23:22, מאת Carsten Pfeiffer ‏<
[email protected]>:

Have a look at the LanguageUtils.java class, especially the methods about
transliteration. At some point we're going to make this a bit more
configurable and structured, but this is probably one of the better places
to look at implementing RTL support.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Freeyourgadget/Gadgetbridge/issues/976#issuecomment-414450427,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AXc8hQMRa3uNh82N_3HL65B-c3jIf-qqks5uSxqggaJpZM4R5AeD
.

@roigreenberg
That would not work for devices which have multiple font sizes (pebble)
For Bip you would have to know the width of all characters inside the bip font, you could generate a lookup table automatically when unpacking the font...

I'm working on amazfit bip (and mi band 3).

I thought to simply take an average of ~15 characters per line.
In both cases I will need force it to write new lines with \n (hopefully it
supported..)

בתאריך יום ג׳, 21 באוג׳ 2018, 12:25, מאת Andreas Shimokawa ‏<
[email protected]>:

@roigreenberg https://github.com/roigreenberg
That would not work for devices which have multiple font sizes (pebble)
For Bip you would have to know the width of all characters inside the bip
font, you could generate a lookup table automatically when unpacking the
font...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Freeyourgadget/Gadgetbridge/issues/976#issuecomment-414610830,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AXc8hX-oobbiU5K5WG5fIgsH_L4Z58h4ks5uS9H9gaJpZM4R5AeD
.

Yes, newlines work on the bip at least and I think on mi band 3 also

Working on this now.

I saw now that although my function is being called (here, on "messege": https://github.com/roigreenberg/Gadgetbridge/blob/ffc6bd5a73604510d8d7681c5164ee01016df95b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/amazfitbip/AmazfitBipSupport.java#L94)
execpt for e-mail, it actually not changing the messege.
Is there another place?

How can I add it as settings?

@ashimokawa, I want to think about your suggestion of mapping the font sizes.

I'm guessing the unpacking is done after flashing the file, and that not necessarily done with gadgetbridge.
My thoughts is either decide it work only with "my" font file, or create a script that get this information grin the font file.

Regarding the second option, how can I integrate such file into the app?

Hi Roi ,

i am interested in your work , i was searching around regarding the Arabic / Hebrew support .
and i find this thread , i like to know more if there is any update , and maybe you can add some how to tutorial for adding the needed fonts with the RTL support .
also i was wondering regarding the width of the letters and words when we talking about Arabic , since there letters connected together in Arabic words ...

Example : مرحبا كيف حالك

Hi.
Basically, I finish the task. As you can see here, I opened a pull request and I'm waiting for @ashimokawa , @cpfeiffer or someone else to merge it.
In the meanwhile, you can find a modify APK in the facebook link above.
Regarding the width, every character has max size of 16*16 and with the image you also provide width(up to F=16) and the watch cat the unnecessary part.

regarding the connected letters, I managed to replace a word to the contextual form, but it's not 100% connected due to 1-pixel gup between characters.

Added for version 0.30.0

(Kudos go to @roigreenberg!)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robalvsan picture robalvsan  ·  3Comments

wYhyzByH picture wYhyzByH  ·  4Comments

RustyRaptor picture RustyRaptor  ·  3Comments

ruimnetob picture ruimnetob  ·  4Comments

gianlucapir picture gianlucapir  ·  7Comments