Skip to:
Content
Pages
Categories
Search
Top
Bottom

localize a theme with my own translation, is it possible?

  • hi, I would change some words in the italian localization, in order to customize my site, so I have read the doc http://codex.buddypress.org/how-to-guides/customizing-labels-messages-and-urls/

    but I think now it should be better to localize my own child theme (I’m working on), (so the custom language files will not be removed with the future upgrades), is it possible?
    if yes, how?

    thank you! :)
    Master Po

    P.S. OT: I can’t access to my account page here in buddypress.org, I got an error: “The page you were looking for was not found.” Maybe because I have put a space in my nickname? I would change my avatar and I can’t… :(

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you re-read the page it does say that you can place the files elsewhere to avoid them being overwritten I just stick em in a new folder kept in /plugins/

    Flag the account issue to John James Jacoby or @DJPaul

    thank you hnia, you are right, I have read more carefully the page… so I do create a bp-custom.php file ! argh!
    something like this?
    `<?php
    //CUSTOM CODE FOR BUDDYPRESS
    //PUT YOUR CODE HERE
    define( ‘BPLANG’, ‘mysite’ );
    if ( file_exists( BP_PLUGIN_DIR . ‘/bp-languages/buddypress-‘ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, BP_PLUGIN_DIR . ‘/bp-languages/buddypress-‘ . BPLANG . ‘.mo’ );
    }

    ?>`
    like the example in the page, or do I do write my directory, like this for ex.:
    `<?php
    //CUSTOM CODE FOR BUDDYPRESS
    //PUT YOUR CODE HERE
    define( ‘BPLANG’, ‘mysite’ );
    if ( file_exists( BP_PLUGIN_DIR . ‘/bp-languages/my-bp-language-‘ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, BP_PLUGIN_DIR . ‘/bp-languages/my-bp-language-‘ . BPLANG . ‘.mo’ );
    }

    ?>`

    I’m sorry hnia, but I don’t understand very well… :(
    can you please tell me a little more?

    thank you!

    You have copied the same example twice and that’s the stock default directory for bp language files.

    You want the second example below that one:
    `define( ‘BPLANG’, ‘mysite’ );
    if ( file_exists( WP_PLUGIN_DIR . ‘/buddypress-‘ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, WP_PLUGIN_DIR . ‘/buddypress-‘ . BPLANG . ‘.mo’ );
    }`
    if you want the files in their own directory then do:

    /my-language-files/buddypress-‘ . BPLANG . ‘.mo’

    hnia, hi, and thank you for your patience…

    ehm… there is a little difference in the 2 files I have posted, in the second I wrote my-bp-language… (but I see the order was wrong) because I thought about create a folder “my-bp-language” in the plugin directory…
    I would do like you have said:
    “stick em in a new folder kept in /plugins/”

    so if I have (ops!) understood, is:

    `define( ‘BPLANG’, ‘mysite’ );
    if ( file_exists( WP_PLUGIN_DIR . ‘/buddypress-‘ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, WP_PLUGIN_DIR . ‘/my-language-files/buddypress-‘ . BPLANG . ‘.mo’ );
    }`

    and I put a folder “my-language-files” IN the plugin folder… is it right?
    reassure me, please…
    sorry hnia I’m totally newbie, I promise you I go on amazon to search the dummy’s book!!! :)
    (but the english too is not my cup of tea… sigh!)

    ciao! you are kind!

    Sorry missed that slight difference :)

    You just need to make sure the file_exists function line looks for the file in the same directory as the load file line.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘localize a theme with my own translation, is it possible?’ is closed to new replies.
Skip to toolbar