Documentation Localizing & Translating Themes

Localizing & Translating Themes

Overview #

For localizing and translating themes, you can use the built-in i18n features available in WordPress.

Below, we’ve outlined a few things to keep in mind.

↑ Top ↑

“default” textdomain #

On WP.com, you need to use the “default” textdomain when loading the translations. You can use any textdomain you like in the translation functions, but strings should be loaded with the “default” textdomain.

$textdomain = true === WPCOM_IS_VIP_ENV ? 'default' : 'vip';

if( file_exists( $mofile ) )
        load_textdomain( $textdomain, $mofile );

// __( 'My translatable string', 'vip' );

↑ Top ↑

Translation conflicts #

If the translations in your theme conflict with existing translations on WordPress.com, you have two options:

  • If your translation is better/more accurate, you can submit it via our GlotPress instance
  • Use the _x and friends (_ex, _nx, etc.) with an added context so that translations in your theme are given priority over others.