L
L
ligisayan2015-12-21 13:11:54
Internationalization and localization
ligisayan, 2015-12-21 13:11:54

How to link translation file in wordpress child theme?

Greetings! I want to bind a localized Russian translation of a theme in a wordpress child theme. If I put the translation files in the parent theme's lang folder along with the English version, then everything is ok, but when the theme is updated, my translation will disappear and I will have to overwrite it every time. In the child theme, I create a similar folder, but by default, the translation from it is not picked up.
I try to bind via the child theme's functions.php file, but it doesn't work:

function my_child_theme_setup() {
  load_child_theme_textdomain( 'my-child-theme', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'my_child_theme_setup' );

What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
ligisayan, 2015-12-21
@ligisayan

Already figured out 'my-child-theme' in functions.php and theme should match

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question