Internationalization and Localization

Make software translatable without concatenating language-specific assumptions into code.

2 min read

  • Article
  • Intermediate
  • 2 minutes read
  • Reviewed August 4, 2026
  • Advanced WordPress and integrations

Internationalization prepares software for translation.

Localization supplies translations and locale-specific adaptations for a target language or region.

WordPress commonly abbreviates internationalization as i18n and localization as l10n.

Text Domains

A theme or plugin uses a text domain to identify its translation catalogue.

Use one stable text domain consistently. Public directory projects follow naming requirements based on the project slug.

Translation Functions

WordPress provides functions for:

  • Returning translated text.
  • Echoing translated text.
  • Escaping translated text.
  • Adding translator context.
  • Handling singular and plural forms.
  • Translating JavaScript.

Select a function according to output and context.

Do Not Concatenate Sentences

Languages differ in word order, grammar and pluralization.

Use one complete translatable string with placeholders instead of assembling fragments.

Add translator comments when placeholders or context are not obvious.

Placeholders

Use numbered placeholders when translators may need to reorder values.

Escape inserted values according to the final output context.

JavaScript Translation

WordPress supports JavaScript i18n through packages such as @wordpress/i18n.

Register script translations with wp_set_script_translations() and generate JSON translation files through the supported build process.

Dates, Numbers and Locale

Translation is not only replacing words.

Use WordPress functions and locale-aware APIs for dates, numbers, time zones and language direction.

Avoid hard-coded English date order and punctuation.

Frequently Asked Questions

Is translating the interface the same as creating a multilingual website?

No. Software localization and public multilingual content are related but separate systems.

Can variable content be placed inside a translation string?

Yes, through placeholders with context and correct escaping.

Continue Learning

Previous: WordPress Multisite

Next: WordPress Coding Standards