diff options
Diffstat (limited to 'plugins/Facebook')
-rw-r--r-- | plugins/Facebook/facebookutil.php | 18 | ||||
-rw-r--r-- | plugins/Facebook/locale/Facebook.pot | 378 |
2 files changed, 214 insertions, 182 deletions
diff --git a/plugins/Facebook/facebookutil.php b/plugins/Facebook/facebookutil.php index ac532e18b..ab2d42726 100644 --- a/plugins/Facebook/facebookutil.php +++ b/plugins/Facebook/facebookutil.php @@ -104,9 +104,13 @@ function facebookBroadcastNotice($notice) $status = "$prefix $notice->content"; + common_debug("FacebookPlugin - checking for publish_stream permission for user $user->id"); + $can_publish = $facebook->api_client->users_hasAppPermission('publish_stream', $fbuid); + common_debug("FacebookPlugin - checking for status_update permission for user $user->id"); + $can_update = $facebook->api_client->users_hasAppPermission('status_update', $fbuid); if (!empty($attachments) && $can_publish == 1) { @@ -114,15 +118,15 @@ function facebookBroadcastNotice($notice) $facebook->api_client->stream_publish($status, $fbattachment, null, null, $fbuid); common_log(LOG_INFO, - "Posted notice $notice->id w/attachment " . + "FacebookPlugin - Posted notice $notice->id w/attachment " . "to Facebook user's stream (fbuid = $fbuid)."); } elseif ($can_update == 1 || $can_publish == 1) { $facebook->api_client->users_setStatus($status, $fbuid, false, true); common_log(LOG_INFO, - "Posted notice $notice->id to Facebook " . + "FacebookPlugin - Posted notice $notice->id to Facebook " . "as a status update (fbuid = $fbuid)."); } else { - $msg = "Not sending notice $notice->id to Facebook " . + $msg = "FacebookPlugin - Not sending notice $notice->id to Facebook " . "because user $user->nickname hasn't given the " . 'Facebook app \'status_update\' or \'publish_stream\' permission.'; common_log(LOG_WARNING, $msg); @@ -138,7 +142,7 @@ function facebookBroadcastNotice($notice) $code = $e->getCode(); - $msg = "Facebook returned error code $code: " . + $msg = "FacebookPlugin - Facebook returned error code $code: " . $e->getMessage() . ' - ' . "Unable to update Facebook status (notice $notice->id) " . "for $user->nickname (user id: $user->id)!"; @@ -272,12 +276,12 @@ function remove_facebook_app($flink) function mail_facebook_app_removed($user) { - common_init_locale($user->language); - $profile = $user->getProfile(); $site_name = common_config('site', 'name'); + common_switch_locale($user->language); + $subject = sprintf( _m('Your %1$s Facebook application access has been disabled.', $site_name)); @@ -291,7 +295,7 @@ function mail_facebook_app_removed($user) "re-installing the %2\$s Facebook application.\n\nRegards,\n\n%2\$s"), $user->nickname, $site_name); - common_init_locale(); + common_switch_locale(); return mail_to_user($user, $subject, $body); } diff --git a/plugins/Facebook/locale/Facebook.pot b/plugins/Facebook/locale/Facebook.pot index 4bc00248c..dce10d230 100644 --- a/plugins/Facebook/locale/Facebook.pot +++ b/plugins/Facebook/locale/Facebook.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-01 14:58-0800\n" +"POT-Creation-Date: 2010-04-29 23:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,72 +16,129 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: facebookaction.php:171 -msgid "Home" +#: facebookutil.php:285 +#, php-format +msgid "" +"Hi, %1$s. We're sorry to inform you that we are unable to update your " +"Facebook status from %2$s, and have disabled the Facebook application for " +"your account. This may be because you have removed the Facebook " +"application's authorization, or have deleted your Facebook account. You can " +"re-enable the Facebook application and automatic status updating by re-" +"installing the %2$s Facebook application.\n" +"\n" +"Regards,\n" +"\n" +"%2$s" msgstr "" -#: facebookaction.php:179 -msgid "Invite" +#: FBConnectAuth.php:51 +msgid "You must be logged into Facebook to use Facebook Connect." msgstr "" -#: facebookaction.php:188 -msgid "Settings" +#: FBConnectAuth.php:77 +msgid "There is already a local user linked with this Facebook." msgstr "" -#: facebookaction.php:228 +#: FBConnectAuth.php:90 FBConnectSettings.php:164 +msgid "There was a problem with your session token. Try again, please." +msgstr "" + +#: FBConnectAuth.php:95 +msgid "You can't register if you don't agree to the license." +msgstr "" + +#: FBConnectAuth.php:105 +msgid "Something weird happened." +msgstr "" + +#: FBConnectAuth.php:119 #, php-format msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet? " +"This is the first time you've logged into %s so we must connect your " +"Facebook to a local account. You can either create a new account, or connect " +"with your existing account, if you have one." msgstr "" -#: facebookaction.php:230 -msgid " a new account." +#: FBConnectAuth.php:125 +msgid "Facebook Account Setup" msgstr "" -#: facebookaction.php:236 -msgid "Register" +#: FBConnectAuth.php:158 +msgid "Connection options" msgstr "" -#: facebookaction.php:249 facebookaction.php:275 facebooklogin.php:91 -msgid "Login" +#: FBConnectAuth.php:183 +msgid "Create new account" msgstr "" -#: facebookaction.php:268 -msgid "Nickname" +#: FBConnectAuth.php:185 +msgid "Create a new user with this nickname." msgstr "" -#: facebookaction.php:271 FBConnectAuth.php:196 +#: FBConnectAuth.php:188 +msgid "New nickname" +msgstr "" + +#: FBConnectAuth.php:190 +msgid "1-64 lowercase letters or numbers, no punctuation or spaces" +msgstr "" + +#: FBConnectAuth.php:193 +msgid "Create" +msgstr "" + +#: FBConnectAuth.php:198 +msgid "Connect existing account" +msgstr "" + +#: FBConnectAuth.php:200 +msgid "" +"If you already have an account, login with your username and password to " +"connect it to your Facebook." +msgstr "" + +#: FBConnectAuth.php:203 +msgid "Existing nickname" +msgstr "" + +#: FBConnectAuth.php:206 facebookaction.php:271 msgid "Password" msgstr "" -#: facebookaction.php:281 -msgid "Lost or forgotten password?" +#: FBConnectAuth.php:209 +msgid "Connect" msgstr "" -#: facebookaction.php:330 facebookhome.php:248 -msgid "Pagination" +#: FBConnectAuth.php:225 FBConnectAuth.php:234 +msgid "Registration not allowed." msgstr "" -#: facebookaction.php:339 facebookhome.php:257 -msgid "After" +#: FBConnectAuth.php:241 +msgid "Not a valid invitation code." msgstr "" -#: facebookaction.php:347 facebookhome.php:265 -msgid "Before" +#: FBConnectAuth.php:251 +msgid "Nickname must have only lowercase letters and numbers and no spaces." msgstr "" -#: facebookaction.php:365 -msgid "No notice content!" +#: FBConnectAuth.php:256 +msgid "Nickname not allowed." msgstr "" -#: facebookaction.php:371 -#, php-format -msgid "That's too long. Max notice size is %d chars." +#: FBConnectAuth.php:261 +msgid "Nickname already in use. Try another one." msgstr "" -#: facebookaction.php:430 -msgid "Notices" +#: FBConnectAuth.php:279 FBConnectAuth.php:313 FBConnectAuth.php:333 +msgid "Error connecting user to Facebook." +msgstr "" + +#: FBConnectAuth.php:299 +msgid "Invalid username or password." +msgstr "" + +#: facebooklogin.php:91 facebookaction.php:249 facebookaction.php:275 +msgid "Login" msgstr "" #: facebookhome.php:111 @@ -117,6 +174,18 @@ msgstr "" msgid "Skip" msgstr "" +#: facebookhome.php:248 facebookaction.php:330 +msgid "Pagination" +msgstr "" + +#: facebookhome.php:257 facebookaction.php:339 +msgid "After" +msgstr "" + +#: facebookhome.php:265 facebookaction.php:347 +msgid "Before" +msgstr "" + #: facebookinvite.php:72 #, php-format msgid "Thanks for inviting your friends to use %s" @@ -145,208 +214,123 @@ msgstr "" msgid "Send invitations" msgstr "" -#: FacebookPlugin.php:413 FacebookPlugin.php:433 +#: FacebookPlugin.php:195 FacebookPlugin.php:488 FacebookPlugin.php:510 +#: facebookadminpanel.php:54 msgid "Facebook" msgstr "" -#: FacebookPlugin.php:414 +#: FacebookPlugin.php:196 +msgid "Facebook integration configuration" +msgstr "" + +#: FacebookPlugin.php:489 msgid "Login or register using Facebook" msgstr "" -#: FacebookPlugin.php:434 FBConnectSettings.php:56 +#: FacebookPlugin.php:511 FBConnectSettings.php:56 msgid "Facebook Connect Settings" msgstr "" -#: FacebookPlugin.php:533 +#: FacebookPlugin.php:617 msgid "" "The Facebook plugin allows you to integrate your StatusNet instance with <a " "href=\"http://facebook.com/\">Facebook</a> and Facebook Connect." msgstr "" -#: facebookremove.php:58 -msgid "Couldn't remove Facebook user." -msgstr "" - -#: facebooksettings.php:74 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#: facebooksettings.php:76 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:99 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:106 -msgid "Send \"@\" replies to Facebook." +#: FBConnectLogin.php:33 +msgid "Already logged in." msgstr "" -#: facebooksettings.php:115 -msgid "Prefix" +#: FBConnectLogin.php:41 +msgid "Login with your Facebook Account" msgstr "" -#: facebooksettings.php:117 -msgid "A string to prefix notices with." +#: FBConnectLogin.php:55 +msgid "Facebook Login" msgstr "" -#: facebooksettings.php:123 -msgid "Save" +#: facebookremove.php:58 +msgid "Couldn't remove Facebook user." msgstr "" -#: facebooksettings.php:133 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." +#: facebookaction.php:171 +msgid "Home" msgstr "" -#: facebooksettings.php:146 -#, php-format -msgid "Allow %s to update my Facebook status" +#: facebookaction.php:179 +msgid "Invite" msgstr "" -#: facebooksettings.php:156 -msgid "Sync preferences" +#: facebookaction.php:188 +msgid "Settings" msgstr "" -#: facebookutil.php:285 +#: facebookaction.php:228 #, php-format msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" +"To use the %s Facebook Application you need to login with your username and " +"password. Don't have a username yet? " msgstr "" -#: FBConnectAuth.php:51 -msgid "You must be logged into Facebook to use Facebook Connect." +#: facebookaction.php:230 +msgid " a new account." msgstr "" -#: FBConnectAuth.php:77 -msgid "There is already a local user linked with this Facebook." +#: facebookaction.php:236 +msgid "Register" msgstr "" -#: FBConnectAuth.php:90 FBConnectSettings.php:164 -msgid "There was a problem with your session token. Try again, please." +#: facebookaction.php:268 +msgid "Nickname" msgstr "" -#: FBConnectAuth.php:95 -msgid "You can't register if you don't agree to the license." +#: facebookaction.php:281 +msgid "Lost or forgotten password?" msgstr "" -#: FBConnectAuth.php:105 -msgid "Something weird happened." +#: facebookaction.php:365 +msgid "No notice content!" msgstr "" -#: FBConnectAuth.php:119 +#: facebookaction.php:371 #, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" - -#: FBConnectAuth.php:125 -msgid "Facebook Account Setup" -msgstr "" - -#: FBConnectAuth.php:153 -msgid "Connection options" -msgstr "" - -#: FBConnectAuth.php:162 -msgid "My text and files are available under " -msgstr "" - -#: FBConnectAuth.php:165 -msgid "" -" except this private data: password, email address, IM address, phone number." -msgstr "" - -#: FBConnectAuth.php:173 -msgid "Create new account" -msgstr "" - -#: FBConnectAuth.php:175 -msgid "Create a new user with this nickname." -msgstr "" - -#: FBConnectAuth.php:178 -msgid "New nickname" -msgstr "" - -#: FBConnectAuth.php:180 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" - -#: FBConnectAuth.php:183 -msgid "Create" -msgstr "" - -#: FBConnectAuth.php:188 -msgid "Connect existing account" -msgstr "" - -#: FBConnectAuth.php:190 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" - -#: FBConnectAuth.php:193 -msgid "Existing nickname" -msgstr "" - -#: FBConnectAuth.php:199 -msgid "Connect" -msgstr "" - -#: FBConnectAuth.php:215 FBConnectAuth.php:224 -msgid "Registration not allowed." +msgid "That's too long. Max notice size is %d chars." msgstr "" -#: FBConnectAuth.php:231 -msgid "Not a valid invitation code." +#: facebookaction.php:430 +msgid "Notices" msgstr "" -#: FBConnectAuth.php:241 -msgid "Nickname must have only lowercase letters and numbers and no spaces." +#: facebookadminpanel.php:65 +msgid "Facebook integration settings" msgstr "" -#: FBConnectAuth.php:246 -msgid "Nickname not allowed." +#: facebookadminpanel.php:129 +msgid "Invalid Facebook API key. Max length is 255 characters." msgstr "" -#: FBConnectAuth.php:251 -msgid "Nickname already in use. Try another one." +#: facebookadminpanel.php:135 +msgid "Invalid Facebook API secret. Max length is 255 characters." msgstr "" -#: FBConnectAuth.php:269 FBConnectAuth.php:303 FBConnectAuth.php:323 -msgid "Error connecting user to Facebook." +#: facebookadminpanel.php:188 +msgid "Facebook application settings" msgstr "" -#: FBConnectAuth.php:289 -msgid "Invalid username or password." +#: facebookadminpanel.php:194 +msgid "API key" msgstr "" -#: FBConnectLogin.php:33 -msgid "Already logged in." +#: facebookadminpanel.php:195 +msgid "API key provided by Facebook" msgstr "" -#: FBConnectLogin.php:41 -msgid "Login with your Facebook Account" +#: facebookadminpanel.php:203 +msgid "Secret" msgstr "" -#: FBConnectLogin.php:55 -msgid "Facebook Login" +#: facebookadminpanel.php:204 +msgid "API secret provided by Facebook" msgstr "" #: FBConnectSettings.php:67 @@ -393,3 +377,47 @@ msgstr "" #: FBConnectSettings.php:197 msgid "Not sure what you're trying to do." msgstr "" + +#: facebooksettings.php:74 +msgid "There was a problem saving your sync preferences!" +msgstr "" + +#: facebooksettings.php:76 +msgid "Sync preferences saved." +msgstr "" + +#: facebooksettings.php:99 +msgid "Automatically update my Facebook status with my notices." +msgstr "" + +#: facebooksettings.php:106 +msgid "Send \"@\" replies to Facebook." +msgstr "" + +#: facebooksettings.php:115 +msgid "Prefix" +msgstr "" + +#: facebooksettings.php:117 +msgid "A string to prefix notices with." +msgstr "" + +#: facebooksettings.php:123 +msgid "Save" +msgstr "" + +#: facebooksettings.php:133 +#, php-format +msgid "" +"If you would like %s to automatically update your Facebook status with your " +"latest notice, you need to give it permission." +msgstr "" + +#: facebooksettings.php:146 +#, php-format +msgid "Allow %s to update my Facebook status" +msgstr "" + +#: facebooksettings.php:156 +msgid "Sync preferences" +msgstr "" |