• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Some strings doesn't translate if MO file placed within themes' language folder

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Internationalization and Translations › Some strings doesn't translate if MO file placed within themes' language folder

This topic is: not resolved
  • This topic has 3 replies, 2 voices, and was last updated 1 year, 11 months ago by 123satchipanda.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 18, 2019 at 6:59 pm #492427
    123satchipanda
    Member

    Hello,

    I'm trying to translate the child theme, Academy Pro to be specific, but there are some strings that are not translated.

    If I place the MO file inside wp-content/language folder as "wp-content/languages/themes/academy-pro-ja.mo", then it translates the whole theme, but if I place it within theme folder as "wp-content/themes/academy-pro/languages/ja.mo", then there are some strings left behind as English.

    I believe this is due to how WordPress loads translation file, but is there any solution to this problem? I want the translations to be loaded even when PO/MO files are in theme-name/languages folder.

    For example, the override of the menu name from Academy Pro's function.php doesn't get translated:

    
    // Renames primary and secondary navigation menus.
    add_theme_support(
        'genesis-menus', array(
            'primary' => __( 'Header Menu', 'academy-pro' ),
            'secondary' => __( 'Footer Menu', 'academy-pro' ),
        )
    );
    

    The "Header Menu" and "Footer Menu" shows as it is, and doesn't get translated even though I have those strings in my PO/MO files.

    Looking forward to hearing any advice to solve this.

    Thanks,
    Satoshi O.

    July 19, 2019 at 6:31 am #492431
    Victor Font
    Moderator

    If you change the language files location, you also have to change the textdomain by editing this function in functions.php:

    function academy_localization_setup() {
    
    	load_child_theme_textdomain( 'academy-pro', get_stylesheet_directory() . '/languages' );
    
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    July 20, 2019 at 8:22 am #492437
    123satchipanda
    Member

    Hello Victor,

    Thank you for your prompted reply.

    Actually, I didn't change the location from the default.
    I've followed the instruction of this page for locating the PO/MO files for the theme, which tells you to install the PO/MO files /wp-content/themes/your-theme/languages.

    In this case, I believe that isn't the actual issue for this case since other parts from the themes are translated correctly (even the strings from the child theme).

    To be more specific, I haven't checked all of the child themes, but they tend not to get translated in the "Menu" section and "Widget" section from the customizer.
    The Menu names like "Header Menu" or "Footer Menu", and also the Widget section names like "Footer 1", Footer 2"... doesn't get translated when PO/MO files are installed within /wp-content/themes/your-theme/languages.

    Am I clear enough on explaining what's going on here?
    Please let me know if something's missing.

    Thanks,
    Satoshi O.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble