WordPress – Childtheme language Translation

I’m really really stuck here so I’d appreciate some help from above…

I’m using the jkreativ theme and am currently trying to translate my child-theme.

Read More

I am using this code in my childthemes functions.php:

<?php
/**
 * Setup My Child Theme's textdomain.
 *
 * Declare textdomain for this child theme.
 * Translations can be filed in the /languages/ directory.
 */
function my_child_theme_setup() {
    load_child_theme_textdomain( 'jkreativ-child', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'my_child_theme_setup' );
?>

In my Childthemes Folder I have a folder called “languages” that contains the
de_DE.mo
de_De.po
files.

I looked in the wordpress codex and to me this seems to be the proper way.
But no single line gets translated…

Any ideas anyone?

Thanks!
Paul

Related posts

1 comment

  1. There is a post at wordpress.stackoverflow.com with this problem. Basically what you have to do is

    1. Create a folder inside your languages one with the name of your parent theme;

    2. Place there the .mo file that will overwrite the parent theme translations;

    3. Change your code like this:

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

      Calling load_theme_textdomain and passing the parent theme domain will do the trick.

    Hope it helps!

Comments are closed.