• Resolved skubko

    (@skubko)


    Hello,
    my localizations are not working any more. I do not know if it was the latest update or the one before that, but currently I am running 3.1.0 and they are simply not working. I am using a child theme, there I have folder languages and inside of that folder there is MO and PO file. My child-theme also contains functions.php (as I remember it was necessary for localizations before, when I remove it from there now, it does not make any difference). I read somewhere that content of the file functions.php has changed, but I do not know how – I tried to change the function what I have
    function alx_load() {
    to
    function hu_load() {
    based on one hint I found, but then my page would not load at all.
    Can somebody please help me what to do when I want to have my localization back?
    Thanks in advance.
    skubko

Viewing 11 replies - 1 through 11 (of 11 total)
  • My function.php contains this:

    if ( ! function_exists( 'hu_load' ) ) {
      function hu_load() {
        // Load theme languages
        load_theme_textdomain( 'hueman', get_stylesheet_directory().'/languages' );
        // Load theme options and meta boxes
        //load_template( get_template_directory() . '/functions/theme-options.php' );
        load_template( get_template_directory() . '/functions/init-meta-boxes.php' );
        // Load custom widgets
        load_template( get_stylesheet_directory() . '/functions/widgets/alx-tabs.php' );
        load_template( get_template_directory() . '/functions/widgets/alx-video.php' );
        load_template( get_template_directory() . '/functions/widgets/alx-posts.php' );
        // Load dynamic styles
        load_template( get_template_directory() . '/functions/dynamic-styles.php' );
      }
    }
    add_action( 'after_setup_theme', 'hu_load' );

    My child-theme localisation kicks in.

    Thread Starter skubko

    (@skubko)

    Hello,
    I am missing “add_action” line in my function.php file. I have also found this article, where add_action is also present. When I added it now to my function.php, it is working correctly and the translations are back.
    Why this extra line needs to be there? And another question – is it better to call it like you – “function hu_load” or as it was called on the link I now posted? – function my_child_theme_locale() ? What is the difference here?

    Sorry, I wouldn’t know. Hadn’t tried that solution, but maybe that’s preferable… I’m sure someone more knowledgeable can explain.

    This is fixed in v3.1.1 released today. See the release notes here.

    Thread Starter skubko

    (@skubko)

    Hi bdbrown,
    I have just installed the update and read the release note. However, I do not understand what exactly it means to me (sorry, beginner)… As I mentioned above, when I added to my functions.php just this code:

    function my_child_theme_locale() {
    load_child_theme_textdomain( ‘hueman’, get_stylesheet_directory() . ‘/languages’ );
    }
    add_action( ‘after_setup_theme’, ‘my_child_theme_locale’ );

    the translations started working correctly even before this 3.1.1 update… What should I do now? Return to the old code where I used

    function alx_load() {
    // Load theme languages
    load_theme_textdomain( ‘hueman’, get_stylesheet_directory().’/languages’ );

    // Load theme options and meta boxes
    load_template( get_template_directory() . ‘/functions/theme-options.php’ );
    and so on….

    or should I keep it the way it is now?

    The new v3.1.1 loads the language files from the child theme by default. You should be able to remove that function from your child theme.

    Thread Starter skubko

    (@skubko)

    I completely removed the functions.php file from my child theme. I remember that I used it in the past only for languages, so I guess it should be ok now… Or maybe, are those next lines important to keep? :)… as “Load theme options and meta boxes” for example as you see above?

    If that’s all you had in your child theme functions.php file then, no, you don’t need to keep the file in your child theme. The default hu_load() function is run by the theme when the site loads. The only file required in a child theme is style.css.

    Thread Starter skubko

    (@skubko)

    Thank you bdbrown for this information and thanks to nchrtd for sharing his functions.php with me. This topic is resolved now.

    Thread Starter skubko

    (@skubko)

    Thank you bdbrown for this information and thanks to nchrtd for sharing his functions.php with me. This topic is resolved now.

    You’re welcome; glad to help.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Localization not working after upgrade’ is closed to new replies.