
In case you want to modify something in an theme translation you can do it by directly editing the translation file. However, if you update the theme these modifications will be lost. The best solution would be to place them in your child theme which is very easy to do.
So basically you just have to add your languages into your child theme and then add some code to functions.php file in child theme. It load translate file from the child theme instead of the parent, here’s how to do it:
1. Step 1:
Create a /languages/ folder in your child theme directory and copy the translation files (from the parent theme) to be modified:
2. Step 2:
Add this code to functions.php in in child theme:
1 2 3 4 5 | // Load translation files from your child theme instead of the parent theme function my_child_theme_locale() { load_child_theme_textdomain( 'total', get_stylesheet_directory() . '/languages' ); } add_action( 'after_setup_theme', 'my_child_theme_locale' ); |
Now you can use the plugin to translate your child theme!
Note: Remember to backup your .mo file when you upgrade your theme.