]> Untitled Git - lemmy.git/commit
implement language tags for site/community in db and api (#2434)
authorNutomic <me@nutomic.com>
Thu, 6 Oct 2022 18:27:58 +0000 (18:27 +0000)
committerGitHub <noreply@github.com>
Thu, 6 Oct 2022 18:27:58 +0000 (14:27 -0400)
commit2ef0f8f5f8c60d8c7632779ca16bac69daab1266
tree140b82aa5bf3381cd9b93050e830fc967c043882
parent7bb941e5461f68b810a18ea40cb7a405ded69cc9
implement language tags for site/community in db and api (#2434)

* implement language tags for site/community in db and api

* add api checks for valid languages

* during db migration, update existing users, sites, communities to have all languages enabled

* init new users/communities with site languages (not all languages)

* federate site/community languages

* fix tests

* when updating site languages, limit community languages to this subset

also, when making a new post and subset of user lang, community lang
contains only one item, use that as post lang

* add tests for actor_language db functions

* include language list in siteview/communityview

* Fix some of the review comments

* Some more review changes

* Add todo about boxed query

* Add default_post_language to GetCommunityResponse
55 files changed:
crates/api/src/community/transfer.rs
crates/api/src/local_user/ban_person.rs
crates/api/src/local_user/login.rs
crates/api/src/local_user/save_settings.rs
crates/api/src/site/leave_admin.rs
crates/api/src/site/mod_log.rs
crates/api/src/site/registration_applications/list.rs
crates/api/src/site/registration_applications/unread_count.rs
crates/api_common/src/community.rs
crates/api_common/src/site.rs
crates/api_common/src/utils.rs
crates/api_crud/src/comment/create.rs
crates/api_crud/src/comment/update.rs
crates/api_crud/src/community/create.rs
crates/api_crud/src/community/read.rs
crates/api_crud/src/community/update.rs
crates/api_crud/src/post/create.rs
crates/api_crud/src/post/update.rs
crates/api_crud/src/site/create.rs
crates/api_crud/src/site/read.rs
crates/api_crud/src/site/update.rs
crates/api_crud/src/user/create.rs
crates/apub/assets/lemmy/activities/community/update_community.json
crates/apub/assets/lemmy/context.json
crates/apub/assets/lemmy/objects/group.json
crates/apub/assets/lemmy/objects/instance.json
crates/apub/src/activities/voting/vote.rs
crates/apub/src/http/site.rs
crates/apub/src/objects/comment.rs
crates/apub/src/objects/community.rs
crates/apub/src/objects/instance.rs
crates/apub/src/objects/post.rs
crates/apub/src/protocol/objects/group.rs
crates/apub/src/protocol/objects/instance.rs
crates/apub/src/protocol/objects/mod.rs
crates/db_schema/src/aggregates/site_aggregates.rs
crates/db_schema/src/aggregates/structs.rs
crates/db_schema/src/impls/actor_language.rs [new file with mode: 0644]
crates/db_schema/src/impls/community.rs
crates/db_schema/src/impls/language.rs
crates/db_schema/src/impls/local_user.rs
crates/db_schema/src/impls/local_user_language.rs [deleted file]
crates/db_schema/src/impls/mod.rs
crates/db_schema/src/impls/person.rs
crates/db_schema/src/impls/site.rs
crates/db_schema/src/newtypes.rs
crates/db_schema/src/schema.rs
crates/db_schema/src/source/actor_language.rs [new file with mode: 0644]
crates/db_schema/src/source/mod.rs
crates/db_schema/src/source/site.rs
crates/db_views/src/comment_view.rs
crates/db_views/src/post_view.rs
migrations/2022-09-08-102358_site-and-community-languages/down.sql [new file with mode: 0644]
migrations/2022-09-08-102358_site-and-community-languages/up.sql [new file with mode: 0644]
src/code_migrations.rs