Skip to:
Content
Pages
Categories
Search
Top
Bottom

Language file load evidence?


  • roydeanjr
    Participant

    @roydeanjr

    How can I tell if there is a problem with the loading of a language file I have created?

    I used POEdit to modify the buddypress.pot file and saved the changed file as bp-family-myrelative.pot and POEdit created a bp-family-myrelative.mo when I saved the file.

    I am using Windows server 2008 and do not know about a msgfmt application that I can run. Is it in a special folder? Is that a unix only app?

    Bottom-line is that the language changes I made (to change group text to family text) is not reflected in any of the buddypress/wpmu menus or text. I have restarted the server apps several times and do not see any changes taking affect.

    Any ideas?

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

  • Boone Gorges
    Keymaster

    @boonebgorges


    roydeanjr
    Participant

    @roydeanjr

    Thank you for your interest in helping me.

    Yes, here is my code:

    define( ‘BPLANG’, ‘myrelative’ );
    if ( file_exists( ‘/wp-content/bp-languages/bp-family-‘ . BPLANG . ‘.mo’ ) ) {
    load_textdomain( ‘buddypress’, BP_PLUGIN_DIR . ‘/wp-content/bp-languages/bp-family-‘ . BPLANG . ‘.mo’ );
    }

    And, yes, I do have the folder and files under the bp-languages folder directly off wp-content rather than under buddypress in order to preserve the modifications.

    I just can’t tell if the file is even being loaded and whether there is a problem with it.


    Boone Gorges
    Keymaster

    @boonebgorges

    I think that your file location is the problem. If you have your file in wp-content, it should read

    load_textdomain( 'buddypress', '/wp-content/bp-languages/bp-family-' . BPLANG . '.mo' );

    Is it not though a good idea to relocate it? prevent overrights if using automatic updates, somewhat a flawed mechanism if ones language files will keep getting deleted.

    While on the subject and as it might be pertinent to this threads question, when creating a new po file I’m correct in thinking what we do is take the original apply revisions to existing entries and create a new file mo but does that mo file simply contain references to the amendments only?
    In other words if the original language file is updated with perhaps new labels /text what becomes of our customised file, are the two read in conjunction.


    Boris
    Participant

    @travel-junkie

    Yep, it’s a good idea to relocate it, but the path was still wrong. The constant BP_PLUGIN_DIR points to the BP folder. Then you have the wp-content folder, so right there’s the problem. You could use this:
    load_textdomain( ‘buddypress’, WP_PLUGIN_DIR . ‘/bp-languages/bp-family-’ . BPLANG . ‘.mo’ );

    This assumes that you have your folder structure like this:
    wp-content/plugins/bp-languages


    Boone Gorges
    Keymaster

    @boonebgorges

    Right, I was assuming that the directory structure was wp-content/bp-languages. And yes, it’s a good idea to relocate it.


    roydeanjr
    Participant

    @roydeanjr

    Well, thank you for the insight, however, it did not work when I followed the tutorial step by step exactly either. I moved it after reading and going through the latest upgrade experience of having a modified file deleted upon upgrade. The path was definitely wrong in what I posted and it has been corrected, however, I still do not have my custom language text being used on the site.I want to know what I can add to some php file that will display the status of the language file and provide a better path to explore for fixing this situation.

    Thank you for the help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Language file load evidence?’ is closed to new replies.
Skip to toolbar