Views, Content Templates, and WordPress Archives are Toolset elements that provide important features for your layouts. They include HTML, text, and fields. You need to translate all of the “hardcoded” texts that appear in them.

A simple Content Template can look like this:

When you look at a house, displayed with this Content Template on the front-end, you will see these:

Single house page displayed with a Content Template - English (the site primary language).
Single house page displayed with a Content Template – English (the site primary language).

Single house page displayed with a Content Template - Spanish. The content displays in the proper language except for the field labels.
Single house page displayed with a Content Template – Spanish. The content displays in the proper language except for the field labels.

As you can see, everything looks right except for the field labels (size and area). This is because the labels are coming from our template and are not fields belonging to the content.

To translate them, we need to wrap the texts in wpml-string shortcodes.

Here is the same Content Template, after we’ve wrapped all texts in [wpml-string] shortcodes:

Now, you will find these new strings in WPML’s String Translation, where you can translate them.

Strings wrapped in the wpml-string shortcodes appear the in WPML String Translation panel.
Strings wrapped in the wpml-string shortcodes appear the in WPML String Translation panel.

When we visit the front-end houses, we will see everything translated, including the labels.

Single house page in Spanish with field labels translated.
Single house page in Spanish with field labels translated.

Views and Content Templates rely on the [wpml-string] shortcodes to translate their texts. If you are familiar with PHP templates, this is Toolset’s counterpart for GetText functions.

See some examples how to use the wpml-string shortcode in a View.

Instead of wrapping your strings manually with wpml-string shortcodes, you can use the Views GUI. Click the Fields and Views button and then Translatable string. A dialog box will open with a drop-down menu to select between all available contexts.

Inserting a translatable string using "Fields and Views" button
Inserting a translatable string using “Fields and Views” button

Selecting the context of the string to translate
Selecting the context of the string to translate

Please note that you will see this Translatable string button only if you have the WPML String Translation plugin activated.

Creating different Content Templates for different languages

First, go to the Toolset -> Settings page and click the WPML integration tab. There, enable the Create different Content Templates for each language option.

Enabling the Create different Content Templates for each language option
Enabling the Create different Content Templates for each language option

Now, when you to go to the Toolset -> Content Templates page, you can click a plus sign for a specific language to which you want to translate a content template into.

Setting a language for translation of content template
Setting a language for translation of content template

Depending on your Translation Management settings a translation editor will open up or you will be able to send a content template to your translators.

If you need to make any changes to existing translations, use the pencil icon for the language that you need to edit.

Edit existing translation
Edit existing translation

Translating Toolset templates designed using page builders

If you use a page builder to design your Content Templates you have to translate your templates.

Need help?

Ask us about translating Content Templates, WordPress Archives, and Views, and we’ll do our best to help.

For more elaborate questions, please use our Toolset Professional Support forum.