Skip to:
Content
Pages
Categories
Search
Top
Bottom

Language file load evidence?

  • @roydeanjr

    Participant

    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)
  • @boonebgorges

    Keymaster

    @roydeanjr

    Participant

    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.

    @boonebgorges

    Keymaster

    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' );

    @hnla

    Participant

    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.

    @anonymized-96400

    Inactive

    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

    @boonebgorges

    Keymaster

    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

    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