Internationalization is more than character encoding
UTF-8 lets a system store and exchange Unicode text. It does not translate content, choose the right date format, or make a layout work for every writing direction. Treat encoding as one part of internationalization, not the whole job.
Declare the language of each page
Set the document language so browsers and assistive technology can select pronunciation and text-processing rules. For an English page, use <html lang="en">; for German, use <html lang="de">. Set the language on a passage when it differs from the surrounding page.
Keep text as text
Store Unicode text in a consistent encoding such as UTF-8, and use libraries that preserve Unicode through input, storage, search, and output. Avoid assuming every user-visible symbol is one byte, one code point, or one JavaScript string unit. Test combining marks, emoji sequences, and non-Latin scripts with the same operations your application uses for validation and truncation.
Format numbers and dates for a locale
Do not build localized output by adding separators to numbers or rearranging date fields by hand. Browser APIs can apply locale conventions:
const locale = "de-DE";
const amount = new Intl.NumberFormat(locale, {
style: "currency",
currency: "EUR"
}).format(1234.5);
const date = new Intl.DateTimeFormat(locale, {
dateStyle: "long"
}).format(new Date("2026-10-01T12:00:00Z"));The formatted result depends on the selected locale and runtime data. Keep machine-readable dates and amounts separate from their localized display strings.
Plan for right-to-left text
Arabic and Hebrew text can run right to left while embedded numbers or Latin text run left to right. Use semantic direction metadata such as dir="rtl" where appropriate, and prefer CSS logical properties like margin-inline-start over hard-coded left and right margins. Test mixed-direction names, punctuation, links, and form fields in context.
Use complete translations and correct plural rules
Text can expand when translated, and some languages use more than singular and plural forms. Avoid concatenating sentence fragments such as “You have ” + count + “ messages.” Use a localization library or message format that supports placeholders, plural categories, and reordered sentence parts. Allow room for longer labels and translated navigation.
Test with real language examples
- Check names and addresses with accents, apostrophes, hyphens, and scripts your users enter.
- Test sorting and searching with the locale rules your product promises.
- Review keyboard order, line wrapping, truncation, and form errors in both left-to-right and right-to-left layouts.
- Keep original user input where it matters; normalization, transliteration, and case folding are distinct transformations.
- Verify that email, CSV, exports, logs, and database connections preserve the same text as the interface.
Unicode’s normalization FAQ explains when equivalent code-point sequences need consistent comparison. For web encoding declarations, see the W3C guide.