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

prototyping language selector #6063

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

prototyping language selector #6063

wants to merge 2 commits into from

Conversation

vinzv
Copy link

@vinzv vinzv commented Nov 1, 2018

This is a first CSS/template only prototype for a language selector as mentioned in #6043. It's a first draft so any comments or ideas welcome!

langselect

@MrPetovan
Copy link
Collaborator

How do we decide which languages should be in the select list?

function jotGetLanguage() {
reply = prompt("{{$whatlang}}", $('#jot-language').val());
if(reply && reply.length) {
$('#jot-language').val(reply);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how you plan to add languages to the list?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no. It's a leftover from some tryout where I duplicated the process of the location prompt. Just ignore it. ;-)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or better purge it? I guess this whole PR should be marked as WIP?

@vinzv
Copy link
Author

vinzv commented Nov 1, 2018

How do we decide which languages should be in the select list?

I haven't thought about it in detail but my first guess is to use all languages available generally in the system.

@MrPetovan
Copy link
Collaborator

MrPetovan commented Nov 1, 2018

Friendica has at least a partial interface translation for about 20 languages (see view\lang folder), do you plan on including them all?

@vinzv
Copy link
Author

vinzv commented Nov 1, 2018

As said I'm not decided yet and open to discussions but, yes, as they are potentially used by users it would be an option.

@MrPetovan
Copy link
Collaborator

I'd rather add a new profile fields where you can specify all the languages you're talking, and limiting the select box to that short list. But this is definitely a bigger time investment, and your simpler solution with all the available languages should be implemented first so that the feature can be published faster.

@vinzv
Copy link
Author

vinzv commented Nov 1, 2018

Heck, I totally forgot the profile way. Sounds good to me!

@rabuzarus
Copy link
Collaborator

One thing. When adding another icon to the JOT please have in mind that there are also mobiles with small screens.

@tobiasd
Copy link
Collaborator

tobiasd commented Nov 2, 2018

How does it look in the other themes?

@MrPetovan
Copy link
Collaborator

So far it's a frio-only prototype.

@vinzv
Copy link
Author

vinzv commented Nov 2, 2018

One thing. When adding another icon to the JOT please have in mind that there are also mobiles with small screens.

This is how it looks with a (simulated) Nexus 5X:
screenshot_20181102_134810

Other devices with even smaller resolutions look the same way or at least very similar with just some wrapping:
screenshot_20181102_134952

@JeroenED
Copy link

JeroenED commented Jul 8, 2019

What is the current status here?

@MrPetovan
Copy link
Collaborator

Just realized this could be included in #7309

@Quix0r
Copy link

Quix0r commented Apr 4, 2020

Multiple language selection would be appropriate (profile) as people tend to speak/read/write more than one language.

@wiwie wiwie mentioned this pull request Aug 5, 2020
@wiwie
Copy link

wiwie commented Aug 5, 2020

With this prototype, would it be possible to compose the post in multiple languages simultaneously? It seems to me, that one can only choose one language. True multilanguage composing would thus not be possible?

Would it instead be possible to add multiple text fields, one per chosen language? possibly distribute them over tabs per language?

@vinzv
Copy link
Author

vinzv commented Oct 2, 2020

The idea to switch between languages (see the GIF in my initial post) and then compose the respective text. So, yes, it would offer true multilanguage composing. But still it's just a prototype as processing the various languages would need more work protocol-wise, to my understanding.

@Quix0r
Copy link

Quix0r commented Mar 9, 2021

Conflicting change in this PR. Plus you could add the language code to <input> and <textarea> form fields as well.

@MrPetovan
Copy link
Collaborator

It's a prototype so it isn't meant to be merged as is, I'll convert it back to Draft.

@MrPetovan MrPetovan marked this pull request as draft March 9, 2021 14:20
@Quix0r
Copy link

Quix0r commented Mar 9, 2021

Ah, okay. :-)

@gunchleoc
Copy link

gunchleoc commented Aug 5, 2022

If this project is still ongoing, maybe make it similar to the language selector that Mastodon has now?

mastodon-language-selector

The way they do it:

  1. Define 1 default language in UI settings
  2. Recently used languages on top
  3. Search field will filter the list using matches in native name, English name and locale code

Button icon is the currently selected locale code.

@damianwajer
Copy link

What is the status of this PR in terms of the idea of how it could work in Friendica? Is there any chance to implement selecting the language per post basis? It's a great accessibility feature, and Mastodon implements it very well. Unfortunately, Friendica sets the content language to the author's profile language. There is a workaround to change the post language: user can go to the profile settings page on the Friendica instance each time to change "your language" setting. Then after sending a message, switch back to the regular language.

The simplest solution I can think of, which would improve accessibility in a meaningful way, is native <select> with a list of options based on "can read" ("can write"?) setting from the user's profile. So the selection will be short without the need for a custom selector component (at least in the first iteration).

Random thoughts:

  • Friendica-compatible apps like Fedilab or Tusky have UI to set a content language for each post, but Friendica doesn't respect it. Instead, Friendica always sets the language to the Friendica UI language of the user ("your language" – language setting from the user's profile on Friendica instance). Maybe in the first iteration of this feature, we could just support such a setting in other apps? And after that, in separate PR, implement language selector on Friendica's side?
  • I imagine that many users have UI language set to a different language then post content they write, and it's always marked wrong, which can be a real pain for, e.g. screen reader users.
  • There is already "can read" option in the language filter addon with the name langfilter_languages. Maybe we can re-use it to determine languages to show for the language selector? If not, a separate setting in the profile is just fine ("can write"?).

@MrPetovan
Copy link
Collaborator

This is a frontend PR only, with no connection to the backend. The requested feature still needs to be added to the backend before this PR can go forward.

@damianwajer
Copy link

@MrPetovan That's right, but I think this PR is the closest to my idea, so I've decided to comment here. If there is a better place, I will be happy to see it and maybe help. There is also a possible related issue: #11453 (select options could be populated with values from the spoken languages setting).

@gunchleoc
Copy link

One more UI thing I noticed that Mastodon web UI does: When replying, it sets the language to the post that you're replying to. This is a great convenience feature for multilingual people.

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.

None yet

9 participants