Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3230] Localizing Push Notification Alerts

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2015-09-17T06:39:42.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, android, ios
ReporterJoseph Sachs
AssigneeShak Hossain
Created2014-10-01T14:33:56.000+0000
Updated2017-09-12T09:25:28.000+0000

Description

Is there a way to localize Alerts push notifications. Someone suggested we keep the language of the User in ACS.User custom_fields, and then fetch the Users prefered language and send the Push Notification Alert text depending on that users language. While the above seems like a *very bad practice* (as it requires a lot of ACS calls just to send an Alert), I am wondering if there is a good practice to localize the Alert text in Push Notifications. *Apple Suggests* using:
"alert" : { 
    "loc-key" : "My Localized String",
    ...
}
And then, in your Localizable.strings file inside the correspondent language identifier, add the following: "My Localized String" = "The localized string in the language you want."; Ideally the same method would be used for Android.

Comments

  1. Joseph Sachs 2014-11-12

    When sending a Push via ACS:
    { "sound":"default", "alert": {"loc-key":"addbarcode"} } 
    and in /i18n/en/strings.xml:
    <string name="addbarcode">English Alert Message!</string>
    and in /i18n/fr/strings.xml:
    <string name="addbarcode">Message en francais !</string>
    Does not work, I see the Alert on the device as: {"loc-key":"addbarcode"}
  2. Joseph Sachs 2014-11-19

    Also with iOS8, you can localize also the Action button label with: “action-loc-key” : “buttonTitle”
  3. Joseph Sachs 2015-07-09

    Wondering how come this isn't a high priority...
  4. Fokke Zandbergen 2015-08-18

    According to https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW21 the key should come from LANG.lproj/Localizable.strings which is what our i18n/LANG/strings.xml writes to, so it's weird that this is not working.
  5. Joseph Sachs 2015-08-18

    I see, so I'm guessing this ticket is still valid. Thanks @Fokke
  6. Seth Toda 2015-09-02

    [~underlabs], I moved this to TIMOB-19459 as a feature request.
  7. Joseph Sachs 2015-09-17

    I see this as Resolved :) I wonder if the change happened on the Cloud + Ti SDK, or just Ti SDK... basically wondering if I can take advantage of the solution now, if not... an approx. time frame to be released to the public. Thanks guys!
  8. Seth Toda 2015-09-28

    Hello This was moved to an internal project. Van you see the attached CLOUDSRV project?
  9. Lorenzo Piccinini 2017-09-12

    Any news about this ticket? It seems not yet available on arrowdb .

JSON Source