• Resolved rdny

    (@rdny)


    Hello.

    I wanted to change the language to Swedish and done a search and found all the info I needed. I can’t get it to work though.

    In others threads you say that some code should be copied from functions.php. The info under A lx_setup. The problem is that I found that line under Alx_load or something.

    To be honest. I don’t know how the functions.php-file under the child theme should look like.

    Can you/someone help me out?

    The language-files are done. I think it’s just functions.php that I can’t get to work.

    Thanks in advance and thanks for a kick ass-theme.

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

    The reason it said it was alx_setup was because it was there initially, but was moved to alx_load.

    If you check the documentation here and go to the “Child Theme” section, it should have some good info there how to add it to functions.php properly.

    If you still can’t get the lang files to work, check out this translation guide to make sure you didn’t miss something.

    Thread Starter rdny

    (@rdny)

    Nope, can’t get it to work. I’ll start everything over again. From scratch. A question though. Is there any difference between the one you download and install through WordPress admin panel and the one downloadable from here and your website? I read somewhere that the version on your website is more open? Is that why I can’t get it to work?

    The version on my site still has some features that had to be taken out of the wordpress.org release, for different reasons, to be approved here.

    Difference is that it has:
    – custom.css file option
    – Tracking code field in admin for analytics
    – High-resolution, custom designed social article sharing links
    – Full header image option
    – Body background image option

    May be some other small thing I can’t remember, but those should be the main ones.

    It should not affect your language files or any of the functions.php code. Are you sure that you have both a .po file and a .mo file? The .mo is required.

    Thread Starter rdny

    (@rdny)

    Ok, sorry for being such a noob 🙂

    So I reinstalled the theme. Downloaded it from your site instead :), redid the translation. Uploaded both the .po and the .mo to the chills-theme and under languages.

    My .mo file is 2412 bytes big and my .po file is 3260 bytes big. Can that be correct? I can see that the the originals are 410 bytes respective 2650 bytes.

    My functions.php file looks like this.

    <?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_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 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’ );
    }

    }

    What have I done wrong?

    Hm, you have a double } at the end. Try removing one. The .mo filesize sounds pretty big to be a .mo too. Was it auto-created by PoEdit?

    Thread Starter rdny

    (@rdny)

    Nope. Didn’t work.

    Looks like this now.

    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 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’ );
    }

    Thread Starter rdny

    (@rdny)

    Ok. I’m so stupid.

    The theme that should be activated is the child-theme, right? 🙂

    Thread Starter rdny

    (@rdny)

    Because now it’s in swedish 🙂

    The theme that should be activated is the child-theme, right?

    Ah, yup 😀 Glad to hear it works!

    Hi there,

    If want to translate for example “Follow” in the left top sidebar is it fine to just change the en_US.po file?

    I suppose it would work but is that really supposed how it should be work? Maybe I should use a sv_SE.po file?

    Please enlighten me, I’m a little bit lost.

    I solved it. To remember this for later I’ll write down the answer:

    In Hueman language folder download the en_US.po file and open it in PoEdit.

    Click Archive > Save As and save it as a sv_SE.po file.

    Make the translations to the new sv_SE.po file you want and then save and upload both the .po and .mo file.

    Solved! 😀

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Changing the language to Swedish’ is closed to new replies.