WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Theme translation (8 posts)

  1. Lars-Andreas Kvisle
    Member
    Posted 4 years ago #

    I've attempted to localize the Whitehouse-theme. I've created no_NB.po and no_NB.mo files and stored them in /wp-content/themes/whitehouse/language I've also changed wp_config.php accordingly - define ('WPLANG', 'no_NO'). I've not succeeded in changing the language. Have I done something wrong? Or is the theme not ready for localization? If the latter is true, is there an easy way to alter it to enable localization?

    Yours,

    Lars

  2. Lars,

    If your WPLANG setting is no_NO, the theme language files should be no_NO.po/mo as well.

  3. Lars-Andreas Kvisle
    Member
    Posted 4 years ago #

    Thanks. I wrote incorrectly in the first post. In wp_config.php it's - define ('WPLANG', 'no_NO') and the files are
    no_NO.mo and
    no_NO.po

  4. Is there load_theme_textdomain function in your functions.php file? (see Kubrick's example)

    Is the textdomain defined correctly? For example:
    <?php _e('Not Found', 'kubrick'); ?>

  5. Lars-Andreas Kvisle
    Member
    Posted 4 years ago #

    This is in functions.php:

    // LOCALIZATION
    	define('TDOMAIN', 'WhiteHouse');
    	define('LANGUAGE_FOLDER', TEMPLATEPATH.'/language');
    	load_theme_textdomain(TDOMAIN, LANGUAGE_FOLDER );

    There's no other mention of load_theme_textdomain in functions.php Is it defined correctly?

  6. Seems correct.
    In that case, you should have something like <?php _e('Not Found', 'WhiteHouse'); ?> in your template.

    Are you editing & creating .po/.mo using Poedit?

  7. Lars-Andreas Kvisle
    Member
    Posted 4 years ago #

    In that case, you should have something like <?php _e('Not Found', 'WhiteHouse'); ?> in your template.

    I assume you're referring to functions.php as the template. There is no string such as <?php _e('Not Found', 'WhiteHouse'); ?>. I've searched the entire theme directory without finding a match for part of the string <?php _e('Not.

    Yes, I've used Poedit to translate. I've also tried translation with the CodeStyling Localization.

  8. Lars-Andreas Kvisle
    Member
    Posted 4 years ago #

    My problem is resolved. It appears my definition in wp_config.php was the problem. define ('WPLANG', '') should have read define ('WPLANG', 'nb_NO') not as in the above attempts. It appears the correct definition are according to this list.

    The Whitehouse-theme, by the way, is only partially ready for localization.

    Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic