w3c / w3c/string-meta

Would language +(sometimes) script information suffice for ambiguous cases?

Open
#9 1 comment 0 reactions 1 assignee View on GitHub

@aphillips is already working on this.

Since Nov 24, 2017.

close?
Dominant language
HTML
Stars
16
Forks
10
PR merge metrics
No merged PRs in 30d

Description

This issue uses examples at https://w3c.github.io/i18n-drafts/articles/strings-and-bidi/index.en
The ideas are not particularly coherent yet (apologies).

--
When the article inserts ALM at the start of a numeric string, it does so because it knows that the language is Arabic (and, importantly, not Persian, which uses the same script). Of course the application also needs to know that this is a range, expression or numeric date.

For the other remaining difficulty after isolation has been applied (ie. the titles that start with 'CSS' but should have a base direction of RTL), could we also solve the problem if we know that these strings are arabic, persian and hebrew, and that therefore the expected base direction would be RTL?

Note that sometimes the script subtag may be important eg. az-Cyrl, other times not.

--
It would fail if you tried to apply the base direction based on the language of the surrounding context, ie. the direction of the card in the examples, ie. if you surrounded the inserted strings with not just , but because the language of the card is Arabic.

Although this would fix the problems with the translated titles in RTL scripts, which isolation alone doesn't, it breaks the japanese and english titles by pushing the exclamation mark to the left.

Note that the exclamation mark at the end sounds trivial, but it also represents what happens with examples such as "The book مغامرة جديدة is good.", where 'the book' and 'is good' get swapped over (not good).

--
I think it works, however, by looking at the language of each individual string, and setting the direction of the element (or equivalent) on that basis, maybe that would be better. (However, how often can you expect to have that information available?)

As long as the english title is labelled as 'en' and the arabic title as 'ar', that should produce the right result, eg. we may be able to use something like the JSON-LD format without adding direction metadata(?)

A problem with this approach is that it requires the application to consult a lookup table to determine which direction to apply for each string as it is inserted.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.