Suggestion: RTL support #976

Closed
by doryashar opened 4 years ago · 16 comments
doryashar commented 4 years ago (Migrated from github.com)
Owner

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.

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.
doryashar commented 4 years ago (Migrated from github.com)
Poster
Owner

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.

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.
NotAFile commented 4 years ago (Migrated from github.com)
Owner

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.

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.
gruyon commented 3 years ago (Migrated from github.com)
Owner

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 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.
roigreenberg commented 3 years ago (Migrated from github.com)
Owner

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

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
Owner

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.

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.
roigreenberg commented 3 years ago (Migrated from github.com)
Owner

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 ‏<
notifications@github.com>:

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
.

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 ‏< notifications@github.com>: > 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> > . >
Owner

@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...

@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...
roigreenberg commented 3 years ago (Migrated from github.com)
Owner

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 ‏<
notifications@github.com>:

@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
.

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 ‏< notifications@github.com>: > @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> > . >
Owner

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

Yes, newlines work on the bip at least and I think on mi band 3 also
roigreenberg commented 3 years ago (Migrated from github.com)
Owner

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?

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](url)) execpt for e-mail, it actually not changing the messege. Is there another place? How can I add it as settings?
roigreenberg commented 3 years ago (Migrated from github.com)
Owner

I finished "phase 1".

https://www.facebook.com/groups/1935986946664086/permalink/2169304633332315/?xts%5B0%5D=68.ARC5gWghMUFuY3rrshwYXKRiuopYAfo3-uS9TjF7HY-t5ql5diEFQLaAfo0aLYFfo0DXEUTb7OG764h12oKjEkid95gvPSvcwtqrxs-DnTlsnjAitS0xee3koFSe0VmWVwXVxQD8ZZRS&tn=-R

After some test and fixed I will ask for pull request.

I finished "phase 1". https://www.facebook.com/groups/1935986946664086/permalink/2169304633332315/?__xts__%5B0%5D=68.ARC5gWghMUFuY3rrshwYXKRiuopYAfo3-uS9TjF7HY-t5ql5diEFQLaAfo0aLYFfo0DXEUTb7OG764h12oKjEkid95gvPSvcwtqrxs-DnTlsnjAitS0xee3koFSe0VmWVwXVxQD8ZZRS&__tn__=-R After some test and fixed I will ask for pull request.
roigreenberg commented 3 years ago (Migrated from github.com)
Owner

@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?

@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?
error0327 commented 3 years ago (Migrated from github.com)
Owner

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 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 : مرحبا كيف حالك
roigreenberg commented 3 years ago (Migrated from github.com)
Owner

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.

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.
Owner

Added for version 0.30.0

Added for version 0.30.0
Owner

(Kudos go to @roigreenberg!)

(Kudos go to @roigreenberg!)
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.