Help for WpEstate - a Real Estate Wordpress Theme Help for WpEstate - a Real Estate Wordpress Theme

  • WpEstate
  • Video Tutorials
  • Client Support
Home / Child Theme, Translation / How to add translated .po files in child theme

How to add translated .po files in child theme

How to make your Child Theme ready to use its own translation files?

Child Themes are using in normal cases the translation files of the main theme. In some cases it could be necessary to have a separate language file handling at the Child Theme itself.

First of all you have to modify your Child Themes functions.php file and call the appropriated load method as shown below.

Assume the textdomain is defined at the Main Theme as super theme the load function should look like:

load_child_theme_textdomain(‘wpestate’, get_stylesheet_directory().’/languages’);

The code can be added before add_action. See an example before:

// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' );
}
endif;

load_child_theme_textdomain('wpestate', get_stylesheet_directory().'/languages');

add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );

// END ENQUEUE PARENT ACTION

The path has been defined as subdirectory within the Child Themes directory but you can skip the directory parameter and place the language files at the Child Themes main folder.

Create the folder languages via FTP.

Add your language po. and .mo inside the child theme languages folder.

—

(Re)scan process and Synchronization at Child Themes

Scanning a Child Theme always includes the files from Main Theme too. So you always get the mixed translation from Main and Child Theme. Doing a Synchronization with the Main Theme will preserve the texts from Child Theme and will attach new texts from Main Theme only.

Child ThemeTranslation

Related Articles

  • Theme Translation. What Words Are Not In .Po And Must Be Translated From Theme Options
  • HOW TO UPDATE THE .PO TRANSLATION after a theme update
  • How to install child theme
  • How to make child theme changes to work with theme Minifiy option enabled

Categories

  • 41. Mandatory Setup Instructions
  • 142. Demo and Content Setup
  • 8Advanced Search Settings
  • 4Agent & Blog Posts
  • 9Change Log
  • 3Child Theme
  • 7Custom Page Templates
  • 3Design Options
  • 1Footer Settings
  • 7Google Maps
  • 6Header / Menu Options
  • 1IDX
  • 4Included Plugins: Rev Slider, Ultimate Addons, Visual Composer
  • 14Knowledge Base
  • 1Other Plugins
  • 2Payment Options
  • 10Property Post
  • 5Technical how to
  • 25Theme Options
  • 6Translation
  • 1Uncategorized
  • 5WpEstate Shortcodes
  • 1WpEstate Widgets
  • 1WPML - optional
Flatbase by NiceThemes © 2023. — Powered by WordPress.
  • WpEstate
  • Video Tutorials
  • Client Support