How to generate the .pot file for BuddySocial theme?

I look at here and I try to create the .pot file for the theme... but no lucky at all!

I would like to translate the theme to Portuguese, Spanish and French...

Does anybody know how can I do the .pot file...

I also tried to use the CodeStyling Localization Plugin... but It didn't work. The plugin didn't find the theme files...

Thanks

  • projectlandscapes

    Problem solved... steps I did...

    I put this code in the function.php (bp-social/function.php)

    function init_language(){
    if (class_exists('xili_language')) {
    define('THEME_TEXTDOMAIN','bp-social');
    define('THEME_LANGS_FOLDER','/lang');
    } else {
    load_theme_textdomain('bp-social', get_template_directory() . '/lang');
    }
    }
    add_action ('init', 'init_language');

    This code I got from this link!

    After I downloaded the Plugin Codestyling Localization

    In the WordPress Dashboard/Tools/Localization... I chose the BuddyPress Social and I added the language (pt_BR), rescanned the directory and translated the sentences... then I generated the .mo files...

    but I had some problems...

    These sentences have not been translated: Welcome back, Community and Send To (Username or Friend's Name)...

    I looked in the .po file to see where these sentences were...

    Welcome back (top-bar.php - line10)
    Community (top-bar.php - line 53 and 79)
    Send To (Username or Friend's Name) (bp-social/messages/compose.php - line 16)

    Welcome back and Community were like that:

    <?php _e('Welcome back'); ?>
    <?php _e('Community'); ?>
    <?php _e('Community'); ?>

    Without any location after the sentences, the plugin read Community and Welcome as WordPress's default sentence, but these sentences are not in the WordPress's translation, so I changed that to:

    <?php _e('Welcome back', 'bp-social'); ?>
    <?php _e('Community' , 'bp-social'); ?>
    <?php _e('Community' , 'bp-social'); ?>

    'bp-social' is the new location...

    Send To (Username or Friend's Name) was like that:

    <?php _e("Send To (Username or Friend's Name)", 'buddypress') ?>

    But these sentence is not in the BuddyPress .po file, so I changed to that:

    <?php _e("Send To (Username or Friend's Name)", 'bp-social') ?>

    Then I rescanned the directory and translated these 3 sentences and everything looks great!