WordPress.org

Forums

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

  1. rdny
    Member
    Posted 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago #

    Ok. I'm so stupid.

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

  9. rdny
    Member
    Posted 1 year ago #

    Because now it's in swedish :)

  10. Alexander Agnarson
    Member
    Theme Author

    Posted 1 year ago #

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

    Ah, yup :D Glad to hear it works!

  11. 3dpc
    Member
    Posted 1 year ago #

    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.

  12. 3dpc
    Member
    Posted 11 months ago #

    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! :D

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic