• Resolved Mokl

    (@mokl)


    Hy there.
    I try looking for any useful idea on this site, but I am not succesful.
    1) I am upload child theme Hueman-child-master (by Hueman 2.1.1)
    2) upload CZ translate from Github (.po and .mo)
    3) install, activate and edit theme exactly by your documentation here (by Load certain functionality from the child theme instead – twice chance “template” to “stylesheet” one at function alx_styles and one at Load theme languages)
    4) FOLLOW, MORE and all translate doesnt work … 🙁
    What’s wrong? I mean, it must be any trifle.
    Any idea?
    Thanx

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi!

    1. Are the language files put in a /languages/ folder in the child theme?
    2. You say you twice change the template to stylesheet, what is the other one? custom.css?
    3. Make sure the .mo file is correct. Open the .po lang file with PoEdit and click save once to generate the .mo file for it.
    4. Double check so that the child theme is active in admin, not the parent theme.

    Thread Starter Mokl

    (@mokl)

    Hi Alexander.
    1. yes, the language files is in the language folder in the child theme
    2. below is whole code from functions.php, I change only this file.

    ‘<?php
    /* ————————————————————————- *
    * Custom functions
    /* ————————————————————————- */

    // Add your custom functions here, or overwrite existing ones. Read more how to use:
    // http://codex.wordpress.org/Child_Themes

    function alx_styles() {
    wp_enqueue_style( ‘style’, get_stylesheet_uri() );
    if ( ot_get_option(‘responsive’) != ‘off’ ) { wp_enqueue_style( ‘responsive’, get_stylesheet_directory_uri().’/responsive.css’ ); }
    if ( ot_get_option(‘custom’) == ‘on’ ) { wp_enqueue_style( ‘custom’, get_template_directory_uri().’/custom.css’ ); }
    wp_enqueue_style( ‘font-awesome’, get_template_directory_uri().’/fonts/font-awesome.min.css’ );
    }

    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’ );
    load_template( get_template_directory() . ‘/functions/meta-boxes.php’ );

    // Load custom widgets
    load_template( get_template_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 custom shortcodes
    load_template( get_template_directory() . ‘/functions/shortcodes.php’ );

    // Load dynamic styles
    load_template( get_template_directory() . ‘/functions/dynamic-styles.php’ );

    // Load TGM plugin activation
    load_template( get_template_directory() . ‘/functions/class-tgm-plugin-activation.php’ );
    }

    3. .mo and .po file looks correct, I have checked a saved are one more
    4. child theme is active

    Cache is not active.

    Alexander, many thanx for your answer.
    Martin.

    Strange there that it doesn’t work. Can you do a test and put the language files in the /languages/ folder of the parent theme instead – and see if that works? That way we can see if it’s the child theme edits that are broken or the lang files.

    Thread Starter Mokl

    (@mokl)

    Crazy… I checked one more language files. I inserted both files one more to active child theme – nothing changes. Active parent theme (together with EN files) – nothing changes. And them I maked own files with translate (only a few words)- and put on the server (child and parent). Nothing. I thing, I have broken parent theme.
    Have you any prefer plugin for theme test? Or reupload Hueman 2.1.1. on site again – the best way?

    Check this language

    Add :
    load_child_theme_textdomain('hueman', get_stylesheet_directory().'/languages');

    after that line:
    load_theme_textdomain( 'hueman', get_template_directory().'/languages' );

    in Your child-theme/functions.php file

    It works for me.

    Thread Starter Mokl

    (@mokl)

    Hi jurasjo.
    Thank you for your note, but still no change.
    M

    How about this:

    You will also need to make a change to your WordPress wp-config.php file (located in your WP root directory) with the correct language codes like the example below. If you don’t have a WPLANG entry then create one.

    define (‘WPLANG’, ‘pt_BR’);

    http://www.appthemes.com/blog/how-to-translate-a-wordpress-theme/

    I’d read that guide through to see if any detail has been missed.

    Thread Starter Mokl

    (@mokl)

    Hi Alexander.

    Great! What little entry in wp-config.php file.
    Very useful site.
    A little note for all with the similar trouble.

    The name of .mo and po needs by as same as define (‘WPLANG’, ….. in the wp-config.php
    For example (fom my case)
    define ('WPLANG', 'en_CZ'); = en_CZ.mo and en_CZ.po

    Thanx Alexander.

    3. Make sure the .mo file is correct. Open the .po lang file with PoEdit and click save once to generate the .mo file for it.

    This line made the difference to me. Now is working.

    I didn’t have a clue I needed the .mo file but I still tried with the .mo file from the site.
    Even worse, I didn’t know it had to be the right .mo for the .po
    And if you save the .po, you get a .mo also? How clear is that?

    I like your theme very much but this detail could have been mentioned in the documentation, don’t you think?

    Many thanks and keep up the good work! 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Child theme – CZ language does not work FOLLOW and MORE’ is closed to new replies.