-
Notifications
You must be signed in to change notification settings - Fork 340
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
feat: Default language dropdowns to user's interface language #1463
Conversation
It would be best to be able to select the default language for posts, but not sure Primary Language is a good term though since non-english speaker have another Primary Language they talk but still may post most english content. So if selection would be made, it must be clear that it is the default language for created posts, not what language the user is most fluent in. |
@Nutomic isn't the backend supposed to pick a language automatically if one is not specified? If so, this PR is unnecessary. |
No, this is for picking the language in the language dropdown when composing a post or comment. Right now that dropdown always defaults to "Undetermined". |
I expect this to cause a lot of wrong languages for non english speaking users. If the user speaks German it is natural to have the interface in German, but still most communities are English speaking. So defaulting to German may cause a lot of posts to be posted with the wrong language. |
Yes this isnt correct and shouldnt have been merged. The backend tries to select a language automatically if none was passed, and this change is going to break the automatic language selection. |
@Nutomic Thanks, my mistake, this was too aggressive. I’ll create a PR to revert this. |
@Nutomic Why does the backend dictate what language the user is writing in? This PR affects the markdown language select drop-down. I imagine the language the user is writing in won’t always be the language the server is in, no? Will still back this out but am curious about this behavior. |
Its not dictating anything. A default language is only picked if the overlap of user languages and community languages contains a single item (excluding undefined). So only if there is a single valid possibility. Here is the relevant code. You could reimplement it in the frontend to pick a default language when possible. Similarly, language options could be removed from the dropdown if they are not allowed in the community. For comments, the language always defaults to the language of the parent post/comment if none was provided explicitly. This logic could also be reimplemented in lemmy-ui. Although it can be incorrect in some cases as well. |
@Nutomic Ohhh, I see. The dropdown still says "Select Language" (no language is selected), but the content will be saved with the language that matches the criteria you listed. I was confused because the dropdown never changed; I thought I was just always posting in the "undetermined" language. |
Revert #1463, markdown default lang select
I didn't realize the backend had this default selection of languages either, so that is a bit confusing. |
Making language selection mandatory would be very annoying, and would discourage users from posting. In any case there will be posts without language tag, because most other federated platforms dont support language tags. |
When Markdown entry fields are shown, this change will automatically set the Language dropdown to the user's selected Interface Language.
If the user hasn't selected an Interface Language, this defaults to their browser language.
Before, this dropdown defaulted to "Undetermined", which made it so that content was by default without a language. (Hence the warning about de-selecting "Undetermined" in your list of preferred languages.)
Before
After