Possible solution for non-Latin character support (Android, Pebble Notifier)

MorbydMorbyd Posts: 338Member
edited March 2013 in Developer Discussion
While Pebble never promised to support languages other than English, I have seen quite a few inquiries here and elsewhere about whether Pebble could support non-Latin characters in the future. I think the Pebble team promised to look into it, but they've got a lot on their plate so I don't expect that to happen soon.

However, I had a thought on a possible stop-gap measure that might even be the best solution we'll get.

Many of us are using Pebble Notifier (or Augmented Smartwatch or Light Flow) to pass some or all notifications to our watch. Would it be possible for the program to include a table of characters that it automatically transliterated into the Latin alphabet?

For example, the Cyrillic (Russian) character "П" would show up on the watch as "P", "Я" as "Ya" and so on. 

I'm not a programmer (I knew Basic and Pascal in my youth, HTML and PHP more recently. Obviously not helpful here!) but I would gladly provide a transliteration table for the Cyrillic alphabet and I'm sure we could find volunteers for other languages.


Post edited by Morbyd on
·
«1

Comments

  • RichardGRichardG Posts: 272Member Regular
    Not quite what you're saying but there's this.
    ·
  • MorbydMorbyd Posts: 338Member
    That's close...

    But it translates instead of transliterates and therefore needs a data connection.

    I'm thinking baked-in transliteration. Привет = "Privet" not "Hello"
    ·
  • MorbydMorbyd Posts: 338Member
    Bump.
    Any ideas on this?
    ·
  • skyjumperskyjumper Posts: 106Member
    So you would send it cyrillic and it would display latin characters? 
    ·
  • MorbydMorbyd Posts: 338Member
    edited March 2013
    Well, kind of.

    The notifications have to go through an app (Pebble stock app, Augmented Smartwatch, Pebble Notifier, etc.) before they get sent to the watch via Bluetooth.

    My theory is that the program could have a built-in replacement table. It would scan the text of the notification and replace certain characters (Cyrillic, Greek, extended Latin, maybe even Arabic, Hebrew, Georgian, various Asian languages, etc) with their Latin equivalents.

    So, if you got a text message or email in one of the supported languages on your phone, it would show up on your Pebble transliterated into equivalent in Latin letters.

    I could write that section of the code in 5 minutes in PHP but that's not going to help anybody :) Still, it can't be hard to do for an Android app.
    Post edited by Morbyd on
    ·
  • YevhenVainshteinYevhenVainshtein Posts: 7Member
    I like this solution! It's actually should not be so hard to write such an app. Hopefully, when SDK will be released, it will be enough volunteers to write it...
    ·
  • MorbydMorbyd Posts: 338Member
    You don't even need the SDK! It can be written into the Android app with tools already available.
    ·
  • DylanWilsonDylanWilson Posts: 16Member
    I was actually just thinking about this the other day. I'd love to see Arabic on the Pebble, but I'm not going to hold my breath until it gets here. It would be easy enough for them to get some sort of conversion between Arabic and SATTS or the Chat alphabet. I'd prefer SATTS, but I should probably learn the Chat alphabet anyways, as it's more widely used. Either way, it'd just be a simple conversion process, just breaking down and replacing the word one letter at a time.

    Instead of اهلا وسهلا it would just be A?LA WS?LA (SATTS)

    If the Pebble Team sees this and wants to implement it and needs help with Arabic, feel free to contact me.
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    I'm as a Russian guy =) has this problem too and I can develop some stuff. We have api for android so we can send notification to pebble with whatever latin text we want, but app needs to catch notifications and this is unusual thing, I haven't reseach this way. So if there is a free app that can catch notifications and sent them to another app via intent or broadcast etc, I can try to make something very soon. I did not research about such apps, something like tasker maybe? Don't want to buy every app to check.
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    if you have an intent I can look at supporting it - saves me work

    Something like this
    Augemented catches notifications - let us  call it sender and subject.

    I send sender and subject to your Intent to translate and you send it back to me via my Intent - then I send to pebble - does that work for you.

    my intent is com.alk.k9.add.action sender:abc subject:xyz

    that will trigger info to any smartwatch augmented supports including the Pebble.

    thanks
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    Sounds good to me, I'll prepare it soon.
    ·
  • MorbydMorbyd Posts: 338Member
    edited March 2013
    @augmentedsmartwatch 

    I wrote this little bit of code in Java to show how it'd be done for the Cyrillic alphabet.
    How does one turn that into an Intent?

    (note: I'm not a programmer. I just taught myself a little bit of Java this afternoon)
    Post edited by Morbyd on
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    edited March 2013
    Would this be required for all notifications or just ones from specific apps 


    Would be easier to get a Table like this hence multiple tables could be more easily swapped in.

    private static String Cyrillic2English[] = {
    "a", "abc",  // each row containing two strings - first one is the Cyrillic character and the 2nd one being the english string to replace with
            };

    Post edited by augmentedsmartwatch on
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    edited March 2013
    Better for all notifications. I've made an app, sending to augmented samrtwatch works, but watches receives two identical notifications, not sure why. More Info and Show Last Few Notifications are disabled.
    intent action: "ru.veretenenko.augtransliterator.transliterate" with "sender" and "subject" string extras to use with startActivity().

    update: yup, if more info and last is disabled I get double of any notification occure, even two trial expired messages in a row.
    Post edited by AntonVeretenenko on
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    edited March 2013
    is show last notification last enabled even if greyed out if so enable auto-scroll and then disable show notification last  and disable auto-scroll.

    Post edited by augmentedsmartwatch on
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    yep, that helps
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    Well done - it works!

    Here is an updated ASP version which supports this (I will add to the next release 4.5)

    https://dl.dropbox.com/u/101388531/37pebbletrial.apk

    Under Pebble-Advanced options - translation mode needs to be enabled.

    However one parameter needs to be added to the intent when calling ASP:

    translator:augtransliterator

    this needs be added to every Intent call back into ASP - hence I know not to resend back to you and to send to the Pebble.

    once you update your APK the above link should work!



    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    My bad was to play as activity. It's blinking, and now does not closing at all, so I moved to service. Can you change it to startService()?
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    Changed to service, added "translator" extra. https://www.dropbox.com/s/ybxf9red2w8orxk/AugTransliterator.apk
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    Ok link updated with Service instead



    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    hold on link is bad - it FC will fix in a bit
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    Service was not exported. Fixed https://www.dropbox.com/s/ybxf9red2w8orxk/AugTransliterator.apk
    But watches does not receive message, can you check if your app receiving intent or not? It works from button but does not work from actual notification. I can see in logs that my service is sending intent, but something wrong.
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    try now


    Still testing not yet working but maybe we can test in parallel

    Sending from your app works to watch

    However I cannot be 100% you are getting the service request from Augmented - try with the attached link
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    edited March 2013
    Well, now service not receiving anything, it was with prev version though =)
    Post edited by AntonVeretenenko on
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    I do not seem to get the Intent - but I am not sure if I am sending you the intent properly - this is the code I use

                   Intent intent2 = new Intent();
                 intent2.setAction("ru.veretenenko.augtransliterator.transliterate");
                 intent2.putExtra("sender", name);
            intent2.putExtra("subject", message);
           sendBroadcast(intent2);


    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    oh, nope, try startService(intent2)
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    oops - OK I got it working but I need to tweak something first 
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    edited March 2013
    https://dl.dropbox.com/u/101388531/37pebbletrial.apk

    Finally working - note I have a restriction - if Sony smartwatch software is running on the Android it will not work - as i have to preserve some timing issues specific to Sony and hence had to do this.

    For Pebble only users - should be working now.

    Anton - send me an email to augmentedtraffic at gmail dot com for a full version and thanks very much for doing this - I am sure many people will be grateful to you.
    Post edited by augmentedsmartwatch on
    ·
  • AntonVeretenenkoAntonVeretenenko Posts: 15Member
    edited March 2013
    Great =) Works but still a bit issue there, service receiving intent twice in a row and both go to watch =)
    03-30 06:30:01.497: I/ru.veretenenko.augtransliterator.TransService@41fe84b0(12829): Got intent with data
    03-30 06:30:01.517: I/ru.veretenenko.augtransliterator.TransService@41febb10(12829): Got intent with data
    Post edited by AntonVeretenenko on
    ·
  • augmentedsmartwatchaugmentedsmartwatch Posts: 104Member
    what are you using to test the notification - I suspect it is dependent on that application which may be triggering multiple notifications.

    Could you try the menu - test notification option in the augmented app - I get only one notification when I do that and other ones.

    I also tried GTalk 

    Will test more to see with other apps

    thanks
    ·
«1
Sign In or Register to comment.