Tutorial
Internationalization
ICU/CLDR
Beyond Meters and Miles: Mastering Measurement Unit Internationalization with CLDR and ICU
Internationalizing measurement units is deceptively challenging. At first glance, it seems as simple as multiplying a value and translating a label—until you realize that length alone is expressed in miles on a highway sign, in feet and inches for a person’s height, and in meters in a scientific article, often within the same country.
In this tutorial, we explore how Unicode CLDR and ICU make measurements read naturally for every user. You will learn how to:
- Show measurements in the units people expect for their region and context, such as road distances, weather, or a person’s height
- Convert between units, including splitting one value into combined units like feet and inches, with natural rounding
- Format units in the right grammatical case, such as nominative or dative, since many languages change how a unit is written depending on its role in a sentence
- Retrieve a unit’s grammatical gender, so you can make surrounding words, such as articles and adjectives, agree with it