Skip to content
Docs

Translate the Stax theme

The Stax theme is translation ready: every text it prints uses the stax text domain, and the template file with all strings is wp-content/themes/stax/languages/stax.pot. To translate it, set your site language, then create a translation with Loco Translate (inside WordPress) or Poedit (on your computer).

This page covers the texts that come from the theme, such as “Search results for” or “Leave a comment”. To run a site in several languages, see Multilingual site with WPML.

  1. Go to Settings > General.
  2. Choose your language in Site Language.
  3. Click Save Changes.

WordPress loads a theme translation only when it matches the site language (or the language a user picked in their profile).

File What it is
stax.pot The template: all theme strings in English, without translations. Never edit it.
.po Your translation in readable form, one per language, for example stax-fr_FR.po
.mo The compiled file WordPress actually loads, generated from the .po file

WordPress looks for the Stax translation in two places:

  • wp-content/languages/themes/stax-fr_FR.mo (replace fr_FR with your locale). Theme updates do not touch this folder, so put your files here.
  • wp-content/themes/stax/languages/fr_FR.mo. A theme update deletes files in this folder.

Loco Translate is a free plugin that edits translations in the WordPress dashboard and compiles the .mo file for you.

  1. Install and activate Loco Translate from Plugins > Add New Plugin.
  2. Go to Loco Translate > Themes and click Stax.
  3. Click New language.
  4. Choose the language, then choose the location that starts with languages/loco/themes/. Loco Translate keeps this folder safe from theme and WordPress updates.
  5. Click Start translating.
  6. Select a source string in the list, type the translation in the box below, and repeat. Use the filter field to find a string.
  7. Click Save.

Loco Translate screen for a new Stax translation, with French selected and the location languages/loco/themes/stax-fr_FR.po chosen

After a theme update, open the translation again and click Sync to pull in new strings.

Poedit is a free desktop editor, useful when you do not want another plugin on the site.

  1. Download stax.pot from wp-content/themes/stax/languages on your server, or take it from the theme zip.
  2. Open Poedit and choose to create a new translation from a POT template, then select stax.pot.
  3. Pick the language of the translation.
  4. Select a source string and type its translation. Repeat for the strings you need.
  5. Save the file as stax-fr_FR.po, using your own locale code. Poedit writes stax-fr_FR.mo next to it.
  6. Upload both files to wp-content/languages/themes over FTP.
  • The locale in the file name must match the site language exactly, for example de_DE, not de.
  • The .mo file must exist. A .po file alone is not loaded.
  • Clear your page cache after uploading or saving a translation.
  • Texts you typed yourself (menu items, widget titles, header and footer builder content) are not theme strings. Change them where you entered them.