Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Notification Localization #808

Open
micahalcorn opened this issue Oct 24, 2018 · 5 comments
Open

Notification Localization #808

micahalcorn opened this issue Oct 24, 2018 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed javascript notifications P3 Users are not significantly affected, minor cosmetic issue translations ui/ux

Comments

@micahalcorn
Copy link
Member

micahalcorn commented Oct 24, 2018

be0d17a adds a handful of English strings for the offer-related events that we convert to push notifications. These should be translated.

There are complications:

  1. Our existing localization code lives in origin-dapp (on the client). These strings live on the server, as (probably) should the translated versions. If so, we will need to store the user's selected language at the time that she creates a subscription and then potentially need to update it each time the language selection is changed. 😬 The notification strings never arrive in the DApp itself, so we can't handle them there. If we wanted to rely solely on the browser's selected language at the time that the notification is displayed, we could theoretically access navigator.language from the service worker. But this may not work.

  2. If the strings live in the service worker or on the server, we would need a way to get them into CrowdIn. There has been some talk with @wanderingstan about having a dictionary of string IDs that could be shared by all apps within the monorepo.

@wanderingstan
Copy link
Contributor

wanderingstan commented Oct 24, 2018

At least in iOS, it looks like there is a solution: you can pass multiple strings for various languages along with the notification payload. Then the notification will be shown in the language of the device. I.e. if user's phone is set to Chinese, they see notification in chinese. If set to English, they see in English.

In all ways this seems preferable to storing a language preference on-server.

See Send a localization string with the notification payload headline in this SO anser:
https://stackoverflow.com/a/18610164

Looking into Android, though I'd wager they have something similar...

EDIT: Seems same option is available on Android: https://stackoverflow.com/a/14958764

@micahalcorn
Copy link
Member Author

Related: #760 🌐

@micahalcorn micahalcorn added the P3 Users are not significantly affected, minor cosmetic issue label Apr 11, 2019
@wanderingstan
Copy link
Contributor

@tomlinton See my post above for info on l10n for iOS and Android mobile.

@micahalcorn -- wasn't this issue assigned to Tom yesterday? Happy to do it, but want to be clear.

@micahalcorn
Copy link
Member Author

Yes, updated @wanderingstan ☑️

@micahalcorn
Copy link
Member Author

Taking this off of @tomlinton's plate 🍽

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed javascript notifications P3 Users are not significantly affected, minor cosmetic issue translations ui/ux
Projects
None yet
Development

No branches or pull requests

3 participants