WordPress.org

Ready to get started?Download WordPress

Forums

Hueman
[resolved] Changing the language to Swedish (10 posts)

  1. rdny
    Member
    Posted 6 months ago #

    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.

  2. Alexander Agnarson
    Member
    Theme Author

    Posted 6 months ago #

    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.

  3. rdny
    Member
    Posted 6 months ago #

    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?

  4. Alexander Agnarson
    Member
    Theme Author

    Posted 6 months ago #

    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.

  5. rdny
    Member
    Posted 6 months ago #

    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?

  6. Alexander Agnarson
    Member
    Theme Author

    Posted 6 months ago #

    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?

  7. rdny
    Member
    Posted 6 months ago #

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

  8. rdny
    Member
    Posted 6 months ago #

    Ok. I'm so stupid.

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

  9. rdny
    Member
    Posted 6 months ago #

    Because now it's in swedish :)

  10. Alexander Agnarson
    Member
    Theme Author

    Posted 6 months ago #

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

    Ah, yup :D Glad to hear it works!

Reply

You must log in to post.

About this Theme

About this Topic