Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need help with bp-custom.php

  • Avatar of denysz
    denysz
    Participant

    @denysz

    I’m trying to setup BP with three languages: English (default), Simplified/Traditional Chinese.
    I have added mo and po files (zh-tw and zh-cn) to: wp-content/plugins/buddypress/bp-languages
    (zh-cn and zh-tw)
    And I have added bp-custom.php to wp-content/plugins
    This is the code:

    define( ‘BPLANG’, ‘zh-cn’ );
    if ( file_exists( BP_PLUGIN_DIR . ‘/bp-languages/buddypress-’ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, BP_PLUGIN_DIR . ‘/bp-languages/buddypress-’ . BPLANG . ‘.mo’ );
    }

    define( ‘BPLANG’, ‘zh-tw’ );
    if ( file_exists( BP_PLUGIN_DIR . ‘/bp-languages/buddypress-’ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, BP_PLUGIN_DIR . ‘/bp-languages/buddypress-’ . BPLANG . ‘.mo’ );
    }

    Could somebody tell me what am I missing here? I do not see any language changes.
    I am using WPML.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Open your wp-config.php file, find text below

    define (‘WPLANG’, ”);

    change to:

    define (‘WPLANG’, ‘zh-CN’);

    Avatar of denysz
    denysz
    Participant

    @denysz

    Thanks for your reply @modemlooper but could you help me to understand this a bit further please.
    From what I see, your recommendation is referring to “WP in your language”: http://codex.wordpress.org/Installing_WordPress_in_Your_Language
    that talks about converting WP into your local language that you would preffer to use for admin and public.
    where the language files come from the corresponding wp install zip for that specific language
    In my case I downloaded WP from http://cn.wordpress.org/
    and http://tw.wordpress.org/ and extracted zh-cn.mo and zh-tw.mo files that I then added to my /wp-content/languages
    with the following modification to wp-config.php file
    define(‘WPLANG’, ‘zh-cn’);
    define(‘WPLANG’, ‘zh-tw’);

    1. is this correct? Can you declare multiple languages this way? And if so, how does one go about switching from one to another?

    Now, back to my original question about translating BuddyPress
    From what I found here: http://codex.buddypress.org/translations/
    it provides different language files: http://translate.wordpress.org/projects/buddypress/dev

    As I understand these are only for BuddyPress plugin and not WP in general.

    Once downloaded and converted to .mo files you can use them to translate BuddyPress
    by adjusting bp-custom.php

    2. Now, I am not sure how does WP translation corresponds to BP translation. The way I see it they are separete and need to be done separatly by going through steps above. Is this correct?

    3. Also, how to go about declaring multiple languages in both: wp-config.php and bp-custom.php and then switching between them.

    Could someone clarify these points please. I am new to WP and figuring this out takes way too much time. I hope I am on a right track.

    Thanks forum!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.