How to translate strings to your own language

As of May 2020, Enfold already has translations for following languages included:

  • Arabic
  • Catalan
  • Chinese (Simplified)
  • Chinese (Taiwan)
  • Czech
  • Danish
  • Dutch
  • French
  • German
  • German (Switzerland)
  • German (Formal)
  • Greek
  • Hebrew
  • Hungarian
  • Italian
  • Japanese
  • Korean
  • Norwegian
  • Persian
  • Polish
  • Portuguese (Brazil)
  • Romanian
  • Russian
  • Slovak
  • Spanish
  • Swedish
  • Turkish

Translations are contributed by fellow Enfold users and some of them are not 100% complete. That is because we  add new strings with almost each update and users who contributed translations only needed to translate the strings on front-end. If you would like to contribute translations, you can download latest versions of language files here and then post them in this thread. If you have a GitHub account or do not mind creating one, you can make pull requests. Instructions can be found here.

Thanks a lot to all contributors! We and whole Enfold community appreciate your effort 🙂

If you would like to translate untranslated strings or update existing strings, you can use Loco Translate plugin or Poedit software.

With Loco Translate, you can edit strings from WordPress dashboard.

After installing the plugin, please go to Loco Translate -> Themes -> Enfold -> Advanced configuration tab and insert  “lang/enfold.pot” in “Template file” field.

Then, please go to Loco Translate -> Settings -> Site Options -> Extracting strings and insert “99999K” in “Skip PHP files larger than:” field.

It is important to sync files before updating to make sure all available strings are ready for translation. To sync files in Loco Translate, please go to Loco Translate -> Themes -> Enfold -> Overview tab -> Edit Template tab, click Sync button and Save. Then go to Loco Translate -> Themes -> Enfold -> Overview tab, choose your language, click Sync button and Save.

After syncing files, you are ready to update language files 🙂

You can find language files inside /wp-content/themes/enfold/lang/ folder and edit .po files using Poedit.

Before translating your strings, please make sure to click “Update” button and save.

After updating the strings, you can replace new file with the old one located in /wp-content/themes/enfold/lang/ folder.

How to translate sites built with Enfold using WPML

Enfold and the Avia Layout Builder are fully compatible with WPML. With WPML, you can turn your site into a multilingual one in minutes.

Getting started with WPML

To translate a site built with Enfold and the Avia Layout Builder, you need a WPML Multilingual CMS or Agency account. This gives you access to the WPML core plugin and String Translation add-on which allows you to translate:

  • Pages
  • Posts
  • Portfolio posts
  • Menus
  • Taxonomies

…and more.

To install WPML, start by installing the OTGS Installer plugin. This prompts you to register your site and starts the WPML setup wizard automatically.

Activating WPML

Use the setup wizard to choose your site’s languages, decide on your URL format, and pick a translation mode.

WPML’s setup wizard

Translation options with WPML

WPML offers two different translation modes depending on how you would like to translate your site. You can choose your translation mode when going through the setup wizard for the first time or from the WPMLSettings screen.

Translate Everything

If you’re looking for the quickest and easiest way to translate your site, Translate Everything is it! It automatically translates posts, pages, WooCommerce products, and taxonomy with just one click.

Translating your site automatically with Translate Everything

Plus, as you edit content, Translate Everything translates those updates in the background. This means your translations are never out of date.

Automatic translations are powered by Google Translate, Microsoft Azure, or DeepL. When your translations are complete, you can review and edit them to make sure they sound correct and natural. Or, you can hire a translation reviewer to do it for you.

Reviewing your automatic translations

Translate Some

If you want more control over what parts of your site get translated or you want someone else to do the translating, you can enable Translate Some.

You can choose to translate your content yourself, add other translators to your site, or hire a professional translation service. Then, go to WPMLTranslation Management and choose what to translate.

Choosing content to translate

If you translate content yourself or add translators to your site, translations are done via WPML’s Advanced Translation Editor. This easy-to-use translation tool includes advanced features such as automatic translation, translation memory, a spell checker, and a glossary.

Translating your site’s content using WPML’s Advanced Translation Editor

Translating Custom Element Templates (CETs)

If you use Translate Everything mode, your Custom Element Templates are automatically translated along with the rest of your content.

If you use Translate Some mode, you can translate your CETs by choosing the ALB Custom Element post type from the Translation Management dashboard. If you have a CET that uses sub-items, be sure to translate the element along with all its related sub-items.

Translating a Custom Element Template from the Translation Management Dashboard

When adding a translated CET to a page or post, be sure to translate the page in order for the translations to show on the front-end.

Setting theme options per language or globally

You can set your theme options for each of your languages. To do this, go to EnfoldTheme Options, and choose your site’s secondary language via the language switcher.

Setting theme options per language

You can choose the same settings if you want your translated site to have the same layout, or you can create completely different layouts for each language. If you would like to choose the same settings for your translated site, you can enable “Keep Global Layout Options Synchronised” option in Enfold theme options > WPML Options Management section.

More information about translating your site with WPML

Check out WPML’s documentation for more in-depth instructions about translating sites built with Enfold and the Avia Layout Builder.

Child Theme Translations

In case you want to modify something in an Enfold translation you can do it by directly editing the translation file. However, if you update the theme these modifications will be lost. To avoid this, it is recommended to use a child theme approach, here’s how to do it.

Step 1

Create a /lang/ folder in your child theme directory and copy (from the parent theme) the translation files to be modified:

Step 2

Add the following to your child theme functions.php file:

function overwrite_language_file_child_theme() {
    $lang = get_stylesheet_directory().'/lang';
    return $lang;
add_filter('ava_theme_textdomain_path', 'overwrite_language_file_child_theme');

Now the translations found in your child theme /lang/ folder will be loaded instead.

Translating the portfolio slug with WPML

Since Enfold 2.4.4 we use the _x() function to translate the portfolio post type slugs. It’s the default (and recommended) solution to translate post type slugs with WPML. Please note that you must install the String Translation extension first – otherwise you can’t translate the slug(s).

After you installed both plugins and Enfold go to the WordPress Dashboard (admin screen) and select “WPML” > “Translation options” from the sidebar menu. A new option page will load – search for the “Translate custom posts slugs (via WPML String Translation).” checkbox and tick it (=activate this setting). Then click the blue “Save” button.

Afterwards search for the “Custom post types” option field on the same option page. It will look like:

Note that you need to tick the checkbox below “Portfolio Items” – otherwise you won’t see the slug translation options for the post type. WPML enables you to translate the slug for each registered language except the standard language. Enter your custom text/translation into the text field(s) and then save the settings.

Eventually select “Settings” > “Permalinks” from the sidebar menu. You’ll notice a “Portfolio Entry Settings” section near the bottom of the permalink option page which enables you to change the slug for the standard language. By default the “Portfolio Items Base” option is set to “portfolio-item” and the “Portfolio Categories Base” is set to “portfolio_entries”. You can replace the default values with some custom text – however you must not use special characters or spaces.

Last but not least save the permalink settings by clicking the “Save Changes” button. Please save the permalink settings even if you didn’t change the default slug rules because the saving process forces WordPress to clear/flush the slug rewrites rules.