thunder-app / thunder

Thunder - An open-source cross-platform Lemmy client for iOS and Android built with Flutter
https://thunderapp.dev
GNU Affero General Public License v3.0
732 stars 62 forks source link

Ability to block posts and communities that are set to a different language #744

Closed hjiangsu closed 2 days ago

hjiangsu commented 8 months ago

Is your feature request related to a problem? Please describe. Its a QoL feature which reduces the number of posts/communities which you are most likely not going to interact with because they are in a different language.

Describe the solution you'd like My thoughts on how this would be implemented:

This should be an option that we select in the Settings page.

Describe alternatives you've considered N/A

Additional context Related: https://lemmy.world/post/5068121

iparks99 commented 1 month ago

When fetching communities (e.g., on searches), we can check for the community language

Is this possible? I don't see a language id property on communities.

I think filtering posts by languages is useful in itself, but if you have an idea of how to filter communities by language please let me know!

The languages will be pulled from your account settings (whatever you set up on your instance)

Any tips on this for anonymous users? Or would this feature just not be available to them? I can't seem to find a list of languages for the language input modal that doesn't come from the instance and has language ids.

hjiangsu commented 1 month ago

Is this possible? I don't see a language id property on communities.

Communities have a property called discussion_languages which holds an array of integers corresponding to languages. I think we can use this to determine the allowed languages for a given community. However, I'm not too sure if the API automatically filters out communities if we set the discussion languages in the user settings - we would have to do a test to see what the behaviour is here!

Any tips on this for anonymous users? Or would this feature just not be available to them?

I mentioned it in here: https://github.com/thunder-app/thunder/pull/1289#issuecomment-2047929386 but we can limit the scope of this to logged in users for now! It would be possible to do it for anonymous accounts, but it might be a bit more complicated (and might be more suited as a separate PR)

hjiangsu commented 1 month ago

I'll assign this to you since you're working on it but do let me know if you'd like me to remove the assignment!