Support » Plugin: Discontinued: Srizon Social Album :Do Not Install » Internationalize the Plugin

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter IvanRF

    (@ivanrf)

    If you need more help with that, ask me.

    There are some strings returned by Facebook that are in English, and it would be nice if the plugin can “filter” them in order to translate them.

    For example, in gallery.php line 34, $image['txt'] return this strings:

    • Timeline Photos
    • Cover Photos
    • Untitled Album
    • Mobile Uploads
    • Profile Pictures

    Something like:

    if (strcmp($image['txt'], 'Timeline Photos') == 0)
      $image['txt'] = __( 'Timeline Photos', 'srizon-facebook-album' );
    ...
    Plugin Author afzal_du

    (@afzal_du)

    Hi Ivan,
    Thanks for looking into this. I added translation support recently in a rush but it kind of works. I’ll be fixing the problems when I work on this plugin again. Right now I’m busy with other projects so can’t promise an update anytime soon.

    Thread Starter IvanRF

    (@ivanrf)

    Hi Afzal, this will take you no more than 5 minutes. Just copy and paste the code that I sent you in the first message and this:

    function filter_fb_text($txt) {
      if (strcmp($txt, 'Timeline Photos') == 0)
        $txt = __( 'Timeline Photos', 'srizon-facebook-album' );
      else if (strcmp($txt, 'Cover Photos') == 0)
        $txt = __( 'Cover Photos', 'srizon-facebook-album' );
      else if (strcmp($txt, 'Untitled Album') == 0)
        $txt = __( 'Untitled Album', 'srizon-facebook-album' );
      else if (strcmp($txt, 'Mobile Uploads') == 0)
        $txt = __( 'Mobile Uploads', 'srizon-facebook-album' );
      else if (strcmp($txt, 'Profile Pictures') == 0)
        $txt = __( 'Profile Pictures', 'srizon-facebook-album' );
      return $txt;
    }

    Then, in gallery.php line 34, use
    filter_fb_text($image['txt'])

    Plugin Author afzal_du

    (@afzal_du)

    done!
    you can contribute on the translation here
    https://www.transifex.com/srizon/srizon-facebook-album/

    Thread Starter IvanRF

    (@ivanrf)

    Thanks for taking the time to do it! 👍

    Thread Starter IvanRF

    (@ivanrf)

    I forgot to mention, now your plugin can be translated through WordPress itself at:
    https://translate.wordpress.org/projects/wp-plugins/srizon-facebook-album.

    If you already have translators, you can ask to make them Project Translation Editors (PTE) at https://make.wordpress.org/polyglots/.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Internationalize the Plugin’ is closed to new replies.