|
2 | 2 | <html lang="en" dir="ltr">
|
3 | 3 | <head>
|
4 | 4 | <meta charset="utf-8"/>
|
| 5 | + <meta name="color-scheme" content="light dark"> |
5 | 6 | <title>Internationalization Best Practices for Spec Developers</title>
|
6 | 7 |
|
7 | 8 | <!--
|
@@ -552,9 +553,9 @@ <h3>Identifying the language of strings</h3>
|
552 | 553 | <p>[[[#bidi_strings]]].</p>
|
553 | 554 | </div>
|
554 | 555 |
|
555 |
| -<div class="note"> |
| 556 | +<div class="note" id="string_meta_progress"> |
556 | 557 | <p>Work on language and direction metadata for string formats is a work in progress. Specifications might need to include a note indicating the need for future adoption of metadata. Here is a prototype:</p>
|
557 |
| - <p class="example_note" style="background-color:white;border:1px solid green;padding:10px">The field <code>{fieldname}</code> should follow the best practices found in <cite>Strings on the Web: Language and Direction Metadata</cite> [[STRING-META]]. This includes making use of any future standards which emerge regarding the reporting of string language and direction metadata.</p> |
| 558 | + <p class="example_note">The field <code>{fieldname}</code> should follow the best practices found in <cite>Strings on the Web: Language and Direction Metadata</cite> [[STRING-META]]. This includes making use of any future standards which emerge regarding the reporting of string language and direction metadata.</p> |
558 | 559 | </div>
|
559 | 560 |
|
560 | 561 | <div class="req" id="bp_lang_field_based_metadata">
|
@@ -847,18 +848,18 @@ <h4>Inline changes to base direction</h4>
|
847 | 848 | <p>Suppose an implementation assembled a string by concatenating various values together. For example, the description of a monitor attached to a system. This label might contain the brand name and model number (<kbd>Brand A123B</kbd>); resolution (<kbd>(1920 x 1080)</kbd>); size and type (<kbd>36" monitor</kbd>); as well as various features like a refresh rate of <kbd>75 Hz</kbd> or response time of <kbd>4 ms</kbd>. The resulting string in English might look like this (color has been added to make the effects more visible):</p>
|
848 | 849 |
|
849 | 850 | <p class="spilloverExample" dir="ltr"><code>
|
850 |
| -<span style="color:red">Brand A123B</span> <span style="color:blue">(1920 x 1080)</span> <span style="color:green">36"</span> <span style="color:purple">monitor</span>, <span style="color:orange">75 Hz</span>, <span style="color:brown">4ms</span> |
| 851 | +<span style="color:red">Brand A123B</span> <span style="color: var(--spillover-example-resolution)">(1920 x 1080)</span> <span style="color:green">36"</span> <span style="color:var(--spillover-example-monitor)">monitor</span>, <span style="color:orange">75 Hz</span>, <span style="color:brown">4ms</span> |
851 | 852 | </code></p>
|
852 | 853 |
|
853 | 854 | <p>If the same implementation assembling this string were on a system running in a locale that uses a right-to-left language (such as the Arabic examples shown below), the results of the same concatentation might look something like this:</p>
|
854 | 855 |
|
855 | 856 | <p class="spilloverExample" dir="rtl"><code>
|
856 |
| -<span style="color:red">ماركة A123B</span> <span style="color:blue">(1920 x 1080)</span> <span style="color:green">36"</span> <span style="color:purple">شاشة الكمبيوتر</span>، <span style="color:orange">75 Hz</span>، <span style="color:brown">4 مللي ثانية</span></code></p> |
| 857 | +<span style="color:red">ماركة A123B</span> <span style="color: var(--spillover-example-resolution)">(1920 x 1080)</span> <span style="color:green">36"</span> <span style="color:var(--spillover-example-monitor)">شاشة الكمبيوتر</span>، <span style="color:orange">75 Hz</span>، <span style="color:brown">4 مللي ثانية</span></code></p> |
857 | 858 |
|
858 | 859 | <p>The logical sequence of sub-strings remains the same, but the visual presentation is no longer intelligible. Notice how different parts of the description have become broken up and mixed together. The addition of isolating bidirectional controls (either markup or, when not available, Unicode control characters) to the above string produces better results:</p>
|
859 | 860 |
|
860 | 861 | <p class="spilloverExample" dir="rtl"><code>
|
861 |
| - <span style="color:red" dir="rtl">ماركة A123B</span> <span style="color:blue" dir="ltr">(1920 x 1080)</span> <span style="color:green" dir="ltr">36"</span> <span style="color:purple" dir="rtl">شاشة الكمبيوتر</span>، <span style="color:orange" dir="rtl">75 Hz</span>، <span style="color:brown" dir="rtl">4 مللي ثانية</span> |
| 862 | + <span style="color:red" dir="rtl">ماركة A123B</span> <span style="color: var(--spillover-example-resolution)" dir="ltr">(1920 x 1080)</span> <span style="color:green" dir="ltr">36"</span> <span style="color:var(--spillover-example-monitor)" dir="rtl">شاشة الكمبيوتر</span>، <span style="color:orange" dir="rtl">75 Hz</span>، <span style="color:brown" dir="rtl">4 مللي ثانية</span> |
862 | 863 | </code></p>
|
863 | 864 | </aside>
|
864 | 865 |
|
|
0 commit comments