Translations

How to translate your website

Online Docs Available Looks like you are looking at the offline docs. You can find possibly more up to date docs online here

Translation Basics

In order to make WordPress recognize the language to which you want to translate the core WordPress, the theme or the plugins, you have to define the language within the wp-config.phpfile or change a setting within the dashboard.

Login to your FTP account and edit the wp-config.phpfile. In the wp-config.php file, look for WPLANG constant which looks like the following code:

define(‘WPLANG’, ”);

Define the WPLANG constructor by adding the ISO language code of your language. The names consist of locals, a combination of language and regional dialect. Examples: de_DE, nl_NL, es_ES (for more info see here: ISO language codes).

E.g. for translating to Deutsch language, change the WPLANG constant will look like the following code:

define(‘WPLANG’, ‘de_DE’);

For Wordpress 4.0 or 4.0+ Users:
After the wp-config.php file is edited, login to WP-admin dashboard and navigate to Settings -> General Settings page. Make sure Site Languageoption is set correctly.

Translating the theme with POEdit

No matter if you are setting up a complete new language file or if you just want to edit a translation of one of the pre built language files, the steps to take are easy and more or less the same. There are many .po editors to choose from, but we suggest POEditas it is easy to use, it is available for all platforms and it is freeware.

Download POEdit from POEdit download.

Translation files

Your translation files should be located inside the /languages folder in the root folder of the theme. When you first download the theme, there will be a lambda_front.potfile that you need to edit in order to setup you preferred language's translation.

Install POEdit

Visit the Translator Handbook for more info on how to Download & Install POEdit.

Download POEdit from POEdit download.

Translate the theme

In order to start a new translation follow these steps

  1. Open the Lambda_front.potin POEdit and you will find all English text strings in the left column (“Source Text”). Once you add translations those will show up in the right column (“Translation”).
  2. Choose the line you want to translate and then check the lower part of the POEdit window where you will find a textarea to add the correct translation.
  3. When you are done translating all needed strings save the file with your language code, for example: de_DE.po. The corresponding .mo file will be auto created. Make sure both are in Lambda/languagesfolder. Everytime you update the .po file, make sure to upload both .po and the compiled .mo file in Lambda/languagesfolder.


In orderto edit a pre built language file follow these steps

  1. Open the .po file of your language in POEdit and search for the line you want to change. To do so select Edit > Find (windows)or Edit > Search (OSX)respectively from the menu.
  2. In the search window type the string you are looking for. Once it is selected, delete the text from the Translationtextarea in the lower part of the window and enter your prefered translation.
  3. Save the file. The updated .mo file will be auto created. Make sure both are in Lambda/languages folder

Updating the translations

Updating your translations after a theme update is usually not required. If you want to keep your customized translations and add any new strings that have been added to a new version of the theme, you can update from the .pot file to get the new strings to your file. Follow these steps to do so

  1. Copy your existing custom language folder from your current theme version to the updated version’s language folder.
  2. Open it in POEdit. Choose Catalogue > Updatefrom POT file and in the opening file dialog choose the lambda_front.potfile. The catalogue will be auto updated then with all new strings and your custom ones will be preserved.
  3. Don’t forget to save the file once you are done updating and adding translations.

Translating the theme with WPML

Lambda is fully compatible with the WPMLplugin. WPML consists of several modules. The basic module turns WordPress sites multilingual. Other modules help with an enhanced translation process, string translation, media translation and other functions.

Getting the WPML Plugin

You can download the WPML plugin from wpml.org.

It is advised to install WPML after importing the demo content

Adding Language Switcher

To add a language switcher to your website you need to go to Appearance->Widgets and add the Lambda - WPML Language Selector Widget to the desired widget position. You can add the widget to any widget position you wish.

It is strongly suggested that if the option Show as dropdown is enabled, the widget should only be placed in the Menu Bar for it to show as a menu item.

Translating theme text

When you want to translate a page or a post, go to your posts or page admin screen. You will see a list of pages. You see columns for each active language, with a pencilicon (for ‘edit translation’) or a ‘ +’ icon (for ‘add translation’) next to each page. WPML

Once you click on the '+' or the pencil icon, you should be taken to page editing.

WPML

Translating Strings in the theme

An important part of the translation process is translating the strings that exist inside the theme. Locate these strings from WPML->Theme and plugins localization. From the next page, you need to click on the Scan the theme for strings, which will scan the theme for strings that can be translated, and will create a table with the domains that hold translatable strings. WPMLClick on the View strings that need translation button of the domain that you want to translate. If you want to translate the frontend strings of Lambda, edit the lambda-tddomain. From the next screen, clicking on the translations link should allow you to add translations for all the available languages. WPML

Translating custom post types and taxonomies

Lambda comes with a rich set of custom post types such as portfolios and sliders, and custom taxonomies. In order to get a similar interface for translation/duplication as for posts and pages, you need to go to WPML->Translation Management, and select the tab ‘Multilingual Content Setup’. At the bottom of the page you’ll see: WPML

You need to select ‘translate’ for the custom post types you want to make translatable. Similarly, if you choose ‘translate’ for custom taxonomies such as Departments, etc. you’ll get a similar interface for translation as for page categories.

Translating Widgets

Widgets are translated from WPML->String Translation. Refer to How to Display Different Widgets Per Language for more info on how to translate your widgets.

Translating theme options

Theme animations are also translated from WPML->String Translation. If you filter through theme lambda-admin-tdfrom the Select strings within contextfilter, you should have all the backend strings that can be translated. Alternatively, if you are searching for a specific string, you can use the Search form. WPML