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

Dont preselect new post language #1008

Merged
merged 1 commit into from
May 13, 2023
Merged

Dont preselect new post language #1008

merged 1 commit into from
May 13, 2023

Conversation

Nutomic
Copy link
Member

@Nutomic Nutomic commented May 11, 2023

Lemmy-ui currently preselects the first language in the user settings when creating a new post or comment. This is a bad idea because this language might not actually be allowed in the community. It is better to pass the language as None if the user didnt specify it explicitly, because then the backend can smartly choose a language based on the overlap of user languages and community languages.

This fixes the problem described in
this thread, where a user tries to post in a community that has only English allowed, with all languages enabled in user settings. In this case lemmy-ui preselects "undetermined language" as default, which is not allowed and results in an error. This PR fixes the issue because it lets the backend automatically select the correct language (English).

Edit: This probably fixes #919 too.

@Nutomic
Copy link
Member Author

Nutomic commented May 11, 2023

Not sure why the CI is complaining about i18n key.

@SleeplessOne1917
Copy link
Member

@Nutomic I think it's failing because the translation PR adding the key wasn't merged yet.

@dessalines
Copy link
Member

I merged that lemmy-translation, you can run git submodule update --remote.

@Nutomic Nutomic force-pushed the dont-preselect-language branch 2 times, most recently from 0cabe60 to 24138e7 Compare May 12, 2023 20:29
@Nutomic Nutomic enabled auto-merge (squash) May 12, 2023 20:30
@dessalines
Copy link
Member

Needs prettier run.

Lemmy-ui currently preselects the first language in the user
settings when creating a new post or comment. This is a bad
idea because this language might not actually be allowed in
the community. It is better to pass the language as None if
the user didnt specify it explicitly, because then the backend
can smartly choose a language based on the overlap of user
languages and community languages.

This fixes the problem described in
[this thread](https://lemmy.ml/post/1066608), where a user
tries to post in a community that has only English allowed,
with all languages enabled in user settings. In this case
lemmy-ui preselects "undetermined language" as default, which
is not allowed and results in an error. This PR fixes the issue
because it lets the backend automatically select the correct
language (English).
@Nutomic Nutomic force-pushed the dont-preselect-language branch from 24138e7 to 3da238b Compare May 13, 2023 20:03
@Nutomic Nutomic merged commit 1683a74 into main May 13, 2023
dessalines pushed a commit that referenced this pull request May 23, 2023
Lemmy-ui currently preselects the first language in the user
settings when creating a new post or comment. This is a bad
idea because this language might not actually be allowed in
the community. It is better to pass the language as None if
the user didnt specify it explicitly, because then the backend
can smartly choose a language based on the overlap of user
languages and community languages.

This fixes the problem described in
[this thread](https://lemmy.ml/post/1066608), where a user
tries to post in a community that has only English allowed,
with all languages enabled in user settings. In this case
lemmy-ui preselects "undetermined language" as default, which
is not allowed and results in an error. This PR fixes the issue
because it lets the backend automatically select the correct
language (English).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a comment in Deutsch is not allowed
3 participants