Translating the Divi Theme into languages not included by default can enhance your website’s accessibility and appeal to a broader audience.
In this article, we will guide you through the process of creating and modifying translation files for the Divi Theme.
Divi is fully translated into 32 Languages and includes RTL support by default. However, there could be cases where your language is not included in the 32 available languages. For those cases, follow these steps:
Setting up WordPress to use your language
Go to WordPress Dashboard → Settings → General → Site language
Select the language you want to use
Save your changes
If no Child Theme is installed, install one
You can download a Divi Child Theme from this GitHub page
Go to Appearance → Themes → Add New → Upload Theme
Choose the zip file you have downloaded from the link above
Click on the Install Now button.
After the installation is completed, click on the Activate link
If a Child Theme is already installed
If you already have a child theme, you first need to make some changes to it.
Use an FTP connection, the hosting File Manager app, or the Advanced File Manager plugin
Navigate to the wp-content/theme/child-theme folder
Create a new folder and name it lang
Insite the lang folder, create two new folders, and name them:
theme
builder
Edit the functions.php file and add this PHP code (after the existing code)
/*================================================
#Load the translations from the child theme folder
================================================*/
function wpcninja_translation() {
load_child_theme_textdomain( 'Divi', get_stylesheet_directory() . '/lang/theme/' );
load_child_theme_textdomain( 'et_builder', get_stylesheet_directory() . '/lang/builder/' );
}
add_action( 'after_setup_theme', 'wpcninja_translation' );
Create the translation files
Install the PO Edit app
Download the Divi language files from this link
Unzip the file
Open the en_US.po file from the Divi → lang folder found in the zip file, using the PO Edit app
Translate all the strings to your language
Save the file as xx_XX.po - where the xx is your country code. For example, for Romanian, the file name will be ro_RO.po.
Use an FTP connection, the hosting File Manager app, or the Advanced File Manager plugin to upload the .mo file that the PO edit created during the Save to wp-content/themes/child theme folder/lang/theme
Open the en_US.po file from the Divi → includes builder → Languages folder found in the zip file, using the PO Edit app
Repeat steps 10 and 11
Use an FTP connection, the hosting File Manager app, or the Advanced File Manager plugin to upload the .mo file that the PO edit created during the Save to wp-content/theme/child theme folder/lang/builder