New Landing How can we help? Themeforest Theme Support Neighborhood Po Language files in child theme

Viewing 14 posts - 1 through 14 (of 14 total)
  • #35567
    Michaelgimm
    Member
    Post count: 13

    Hi
    I just finished translating my po file from english to danish, but can’t figure out, how to activate them in my Neighborhood CHILD Theme.

    I have created a “language” folder in the child theme, where I uploaded the po and mo files.
    After that I have created a functions.php file in the child theme and added this code:

    <?php

    add_action( ‘after_setup_theme’, ‘neighborhood_child_setup’ );
    function neighborhood_child_setup() {

    /* Load the child theme’s gettext file */
    load_child_theme_textdomain( ‘neighborhood’, get_stylesheet_directory() . ‘/languages’ );

    }

    ?>

    But it doesn’t work. Please help.

    Best regards, Michael

    #36241
    Melanie – SUPPORT
    Member
    Post count: 11032

    I’ll ask another support staff about that. Cheers

    #36621
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    neighborhood is not the text domain, try this text domain “swiftframework”

    like this..

    load_child_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/languages’ );

    Let me know, what you got.

    Thanks,
    laranz.

    #36861
    Michaelgimm
    Member
    Post count: 13

    Thanks Laranz, but no luck…

    This is where I put my functions.php file:
    /public_html/wp-content/themes/neighborhood-child
    …and the code now looks like this:

    <?php
    add_action( ‘after_setup_theme’, ‘neighborhood_child_setup’ );
    function neighborhood_child_setup() {
    /* Load the child theme’s gettext file */
    load_child_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/languages’ );
    }
    ?>

    My wp-config.php is in this directory:
    /public_html
    …and it looks like this in the language section of the code (I want it to be “da_dk”)

    /**
    * WordPress Localized Language, defaults to English.
    *
    * Change this to localize WordPress. A corresponding MO file for the chosen
    * language must be installed to wp-content/languages. For example, install
    * de.mo to wp-content/languages and set WPLANG to ‘de’ to enable German
    * language support.
    */
    define (‘WPLANG’, ‘da_DK’);
    define (‘WPLANG’, ‘ll_CC’);
    define (‘FS_METHOD’, ‘direct’);
    define(‘WP_DEBUG’, false);
    /* That’s all, stop editing! Happy blogging. */

    I have also attached my translated PO file, which is located in:
    /public_html/wp-content/themes/neighborhood-child/languages

    Please advise.

    Best regards
    Michael

    #37141
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    I think, why it didn’t take the da_dk is because of this..

    define (‘WPLANG’, ‘da_DK’);
    define (‘WPLANG’, ‘ll_CC’);

    you change that language to ll_CC on the next line?

    Let me know, what you got.

    Thanks,
    laranz.

    #37155
    Michaelgimm
    Member
    Post count: 13

    Hi, I didn’t put the “ll_CC” there in the first place. Don’t know how it got there?!?

    I tried to change it to:
    define (‘WPLANG’, ‘da_DK’);
    define (‘WPLANG’, ‘da_DK’);
    ….no luck

    And afterwards:
    define (‘WPLANG’, ‘da_DK’);
    …also no luck

    Som of the words is translated and others are not. It seems it would have something to do with Woocommerce vs Neighborhood, maybe? (see attached file).

    Michael

    #37251
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    I don’t know how it goes there 😀 maybe you use any plugin to translate? or else no one would add that except you 🙂

    So it now works, most of the words work and some of theme not. So make sure you translate all words in the .po file, download the latest theme, and find that .po file for the latest language file, and fill those.

    For translating woocommerce try this: http://docs.woothemes.com/document/woocommerce-localization/

    Let me know, what you got.

    Thanks,
    laranz.

    #37577
    Michaelgimm
    Member
    Post count: 13

    Ok, so I previously had Localization installed, but never made it work with danish translation.. this explains the define (‘WPLANG’, ‘ll_CC’);

    In the Localization plugin under the Woocommerce translate section it says:(see attached file) – does it mean anything?

    Michael

    #37771
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    No, see the info they gave here: http://docs.woothemes.com/document/woocommerce-localization/ under Translating – Codestyling Localization section.

    Important: You can ignore the message in codestyling which states “Loading problem: Author is using load_textdomainem instead of load_plugin_textdomain.” We use both methods to ensure maximum compatibility.

    Let me know, what you got.

    Thanks,
    laranz.

    #37812
    Michaelgimm
    Member
    Post count: 13

    Hi Laranz, thx for your patience.

    I allready translated the PO file in the Neighborhood theme earlier. Now I put the PO+MO files in the:
    /public_html/wp-content/themes/neighborhood/language &
    /public_html/wp-content/themes/neighborhood-child/language

    …and it almost works. But I don’t know what will happen when I update the theme next time…. Anyway I have stored the files, so it’ll have to do for now.

    BUT there are still some words which are not translated (see attached file). I think it relates to woocommerce, but when I open the PO or POT file in:
    /public_html/wp-content/plugins/woocommerce/i18n/languages

    …the words from my attached file is not on the “list”

    WHERE do I edit these words?

    Michael

    #37815
    Michaelgimm
    Member
    Post count: 13

    Think I got it 🙂 (but still don’t know what will happen after update…)

    Copied the translated PO and MO files (da_DK) to:
    /public_html/wp-content/themes/neighborhood/language &
    /public_html/wp-content/themes/neighborhood-child/language

    And reinstalled Localization – went to Localization plugin/woocommerce and pressed EDIT. All the words where translated to danish.
    After this it worked 🙂

    Thx

    #37835
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Actually if you have this,

    <?php
    add_action( ‘after_setup_theme’, ‘neighborhood_child_setup’ );
    function neighborhood_child_setup() {
    /* Load the child theme’s gettext file */
    load_child_theme_textdomain( ‘swiftframework’, get_stylesheet_directory() . ‘/languages’ );
    }
    ?>

    and your child theme is activated, this is enough /public_html/wp-content/themes/neighborhood-child/language no need to put the languages in /public_html/wp-content/themes/neighborhood/language

    it didn’t work when you don’t put anything in /public_html/wp-content/themes/neighborhood/language folder? if so make sure the child theme is enabled.

    Let me know, what you got.

    Thanks,
    laranz.

    #109023
    Patrick-H
    Member
    Post count: 20

    Watch out the (correct) apostrophes and folder name (where the languages being located): »languages« (WordPress tutorial) and »language« (Neighborhood Theme). This works for me!

    <?php
    function neighborhood_child_setup() {
    load_child_theme_textdomain( 'swiftframework', get_stylesheet_directory() . '/language' );
    }
    add_action( 'after_setup_theme', 'neighborhood_child_setup' );
    ?>

    #109051
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I’m glad that issue resolved.
    Thanks 🙂
    With Best Regards
    Mohammad

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register