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

Improve native user interface dropdown example? #7185

Open
j9t opened this issue Oct 7, 2021 · 5 comments
Open

Improve native user interface dropdown example? #7185

j9t opened this issue Oct 7, 2021 · 5 comments
Labels
i18n-alreq Notifies Arabic script experts of relevant issues i18n-hlreq Notifies Hebrew script experts of relevant issues i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.

Comments

@j9t
Copy link
Contributor

j9t commented Oct 7, 2021

The first example in 15.7.4 features a select element with a number of ltr options.

The code looks unnecessarily verbose given that dir=ltr could just be set once on the select element (instead of repeating it on each option element). On the other hand, the introductory note “given the punctuation in some of their names” (emphasis mine) suggests that not all option elements may have been meant to be left-to-right.

I might be missing something else, but maybe the code could be simplified, or one or more right-to-left options added to strengthen the point.

@annevk
Copy link
Member

annevk commented Oct 8, 2021

If the options come out of a database the simplification might actually be somewhat involved. Is there a programming language with a RTL name?

@j9t
Copy link
Contributor Author

j9t commented Oct 8, 2021

Made me curious. Wikipedia has a list of non-English languages. Jeem (ج?) could be one candidate.

@annevk annevk added i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. i18n-alreq Notifies Arabic script experts of relevant issues i18n-hlreq Notifies Hebrew script experts of relevant issues labels Oct 8, 2021
@annevk
Copy link
Member

annevk commented Oct 8, 2021

Interesting. Let's see if @whatwg/i18n can help with this if they have the bandwidth.

@annevk
Copy link
Member

annevk commented Oct 8, 2021

It also struck me we might want to set the lang attribute for those option elements.

@r12a
Copy link

r12a commented Oct 8, 2021

I think partially Anne's right (see below). It depends partly on how the select element has been constructed. If it were hand coded and static, i'd generally agree that the fewer the dir attributes the better. If it's constructed at run time from a database, you'd need to specify the base direction for each of the 'problematic' items with the punctuation (but not necessarily for FreePascal, which is presumably why it says 'some of their names' – because a name without punctuation is unambiguous in terms of the arrangement of characters). Hopefully, the database will contain metadata of some kind to indicate that these particular items (of which we have a nice collection here) need to have special treatment to display correctly, and it's that which would drive the addition of the dir attribute markup.

However, there's another reason not to put the dir on the select element. For example, it would change the layout of the select control with a size attribute from this:

Screenshot 2021-10-08 at 13 58 58

to this:

Screenshot 2021-10-08 at 13 55 58

Note that not only are the names left aligned (which would include a name such as ج (Jeem)), but the scrollbar has moved to the wrong side of the pulldown box for an RTL page.

Without the size attribute similar things happen (try it), but it's not completely consistent across browsers at the moment.

hth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-alreq Notifies Arabic script experts of relevant issues i18n-hlreq Notifies Hebrew script experts of relevant issues i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response.
Development

No branches or pull requests

3 participants