|
751 | 751 | li>
|
752 | 752 | ol>
|
753 | 753 | li>
|
| 754 | + <li>Let <var>uiLangvar> be null. |
| 755 | + li> |
| 756 | + <li data-link-for="PaymentDetailsInit">If |
| 757 | + <var>detailsvar>["<a>langa>"] is present: |
| 758 | + <ol> |
| 759 | + <li>If <a data-cite= |
| 760 | + "ecma-402#sec-isstructurallyvalidlanguagetag">IsStructurallyValidLanguageTaga>(<var>detailsvar>["<a>langa>"]) |
| 761 | + is false, throw a <a>RangeErrora>. |
| 762 | + li> |
| 763 | + <li>Set <var>uiLangvar> to <a data-cite= |
| 764 | + "ecma-402#sec-canonicalizelanguagetag">CanonicalizeLanguageTaga>(<var>detailsvar>["<a>langa>"]). |
| 765 | + li> |
| 766 | + ol> |
| 767 | + li> |
754 | 768 | <li>Let <var>requestvar> be a new <a>PaymentRequesta>.
|
755 | 769 | li>
|
| 770 | + <li>Set <var>requestvar>.<a>[[\uiLang]]a> to <var>uiLangvar>. |
| 771 | + li> |
756 | 772 | <li>Set <var>requestvar>.<a>[[\options]]a> to <var>optionsvar>.
|
757 | 773 | li>
|
758 | 774 | <li>Set <var>requestvar>.<a>[[\state]]a> to "<a>createda>".
|
|
935 | 951 | <li>
|
936 | 952 | <p>
|
937 | 953 | Otherwise, present a user interface to allow the user to interact
|
938 |
| - with the <var>handlersvar>. The user agent SHOULD prioritize |
939 |
| - the preference of the user when presenting payment methods. |
| 954 | + with the <var>handlersvar>. Optionally, if |
| 955 | + <var>requestvar>.<a>[[\uiLang]]a> is not null, localize the |
| 956 | + user interface to match, as closely as possible, the language of |
| 957 | + <a>[[\uiLang]]a>. The user agent SHOULD prioritize the |
| 958 | + preference of the user when presenting payment methods. |
940 | 959 | p>
|
941 | 960 | <p>
|
942 | 961 | For the <a>payment handlera> selected by the end-user, the user
|
|
1286 | 1305 | accepts the payment request.
|
1287 | 1306 | td>
|
1288 | 1307 | tr>
|
| 1308 | + <tr> |
| 1309 | + <td> |
| 1310 | + <dfn>[[\uiLang]]dfn> |
| 1311 | + td> |
| 1312 | + <td> |
| 1313 | + The merchant-preferred language in which to localize the UI when |
| 1314 | + <a>show()a> is called. |
| 1315 | + td> |
| 1316 | + tr> |
1289 | 1317 | table>
|
1290 | 1318 | section>
|
1291 | 1319 | section>
|
|
1575 | 1603 | dictionary PaymentDetailsInit : PaymentDetailsBase {
|
1576 | 1604 | DOMString id;
|
1577 | 1605 | required PaymentItem total;
|
| 1606 | + DOMString lang; |
1578 | 1607 | };
|
1579 | 1608 | pre>
|
1580 | 1609 | <aside class="note">
|
|
1586 | 1615 | <a>PaymentDetailsBasea> dictionary, the following members are part
|
1587 | 1616 | of the <a>PaymentDetailsInita> dictionary:
|
1588 | 1617 | p>
|
1589 |
| - <dl> |
| 1618 | + <dl data-sort=""> |
| 1619 | + <dt> |
| 1620 | + <dfn>langdfn> member |
| 1621 | + dt> |
| 1622 | + <dd> |
| 1623 | + A [[!BCP47]] language tag representing the preferred language of |
| 1624 | + the financial transaction. The <a>langa> member serves as a hint |
| 1625 | + to the user agent, optionally allowing the user agent to localize |
| 1626 | + the payment UI to be in the same language as the document that made |
| 1627 | + the request for payment. |
| 1628 | + dd> |
1590 | 1629 | <dt>
|
1591 | 1630 | <dfn>iddfn> member
|
1592 | 1631 | dt>
|
|
0 commit comments