Theme Translation in rtDating

Translation Basics

WordPress uses the GNU gettext localization framework for translation.

rtDating theme contains a language file with the file ending .pot which you can use to translate the theme. This is the template file that contains a reference to each text string in your theme that needs translating. This file does not contain any translation.

Now the only thing you have to do is to create a new .po file from the .pot catalog file, translate all text strings and save the .po file with your language code. There are different ways to do this.

WPML Compatible

rtDating is WPML compatible. Please check https://rtmedia.io/docs/wpml/ for details.

Translating Using Poedit

POEdit is a fantastic program that gives you the ability to create your .pot file, and also provides an easy to use GUI that can be used to make your .po and, more importantly, your .mo files too.

  1. Install Poedit.
  2. Open Poedit and go to File > catalog from POT file and select the POT in theme’s languages folder.
  3. Translating a line of text is really easy – just select a word or phrase, enter your translation and click “Update.”
  4. When you’ve finishing translating, simply save your file. Poedit will automatically create both .po and .mo files in your theme’s languages folder.
  5. Now that your theme has been translated, you can upload it to your WordPress install either using FTP or by logging into your WordPress site and uploading your theme by going to Appearance > Themes > Install Themes (after you’ve zipped your theme, of course).

Setting Up WordPress

If you don’t use WordPress in your language so far, you have to tell WordPress which language to use to activate the theme translation.

You can do this by editing the wp-config.php file (the file is located in the main directory of your WordPress files) and defining the WPLANG constant. Your file should already containdefine('WPLANG', ''); but if it does not, you can add it in.

You simply need to add your language and locale code into the define. If you were to translate your theme into German, you would have this: define('WPLANG', 'de_DE');

Your translation is complete!