WordPress.org

Ready to get started?Download WordPress

Forums

JSL3 Facebook Wall Feed
Having trouble with the locale (7 posts)

  1. mbs1337
    Member
    Posted 1 year ago #

    Hello there

    I must say, this is a nice Facebook plugin! But i'm having trouble with some text on the plugin.

    First of all i have change all the "locales codes" in those places i can see them. Then i simply go in the .php files, and translate those words, i can see that i want to change to my language.

    But not all has changes, and i'm very stucked in finding the codes!

    The website is:
    http://www.fuzhou-restaurant.dk (right sidebar in the bottom)

    Words i want to change (seems to be all of them)
    "asked"
    "on"
    "post"
    "wall"

    Regards from Denmark
    Michael Bay Sørensen

    http://wordpress.org/extend/plugins/jsl3-facebook-wall-feed/

  2. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    The plugin is designed to read the locale you have defined in your wp-config.php file. You can read how to set this at http://codex.wordpress.org/Installing_WordPress_in_Your_Language.

    If you would prefer to hard-code the local in the plugin php file then do the following:

    1. Open '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-uki-facebook-wall-feed.php'
    2. Line 244 is the following:
      $this->fb_locale = $locale;
    3. Change it to the following (use the locale of your choosing):
      $this->fb_locale = 'da_DK';
    4. Save the file.
  3. mbs1337
    Member
    Posted 1 year ago #

    The WordPress is already set to danish in my config file.

    And I've also did the changes you write. Nothing changes. Still the english words :(

  4. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    Strange. Try this:

    1. Open '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-uki-facebook-wall-feed.php'
    2. Lines 291 through 295 are:
      $fb_url = "https://graph.facebook.com/$id/feed?" .
      "locale=$locale&limit=100&$token";
      else
      $fb_url = "https://graph.facebook.com/$id/feed?" .
      "locale=$locale&limit=$limit&$token";
    3. Change them to the following:
      $fb_url = "https://graph.facebook.com/$id/feed?" .
      "locale=da_DK&limit=100&$token";
      else
      $fb_url = "https://graph.facebook.com/$id/feed?" .
      "locale=da_DK&limit=$limit&$token";
    4. Save the file.
  5. mbs1337
    Member
    Posted 1 year ago #

    YEAH!

    It's working now. Finally :)
    Thanks!

    What about if i update the plugin? Then i have to make the changes again? Shouldn't there be an option in the settings for changes the locales. That could be nice!

    Best regards
    Michael

  6. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    Like I said before, the plugin automatically reads the locale you have set in WordPress. This happens every time you click "Save Changes" on the settings page for the plugin. The actually code is on line 633 in '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-jsl3-facebook-wall-feed.php':

    $dev_options[ 'locale' ] = get_locale();

    get_locale() is a built in WordPress function. I'm not sure why it is not working for you.

    Just for the sake of curiosity, do you still have the following code at line 271 in '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-uki-facebook-wall-feed.php':

    $locale = $this->fb_locale;

  7. mbs1337
    Member
    Posted 1 year ago #

    But this is not the first websites which i ran in to those problems. Also another one, which i know that the danish locales is working on other plugins.

    line 271 in "class-uki-facebook-wall-feed.php"
    function get_fb_wall_feed() {
    //echo 'Contacting FaceBook...
    ';
    $id = $this->fb_id;
    $limit = $this->fb_limit;
    $locale = $this->fb_locale;
    $token = 'access_token=' . $this->access_token;

    So yes.

    And on line 633 in "class-jsl3-facebook-wall-feed.php"
    */

    // store the locale setting
    $dev_options[ 'locale' ] = get_locale();
    /*
    if ( isset( $_POST[ 'locale' ] ) ) {
    $dev_options[ 'locale' ] =
    apply_filters( 'content_save_pre',
    $_POST[ 'locale' ] );
    }
    */

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.