Re: agenda+ getTextInfo in Intl

Hi Fuqiao,

I've added this to the agenda.

I'll pause for a second to supply some nuance. Intl.getTextInfo provides 
access to (CLDR provided) information about the default direction of a 
given locale (and thus language). This is useful for cases when the 
language is known and you want to set the direction of the page or 
various block elements (see for you example your work on describing 
mirroring). It is also useful for cases in which metadata is not 
present, but language is known. We talk about this in string-meta here:

 > https://www.w3.org/TR/string-meta/#script_subtag

We also don't forbid something like this outright. The best practice reads:

 > Specifications /SHOULD NOT/ allow a string direction 
<https://www.w3.org/TR/string-meta/#dfn-string-direction> to be 
interpolated from available language metadata 
<https://www.w3.org/TR/string-meta/#script_subtag> unless direction 
metadata is not available and cannot otherwise be provided.

That is, this can be a fallback but should not be the primary mechanism. 
Metadata always wins.

Both or either first-strong heuristics and language metadata can be 
wrong for any given string. Language/script do *imply* direction and the 
TextInfo API is useful for things like establish page layout when 
mirroring is needed. But it is not a substitute for getting the 
direction for a _specific_ string correct.

thanks!

Addison

On 7/22/2025 5:58 PM, Fuqiao Xue wrote:
> I recently discovered this:https://github.com/tc39/proposal-intl-locale-info?tab=readme-ov-file#text-information
>
> Intl seems to be able to infer the text direction through locale. I remember we kept mentioning "language/script does not imply direction" in the discussion of string meta. Will there be any problem with this?
>
> ~xfq

-- 
Addison Phillips
Chair (W3C Internationalization WG)

Internationalization is not a feature.
It is an architecture.

Received on Wednesday, 23 July 2025 15:14:27 UTC