Re: [w3c/payment-request] Implementation examples of PaymentAddress.languageCode (#608)

Yep, we use [BuildComponents()](https://github.com/googlei18n/libaddressinput/blob/3cefac503f6321f7f84a790939dc7cb022bce169/cpp/include/libaddressinput/address_ui.h#L40) function in our implementation.

```cpp
// Returns the UI components for the CLDR |region_code|. Uses the strings from
// |localization|. The components can be in default or Latin order, depending on
// the BCP 47 |ui_language_tag|.
//
// Sets the |best_address_language_tag| to the BCP 47 language tag that should
// be saved with this address. This language will be used to get drop-downs to
// help users fill in their address, and to format the address that the user
// entered. The parameter should not be NULL.
//
// Returns an empty vector on error.
std::vector<AddressUiComponent> BuildComponents(
    const std::string& region_code,
    const Localization& localization,
    const std::string& ui_language_tag,
    std::string* best_address_language_tag);
```
This language tag is especially useful for countries that present their addresses in two different ways depending on the language tag. For example, `ja-JP` language tag results in country being displayed on top, whereas `ja-Latn` language tag results in country being displayed on the bottom of the address.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/608#issuecomment-327174778

Received on Tuesday, 5 September 2017 13:28:35 UTC