Localizing & Translating Themes

WordPress.com VIP platform specific

This document is for sites running on WordPress.com VIP.

Learn more

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 ↑

Using the correct locale #

language files need to be in the format of es.mo, fr.mo, and not es_ES.mo or fr_CA.mo

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

if( file_exists( $mofile ) )
         load_theme_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.

Ready to get started?

Drop us a note.

No matter where you are in the planning process, we’re happy to help, and we’re actual humans here on the other side of the form. 👋 We’re here to discuss your challenges and plans, evaluate your existing resources or a potential partner, or even make some initial recommendations. And, of course, we’re here to help any time you’re in the market for some robust WordPress awesomeness.