Skip to content

Commit

Permalink
Rename localized text object to localized text resource
Browse files Browse the repository at this point in the history
  • Loading branch information
christianliebel committed Jul 13, 2024
1 parent 56cb4ce commit 4f3da25
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1291,12 +1291,7 @@ <h3>
Localizing text resources
</h3>
<p>
For [=manifest/*_localized=] members that accept a [=string=] as
their value, the [=localized value=] can be either a [=string=] or
a [=localized text object=].
</p>
<p>
A <dfn>localized text object</dfn> is an [=ordered map=] with the
A <dfn>localized text resource</dfn> is an [=ordered map=] with the
following properties:
</p>
<dl>
Expand All @@ -1322,19 +1317,24 @@ <h3>
The [=text-direction=].
</dd>
</dl>
<p>
For [=manifest/*_localized=] members that accept a [=string=] as
their value, the [=localized value=] specified in the [=language
map=] can be either a [=string=] or a [=localized text resource=].
</p>
<p>
When a [=string=] is used, or when the
[=manifest/*_localized/lang=] or [=manifest/*_localized/dir=]
members of the [=localized text object=] are missing,
members of the [=localized text resource=] are missing,
[=manifest/*_localized/lang=] falls back the [=language tag=] of
the [=language map=] key, and [=manifest/*_localized/dir=] falls
back to the [=manifest/dir=] member of the [=manifest=].
</p>
<aside class="note" title=
"Optional members of the localized text object">
"Optional members of the localized text resource">
<p>
The [=manifest/*_localized/dir=] member of the [=localized text
object=] needs to be present if the direction of a localized
resource=] needs to be present if the direction of a localized
string differs from the default direction set in the manifest
([=manifest/dir=] member). Right-to-left text will require
specific direction settings if the manifest's default direction
Expand All @@ -1343,10 +1343,10 @@ <h3>
<p>
To support multilingual content and ensure optimal display and
accessibility, it is possible to specify a different [=language
tag=] for a [=localized value=]. This is needed for situations
where a term or text needs to be presented in a language
different from the user's set locale. For example, brand names
might need to be pronounced in a different language:
tag=] for a [=localized text resource=]. This is needed for
situations where a term or text needs to be presented in a
language different from the user's set locale. For example, brand
names might need to be pronounced in a different language:
</p>
<pre class="json">
{
Expand Down Expand Up @@ -1377,16 +1377,17 @@ <h3>
<li>Set |map|[|member|] to a new [=ordered map=].
</li>
<li>[=Set/For each=] |languageTag:string| of |languageTags|, run
[=process a localized text value=], passing
[=process a localized text resource=], passing
|languageMap|[|languageTag|] as the [=localized value=],
|languageTag|, |map|, |member|, and |manifest direction|.
</li>
</ol>
<p>
To <dfn>process a localized text value</dfn>, given [=string=] or
[=ordered map=] |localizedValue|, [=string=] |languageTag:string|,
[=ordered map=] |map:ordered map|, [=string=] |member:string|, and
[=text-direction=] |manifest direction:string|:
To <dfn>process a localized text resource</dfn>, given [=string=]
or [=ordered map=] |localizedValue|, [=string=]
|languageTag:string|, [=ordered map=] |map:ordered map|, [=string=]
|member:string|, and [=text-direction=] |manifest
direction:string|:
</p>
<ol class="algorithm">
<li>Let |normalizedValue:ordered map| be an [=ordered map=].
Expand Down Expand Up @@ -1424,10 +1425,10 @@ <h3>
</li>
</ol>
<p class="note">
The [=process a localized text value=] algorithm takes both a
[=string=] or a [=localized text object=] for the [=localized
The [=process a localized text resource=] algorithm takes both a
[=string=] or a [=localized text resource=] for the [=localized
value=] parameter, but the processed result will be normalized into
an [=localized text object=] with the
a [=localized text resource=] with the
[=manifest/*_localized/value=], [=manifest/*_localized/lang=], and
[=manifest/*_localized/dir=] members set.
</p>
Expand Down

0 comments on commit 4f3da25

Please sign in to comment.