Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Localized bootstrap relay(s) option upon app install/onboardinng 🇯🇵🌎🌍 #1447

Closed
alltheseas opened this issue Aug 5, 2023 · 17 comments
Labels

Comments

@alltheseas
Copy link
Collaborator

alltheseas commented Aug 5, 2023

user story (example Japan)

As a Japanese Damus user onboarding to Damus, I would like to have the Japanese relay(s) included in the Damus bootstrap relay list, so that I can jump into discussions in Japanese

acceptance criteria

  1. Japanese users automatically have Japanese relay(s) included on their bootstrap list

(Future: Brazilian users have Brazilian users, and so on)

implementation discussion

Not sure if there is a way to do this programmatically @tyiu.

Nostr.watch has relay geographies.

Japanese relay info can manually be added, and programmatic localized relay update can be done subsequently.

@alltheseas
Copy link
Collaborator Author

Japanese relay info:

https://scrapbox.io/nostr/awesome-nostr-japanese

@alltheseas alltheseas changed the title Localized bootstrap relay(s) Localized bootstrap relay(s) 🇯🇵🌎🌍 Aug 5, 2023
@alltheseas alltheseas changed the title Localized bootstrap relay(s) 🇯🇵🌎🌍 Localized bootstrap relay(s) upon app install/onboardinng 🇯🇵🌎🌍 Aug 5, 2023
@alltheseas
Copy link
Collaborator Author

alltheseas commented Aug 5, 2023

@tyiu @jb55 maybe we can detect the user's keyboard language(s), and assign localized relays to them?

Not sure what the privacy tradeoffs are here/ if this information is publicly broadcast by iOS users.

@tyiu
Copy link
Collaborator

tyiu commented Aug 5, 2023

@tyiu @jb55 maybe we can detect the user's keyboard language(s), and assign localized relays to them?

Not sure what the privacy tradeoffs are here/ if this information is publicly broadcast by iOS users.

We should absolutely not use a user's keyboard language as an indication for anything. Them wanting to type with that keyboard language does not imply that they understand the language. I personally have several that I want to type in because I'm learning the languages and understand some words, but I do not understand them well enough.

There's a better explicit signal, which is the same one that's used by the auto translations feature already: using the list of preferred languages from iOS settings.

imo it should be opt-in and not automatic.

One way to do this could be to have a static list of relay suggestions (similar to how we have a static list of pubkeys to suggest to follow in onboarding). Damus could suggest the ones that match their language preferences:
https://github.com/nostr-protocol/nips/blob/master/11.md#community-preferences

@alltheseas
Copy link
Collaborator Author

@tyiu @jb55 maybe we can detect the user's keyboard language(s), and assign localized relays to them?

Not sure what the privacy tradeoffs are here/ if this information is publicly broadcast by iOS users.

We should absolutely not use a user's keyboard language as an indication for anything. Them wanting to type with that keyboard language does not imply that they understand the language. I personally have several that I want to type in because I'm learning the languages and understand some words, but I do not understand them well enough.

There's a better explicit signal, which is the same one that's used by the auto translations feature already: using the list of preferred languages from iOS settings.

imo it should be opt-in and not automatic.

One way to do this could be to have a static list of relay suggestions (similar to how we have a static list of pubkeys to suggest to follow in onboarding). Damus could suggest the ones that match their language preferences:

https://github.com/nostr-protocol/nips/blob/master/11.md#community-preferences

This is great feedback.

I suppose we could ask around various communities about localized language relays for the opt-in list you are describing.

@alltheseas alltheseas changed the title Localized bootstrap relay(s) upon app install/onboardinng 🇯🇵🌎🌍 Provide Localized bootstrap relay(s) option upon app install/onboardinng 🇯🇵🌎🌍 Aug 6, 2023
@alltheseas
Copy link
Collaborator Author

https://damus.io/note1a9j6l6yxzy628hc68f0u6j4gjrj4mx4ehlph8eje8ktam9p2vkvqvd79zt

fyi @jb55 @danieldaquino this would be a nice add prior to Nostrasia

@alltheseas
Copy link
Collaborator Author

alltheseas commented Oct 20, 2023

Japan 🇯🇵 relay list

This list is the minimum required to interact with the Japanese people on (the) Nostr.

wss://relay-jp.nostr.wirednet.jp
wss://yabu.me
wss://r.kojira.io

https://damus.io/note13xjdk730x6eh6htw2ucl9s795thq8yq9w4eh54dzjg3gk7vj8lpq4vgcnm

@alltheseas
Copy link
Collaborator Author

alltheseas commented Oct 20, 2023

using the list of preferred languages from iOS settings.

imo it should be opt-in and not automatic.

One way to do this could be to have a static list of relay suggestions (similar to how we have a static list of pubkeys to suggest to follow in onboarding). Damus could suggest the ones that match their language preferences:
https://github.com/nostr-protocol/nips/blob/master/11.md#community-preferences

Day one (1) suggested implementation:

  1. detect during profile creation if preferred language is Japanese
  2. if yes, prompt user to opt-in to Japanese relays "Damus detected that your preferred language is Japanese. Would you like to add the following Japanese only relays to your relay list?” (Translation pending to Japanese)
  3. provide yes or no option, including the list of above relays
  4. if no do nothing
  5. if yes append Japanese relays as defined in Provide Localized bootstrap relay(s) option upon app install/onboardinng 🇯🇵🌎🌍 #1447 (comment)
    to bootstrap relay list

@alltheseas
Copy link
Collaborator Author

Damus は、あなたが使用している言語が "日本語" であると検出しました。"日本人" をフォローできるリレーのみをリレー一覧に追加しますか

Quoted strings should be replaced to another languages or name of groups speaking the languages.

https://damus.io/note18q8q5rg4pcpxqw4263se94t9lzzdx0mmtn2hykzt94t2jmz0vhaq2qkr30

@alltheseas
Copy link
Collaborator Author

@tyiu you able to lend a hand prior to Nostrasia?

@alltheseas
Copy link
Collaborator Author

alltheseas commented Oct 23, 2023

@danieldaquino @jb55 I propose this ticket to be added to the subsequent sprint 7 starting the following Monday Oct 30th. Nostrasia in 🗾 🇯🇵 starts Nov. 1st. Ideally we have this one added at least to testflight by then 🙏.

@danieldaquino
Copy link
Contributor

@danieldaquino @jb55 I propose this ticket to be added to the subsequent sprint 7 starting the following Monday Oct 30th. Nostrasia in 🗾 🇯🇵 starts Nov. 1st. Ideally we have this one added at least to testflight by then 🙏.

@alltheseas, @jb55, would it make sense to bring this ticket into the current sprint and remove some lower priority items that haven't been worked on yet?

@alltheseas
Copy link
Collaborator Author

@danieldaquino I did not want to bring this up, as I prefer having a two week plan & commitment, but I think this makes sense due to my poor planning and the upcoming Nostrasia conference in 🇯🇵

😅

@danieldaquino
Copy link
Contributor

Started to work on this. To increase chances of getting this in before Nostrasia I will send two patches:

  1. One where the JP relays are automatically added on the background if they detect the user has the Japanese locale setup on their phone (Simpler changeset)
  2. A second one with a nicer UI prompt during onboarding, if the user has the Japanese locale setup on their phone. (which I will work on after sending patch 1)

I will focus on this today and get the patches sent ASAP to give @jb55 at least half of October 31st (in Japan time) to review, merge, and push a new Testflight version with patch 1 or 2 (hopefully 2)

@alltheseas
Copy link
Collaborator Author

Started to work on this. To increase chances of getting this in before Nostrasia I will send two patches:

  1. One where the JP relays are automatically added on the background if they detect the user has the Japanese locale setup on their phone (Simpler changeset)
  2. A second one with a nicer UI prompt during onboarding, if the user has the Japanese locale setup on their phone. (which I will work on after sending patch 1)

I will focus on this today and get the patches sent ASAP to give @jb55 at least half of October 31st (in Japan time) to review, merge, and push a new Testflight version with patch 1 or 2 (hopefully 2)

ありがとう、良かったです

@danieldaquino
Copy link
Contributor

@jb55, @alltheseas, I sent the patch for the simplified version of this feature (along with all relevant info and testing) via email to patches@damus.io.

It can be visualized here: https://groups.google.com/a/damus.io/g/patches/c/FvxA1Am90YY

jb55 pushed a commit that referenced this issue Oct 31, 2023
Depending on user's locale. currently only supported for Japanese users.

This change allows Japanese users to automatically connect with popular
Japanese regional relays during account creation, thus allowing Japanese
users to better connect with the Japanese Nostr community.

More specifically, 3 Japanese regional relays will be automatically
added to the user's relay list (on top of the usual relays) under the
following conditions:

1. User's region (As configured in iOS settings) is Japan, AND
2. The user is creating a new Nostr account through Damus.

In the case the Nostr account is not new, Damus will not add any
regional relays (It will respect the user's relay list).

Testing
-------

PASS

Device: iPhone 15 Pro (Simulator)
iOS: 17.0.1
Damus: This commit
Test steps:

1. With the US region set, install Damus
2. Go through onboarding and create a new account.
3. Once the onboarding is complete, look at the connected relays. Should only be connected with popular international relays. PASS
4. Uninstall Damus
5. On iOS settings, go to Location & Region settings and change the region to Japan.
6. Install Damus
7. Go through onboarding and create a new account.
8. Once the onboarding is complete, look at the connected relays. User should be connected with intl relays as well as Japanese relays. PASS
9. Quit Damus and restart
10. Ensure the Japanese relays are still on the list. PASS
11. Quit Damus
12. Change region back to US
13. Restart Damus and check the relay list. Relay list should not be affected. PASS
14. Reinstall Damus
15. Check relay list. Only intl relays should be shown. PASS
16. Change region to Japan (JP)
17. Restart Damus and check the relay list. Relay list should not be affected. PASS
18. Reinstall Damus
19. This time, login with a pre-existing account (One that is not connected to Japanese relays).
20. After onboarding, check relay list. The relay list should be unaffected (i.e. Japanese relays should not have been added since this account is pre-existing). PASS

Note: The actual network connection with some of the Japanese relays
failed, but that is likely due to the Geo-based IP restrictions imposed
by some of those Japanese relays. The relay list has been copied
verbatim from @mattn's suggestions.

Reference ticket: #1447

Changelog-Changed: Automatically load extra regional Japanese relays during account creation if user's region is set to Japan.
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Signed-off-by: William Casarin <jb55@jb55.com>
@danieldaquino
Copy link
Contributor

@jb55, @alltheseas, I remember we discussed on a previous meeting that we might want to keep this feature simple by just having the Japanese regional relays being automatically loaded if the user's locale is JP.

In that case, do we want to close this ticket? Or is there any additional work we would still like to address in this one?

@alltheseas
Copy link
Collaborator Author

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants