Translate Extra - kary4/divituts GitHub Wiki
Before you start translating Extra you need to download the en_US.pot translation file manually from here: https://www.elegantthemes.com/downloads/Extra-po-files.zip and locate it under the Extra/lang folder.
To translate Extra theme correctly:
-
Download and install the poedit software: https://poedit.net/download
-
Navigate with FTP to wp-content\themes\Extra\lang And download the en_US.pot file to your desktop.
-
Open the en_US.pot file with the poedit software, and click the Create new translation button below (https://www.elegantthemes.com/forum/download/file.php?id=289582).
-
Select the new language e.g. "Hungarian" and start translating the strings (https://www.elegantthemes.com/forum/download/file.php?id=289580) (You do not have to translate all the strings. You can search for a specific string by pressing ctrl+F or cmd+F).
-
When you finish translating the strings, click save. Poedit will generate two new files (a MO and a PO file).
-
Now all you need to do is moving the translation to child theme:
- Create a folder in your child theme called lang
- Move those two files (MO and PO) into this new created folder
- Add this code in your child themes's functions.php file:
function c_lang_function() {
load_child_theme_textdomain( 'extra', get_stylesheet_directory() . '/lang' );
}
add_action( 'after_setup_theme', 'c_lang_function' );
- You can now alter the translated strings directly within your WordPress installation using the Loco Translate plugin (https://wordpress.org/plugins/loco-translate/).
This is a quick video on how to translate: http://screencast-o-matic.com/watch/cDfYXV15Jb
Anyway, there is an alternative method to translate Extra words using a script. You can check the following ticket in ET Support forum to understand how that works: https://www.elegantthemes.com/forum/viewtopic.php?f=191&t=644582