BlogsShopifyInternational Address Formatting

International Address Formatting

International Address Formatting

3
posts
2018–2023

Shopify has evolved its capabilities for handling international address formatting. Initial efforts focused on addressing the complexities of varying address structures, field ordering, wording, and translations across different countries. The solution involved creating a database of country-specific address formats, implementing dynamic form representation based on country selection, and developing a display representation that accounts for locale. This post details the challenges and best practices for front-end developers in internationalization (i18n), specifically addressing issues with hardcoded English grammar, interpolation, pluralization rules (including CLDR categories like zero, one, two, few, many, other), gendered nouns affecting articles and adjectives, and complex declensions. It emphasizes translating entire strings rather than using placeholders to accommodate linguistic variations.

2023

Lessons From Linguistics: i18n Best Practices for Front-End Developers - Shopify

3/16/2023

This post details best practices for front-end developers in internationalization (i18n), specifically addressing issues with hardcoded English grammar, interpolation, pluralization rules (including CLDR categories like zero, one, two, few, many, other), gendered nouns affecting articles and adjectives, and complex declensions. It emphasizes translating entire strings rather than using placeholders to accommodate linguistic variations.

2018

Handling Addresses from All Around the World - Shopify

11/14/2018

This post details the initial approach to handling international address formatting at Shopify. It outlines the problems encountered, including variations in address field ordering, wording, and translations across countries. The solution involves creating a database of country-specific address formats, defining dynamic form and display representations, and using translation keys for labels. An API endpoint and abstraction libraries are introduced to standardize access and simplify developer integration. The post also mentions future plans for caching.

Lost in Translations: Bringing the World to Shopify - Shopify

10/10/2018

This post details the technical challenges and solutions for internationalizing Shopify's platform, focusing on language-specific grammatical constructs like gender and pluralization. It describes the development of custom cops and linters to detect and correct hardcoded English strings, the automation of content extraction into dictionaries, the use of pseudolocalization with vowel doubling to mimic longer words and aid visual testing, the migration to UTF8 to support a wider range of characters in MySQL and Rails, and the creation of an internal "Translation Platform" that leverages GitHub and translation management system APIs to automate the translation request and commit process. It also outlines future challenges in internationalizing UX elements, maps, geography, number formatting, addresses, and phone numbers.