Closed Bug 967925 Opened 6 years ago Closed 2 years ago
[B2G][l10n][Notifications] Screenshot saved to Gallery alert remains in the language set at the time the image was taken
Description: When a screenshot is taken in the current language, then the language is changed and another screenshot is taken, the alerts in the notification drop down menu that the screenshot has been saved will remain in whichever language was set at the time it was taken. Restarting the phone clears all of the notifications so that they can no longer be seen and verified by the user. Voicemail notifications are translating in to the correct language. Repro Steps: 1) Updated buri to BuildID: 20140203181708 2) Hold home button and lock button at the same time to take a screenshot 3) Tap the settings button 4) Scroll down and tap the language button 5) Change language to anything other than what was previously selected 6) Hold home and lock button again to take another screenshot 7) Drag notification menu down from top of screen 8) Observe screenshot saved alerts appearing in multiple languages Actual: Screenshot saved alerts are appearing in multiple languages without the user being forced to restart and lose all notifications, inhibiting them from viewing and confirming the alert. Expected: Screenshot alerts change language as the rest of the phone does, and user is not forced to restart and lose all notifications without being able to verify them first. Environmental Variables: Device: buri v13 moz ril BuildID: 20140203181708 Gaia: bb36b4164d3e51ca04b612e507e1178f80bf240d Gecko: 9731b0b7fa78 Version: 28.0 Firmware Version: V1.2-device.cfg Notes: Repro frequency: 5/5, 100% Link to failed test case: https://docs.google.com/spreadsheet/ccc?key=0AvRct4nrPb_ldHpIZnVneHlHVGhpWUdSN3RLa2dubEE&usp=sharing#gid=6, SMS tab, row 26 See attached: Screenshot
Moving to system (it still happens on master), since that widget seems to be part of system (or at least the iframe references system).
Component: Gaia::Homescreen → Gaia::System
screenshot.js creates a notification passing strings, not key IDs, so this can't obviously retranslated when language changes. https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/screenshot.js#L43 But I also found bug 952453 referenced in notifications.js, which plans to remove mozNotification API (deprecated).
See also bug 832035 for notifications about missed calls. I didn't check but it's probably the same issue.
Is this a wontfix, rfe or do you have any other idea? From what I understand, these notifications are made by passing translated strings, so system will never know how to retranslate them when language changes (no key reference), and doesn't have access to app's strings either.
Moving NI to stas in case he know more.
Flags: needinfo?(fabien) → needinfo?(stas)
(In reply to Francesco Lodolo [:flod] from comment #4) > From what I understand, these notifications are made by passing translated > strings, so system will never know how to retranslate them when language > changes (no key reference), and doesn't have access to app's strings either. If this is indeed true, then this bug is a wontfix, I'm afraid. We don't currently have a way to access other apps' strings from the System app. In the future, I'd like us to 1) have an async service which provides localized apps and 2) possibly white-list the system app to be able to get strings from other apps using that service (i.e. without launching the app in question).
There is one idea I'd like us to explore wrt. retranslation of notifications. If we can get notification ID from Notifications API, we could use this ID to resend the notification with the content in the new locale. This could make System replace the notification instead of adding a new one. Does it sound like a potential solution?
What do you guys think about an approach proposed in comment 7?
Comment 7 won't work generally because the original sender would be responsible of resending that notification. For Screenshot notification it's easily but for notifications coming from apps it's not. We also really can't quietly replace the notification for apps because the onClick/close etc will be lost. My quick proposal, similar to comment 6, is to extend the notification API and let the app passes untranslated string IDs, and allow the System to translate it accordingly. Obviously that only works for Gaia apps and System need some way to access the locale files of apps for this purpose (or, we could just move the strings to System, if that sounds acceptable.) If we don't want to touch notification API, this bug should be WONTFIX'd.
Yep, the long-term solution should change the Notification API, possibly using the new Intl capabilities that JS got (and that I don't know much). As a short-term solution, the screenshots subsystem could probably do smarter things (but you should ask to the System peers), but for notifications I'd advise to wontfix it now. Note that changing the language while a notification is displayed is probably a rare case too.
Similar to comments above, we could fix screenshot notification but for others we have no way now.
I don't know nearly enough about notifications, but I've always thought they were supposed to be a one-time thing. If that's the expectation that the user has, I think it's okay to leave this as-is, and possibly document it as a known bug. Changing languages is rare enough to make this a very small bug. One kind of notification that I think should be translated are system update notifications which persist and cannot be easily discarded. They are also correctly re-translated right now. If the screenshot notification comes from the System app which is also responsible for showing all notifications (this is my understanding), then we can fix this one case, as Alive says in comment 11.
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.