code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 14:33+0000\n"
"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
"Language-Team: Ukrainian (http://www.transifex.com/projects/p/gnu-social/language/uk/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#. TRANS: Title for Facebook administration panel.
#: actions/facebookadminpanel.php:53
msgctxt "TITLE"
msgid "Facebook integration settings"
msgstr "Налаштування інтеграції з Facebook"

#. TRANS: Instruction for Facebook administration panel.
#: actions/facebookadminpanel.php:64
msgid "Facebook integration settings"
msgstr "Налаштування інтеграції з Facebook"

#. TRANS: Client error displayed when providing too long a Facebook
#. application ID.
#: actions/facebookadminpanel.php:126
msgid "Invalid Facebook ID. Maximum length is 255 characters."
msgstr "Неприпустимий ідентифікатор Facebook. Максимальна довжина — 255 символів."

#. TRANS: Client error displayed when providing too long a Facebook secret
#. key.
#: actions/facebookadminpanel.php:133
msgid "Invalid Facebook secret. Maximum length is 255 characters."
msgstr "Помилковий секретний код Facebook. Максимальна довжина — 255 символів."

#. TRANS: Fieldset legend.
#: actions/facebookadminpanel.php:183
msgid "Facebook application settings"
msgstr "Налаштування додатку для Facebook"

#. TRANS: Field label for Facebook application ID.
#: actions/facebookadminpanel.php:190
msgid "Application ID"
msgstr "Ідентифікатор додатку"

#. TRANS: Field title for Facebook application ID.
#: actions/facebookadminpanel.php:192
msgid "ID of your Facebook application."
msgstr "Ідентифікатор вашого додатку Facebook."

#. TRANS: Field label for Facebook secret key.
#: actions/facebookadminpanel.php:201
msgid "Secret"
msgstr "Секретний код"

#. TRANS: Field title for Facebook secret key.
#: actions/facebookadminpanel.php:203
msgid "Application secret."
msgstr "Секретний код додатку."

#. TRANS: Button text to save Facebook integration settings.
#. TRANS: Submit button to save synchronisation settings.
#: actions/facebookadminpanel.php:220 actions/facebooksettings.php:188
msgctxt "BUTTON"
msgid "Save"
msgstr "Зберегти"

#. TRANS: Button title to save Facebook integration settings.
#: actions/facebookadminpanel.php:222
msgid "Save Facebook settings."
msgstr "Зберегти налаштування Facebook."

#. TRANS: Client error displayed when trying to login while already logged in.
#: actions/facebooklogin.php:43
msgid "Already logged in."
msgstr "Ви вже увійшли."

#. TRANS: Form instructions.
#: actions/facebooklogin.php:52
msgid "Login with your Facebook Account"
msgstr "Увійти з акаунтом Facebook"

#. TRANS: Page title.
#. TRANS: Alt text for "Login with Facebook" image.
#: actions/facebooklogin.php:67 actions/facebooklogin.php:92
msgid "Login with Facebook"
msgstr "Увійти з Facebook"

#. TRANS: Title for "Login with Facebook" image.
#: actions/facebooklogin.php:94
msgid "Login with Facebook."
msgstr "Увійти з Facebook."

#: actions/facebookfinishlogin.php:50
msgid "Unable to authenticate you with Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to Facebook while not
#. logged in.
#: actions/facebookfinishlogin.php:73
msgid ""
"You must be logged into Facebook to register a local account using Facebook."
msgstr "Спочатку ви маєте увійти до Facebook, аби мати змогу зареєструвати акаунт на цьому сервісі за допомогою Facebook."

#. TRANS: Client error displayed when trying to connect to a Facebook account
#. that is already linked
#. TRANS: in the same StatusNet site.
#: actions/facebookfinishlogin.php:117 actions/facebookfinishlogin.php:131
msgid "There is already a local account linked with that Facebook account."
msgstr "Один з тутешніх акаунтів вже прив’язаний до цього профілю у Facebook."

#. TRANS: Client error displayed when the session token does not match or is
#. not given.
#: actions/facebookfinishlogin.php:144 actions/facebooksettings.php:87
msgid "There was a problem with your session token. Try again, please."
msgstr "Виникла проблема з вашим токеном сесії. Спробуйте пізніше, будь ласка."

#. TRANS: Form validation error displayed when user has not agreed to the
#. license.
#: actions/facebookfinishlogin.php:154
msgid "You cannot register if you do not agree to the license."
msgstr "Ви не можете зареєструватись, якщо не погодитесь з умовами ліцензії."

#. TRANS: Form validation error displayed when an unhandled error occurs.
#: actions/facebookfinishlogin.php:172
msgid "An unknown error has occured."
msgstr "Сталася невідома помилка."

#. TRANS: Form instructions for connecting to Facebook.
#. TRANS: %s is the site name.
#: actions/facebookfinishlogin.php:191
#, php-format
msgid ""
"This is the first time you have logged into %s so we must connect your "
"Facebook to a local account. You can either create a new local account, or "
"connect with an existing local account."
msgstr "Ви вперше увійшли до сайту %s, отже ми мусимо приєднати ваш акаунт Facebook до акаунту на даному сайті. Ви маєте можливість створити новий локальний акаунт або використати такий, що вже існує."

#. TRANS: Page title.
#: actions/facebookfinishlogin.php:201
msgid "Facebook Setup"
msgstr "Установки Facebook"

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:235
msgid "Connection options"
msgstr "Опції з’єднання"

#. TRANS: %s is the name of the license used by the user for their status
#. updates.
#: actions/facebookfinishlogin.php:245
#, php-format
msgid ""
"My text and files are available under %s except this private data: password,"
" email address, IM address, and phone number."
msgstr "Мої дописи і файли доступні на умовах %s, окрім цих приватних даних: пароль, електронна адреса, адреса IM, телефонний номер."

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:262
msgid "Create new account"
msgstr "Створити новий акаунт"

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:265
msgid "Create a new user with this nickname."
msgstr "Створити нового користувача з цим нікнеймом."

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:273
msgid "New nickname"
msgstr "Новий псевдонім"

#. TRANS: Field title.
#: actions/facebookfinishlogin.php:276
msgid "1-64 lowercase letters or numbers, no punctuation or spaces."
msgstr "1-64 рядкові літери і цифри, ніякої пунктуації або інтервалів."

#. TRANS: Submit button to create a new account.
#: actions/facebookfinishlogin.php:284
msgctxt "BUTTON"
msgid "Create"
msgstr "Створити"

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:290
msgid "Connect existing account"
msgstr "Приєднати акаунт, який вже існує"

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:293
msgid ""
"If you already have an account, login with your username and password to "
"connect it to your Facebook."
msgstr "Якщо ви вже маєте акаунт, увійдіть з вашим ім’ям користувача та паролем, аби приєднати їх до Facebook."

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:297
msgid "Existing nickname"
msgstr "Нікнейм, який вже існує"

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:301
msgid "Password"
msgstr "Пароль"

#. TRANS: Submit button to connect a Facebook account to an existing StatusNet
#. account.
#: actions/facebookfinishlogin.php:305
msgctxt "BUTTON"
msgid "Connect"
msgstr "Під’єднати"

#. TRANS: Client error trying to register with registrations not allowed.
#. TRANS: Client error trying to register with registrations 'invite only'.
#: actions/facebookfinishlogin.php:326 actions/facebookfinishlogin.php:335
msgid "Registration not allowed."
msgstr "Реєстрацію не дозволено."

#. TRANS: Client error trying to register with an invalid invitation code.
#: actions/facebookfinishlogin.php:342
msgid "Not a valid invitation code."
msgstr "Це не дійсний код запрошення."

#. TRANS: Server error displayed when connecting to Facebook fails.
#: actions/facebookfinishlogin.php:378 actions/facebookfinishlogin.php:511
msgid "Error connecting user to Facebook."
msgstr "Помилка при підключенні до Facebook."

#. TRANS: Form validation error displayed when username/password combination
#. is incorrect.
#: actions/facebookfinishlogin.php:478
msgid "Invalid username or password."
msgstr "Недійсне ім’я або пароль."

#. TRANS: Page title for Facebook settings.
#: actions/facebooksettings.php:106
msgctxt "TITLE"
msgid "Facebook settings"
msgstr "Налаштування Facebook"

#. TRANS: Instructions for Facebook settings.
#: actions/facebooksettings.php:116
msgid "Facebook settings"
msgstr "Налаштування Facebook"

#. TRANS: Form note. User is connected to facebook.
#: actions/facebooksettings.php:140
msgid "Connected Facebook user"
msgstr "Під’єднаний користувач Facebook"

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:168
msgid "Publish my notices to Facebook."
msgstr "Публікувати мої дописи у Facebook."

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:179
msgid "Send \"@\" replies to Facebook."
msgstr "Надсилати «@» відповіді до Facebook."

#. TRANS: Fieldset legend for form to disconnect from Facebook.
#: actions/facebooksettings.php:197
msgid "Disconnect my account from Facebook"
msgstr "Від’єднати мій акаунт від Facebook"

#. TRANS: Notice in disconnect from Facebook form if user has no local
#. StatusNet password.
#: actions/facebooksettings.php:204
#, php-format
msgid ""
"Disconnecting your Faceboook would make it impossible to log in! Please [set"
" a password](%s) first."
msgstr "Якщо від’єднати ваш акаунт від Faceboook зараз, то це унеможливить вхід до сервісу у майбутньому! Будь ласка, спочатку [встановіть пароль](%s)."

#. TRANS: Message displayed when initiating disconnect of a StatusNet user
#. TRANS: from a Facebook account. %1$s is the StatusNet site name.
#: actions/facebooksettings.php:215
#, php-format
msgid ""
"Keep your %1$s account but disconnect from Facebook. You'll use your %1$s "
"password to log in."
msgstr "Зберегти ваш акаунт %1$s, але від’єднати його від Facebook. Ви можете використовувати пароль від %1$s для входу на сайт."

#. TRANS: Submit button.
#: actions/facebooksettings.php:221
msgctxt "BUTTON"
msgid "Disconnect"
msgstr "Від’єднати"

#. TRANS: Notice in case saving of synchronisation preferences fail.
#: actions/facebooksettings.php:245
msgid "There was a problem saving your sync preferences."
msgstr "Виникла проблема при збереженні параметрів синхронізації."

#. TRANS: Confirmation that synchronisation settings have been saved into the
#. system.
#: actions/facebooksettings.php:248
msgid "Sync preferences saved."
msgstr "Параметри синхронізації збережено."

#. TRANS: Server error displayed when deleting the link to a Facebook account
#. fails.
#: actions/facebooksettings.php:263
msgid "Could not delete link to Facebook."
msgstr "Не можу видалити посилання на Facebook."

#. TRANS: Confirmation message. StatusNet account was unlinked from Facebook.
#: actions/facebooksettings.php:267
msgid "You have disconnected from Facebook."
msgstr "Ви від’єдналися від Facebook."

#. TRANS: Menu item for "Facebook" in administration panel.
#. TRANS: Menu item for "Facebook" in user settings.
#: FacebookBridgePlugin.php:202 FacebookBridgePlugin.php:241
#: FacebookBridgePlugin.php:281
msgctxt "MENU"
msgid "Facebook"
msgstr "Facebook"

#. TRANS: Menu title for "Facebook" login.
#: FacebookBridgePlugin.php:204
msgid "Login or register using Facebook."
msgstr "Увійти або зареєструватися з Facebook."

#. TRANS: Menu title for "Facebook" in administration panel.
#: FacebookBridgePlugin.php:243
msgid "Facebook integration configuration."
msgstr "Налаштування інтеграції з Facebook."

#. TRANS: Menu title for "Facebook" in user settings.
#: FacebookBridgePlugin.php:283
msgid "Facebook settings."
msgstr "Налаштування Facebook."

#. TRANS: Plugin description.
#: FacebookBridgePlugin.php:624
msgid "A plugin for integrating StatusNet with Facebook."
msgstr "Додаток для інтеграції StatusNet з Facebook."

#. TRANS: E-mail subject.
#: lib/facebookclient.php:790
msgid "Your Facebook connection has been removed"
msgstr "З’єднання з Facebook було видалено"

#. TRANS: E-mail body. %1$s is a username, %2$s is the StatusNet sitename.
#: lib/facebookclient.php:793
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We are sorry to inform you we are unable to publish your notice to\n"
"Facebook, and have removed the connection between your %2$s account and\n"
"Facebook.\n"
"\n"
"This may have happened because you have removed permission for %2$s\n"
"to post on your behalf, or perhaps you have deactivated your Facebook\n"
"account. You can reconnect your %2$s account to Facebook at any time by\n"
"logging in with Facebook again.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr "Вітаємо, %1$s\n\nНам прикро вас про це повідомляти, але ми не в змозі опублікувати ваш допис на Facebook, також ми скасували з’єднання між вашим акаунтом на %2$s і Facebook.\n\nТаке могло трапитися тому, що ви видалили дозвіл %2$s на публікацію дописів від вашого імені, або ж, можливо, ви вимкнули свій акаунт на Facebook. Ви можете під’єднати свій акаунт на %2$s до Facebook у будь-який час знову, просто зайшовши на наш сайт через вхід для Facebook.\n\nЩиро ваші,\n\n%2$s\n"

#. TRANS: E-mail subject. %s is the StatusNet sitename.
#: lib/facebookclient.php:846
#, php-format
msgid "Contact the %s administrator to retrieve your account"
msgstr "Зверніться до адміністратора %s, аби відновити свій обліковий запис"

#. TRANS: E-mail body. %1$s is a username,
#. TRANS: %2$s is the StatusNet sitename, %3$s is the site contact e-mail
#. address.
#: lib/facebookclient.php:850
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We have noticed you have deauthorized the Facebook connection for your\n"
"%2$s account.  You have not set a password for your %2$s account yet, so\n"
"you will not be able to login. If you wish to continue using your %2$s\n"
"account, please contact the site administrator (%3$s) to set a password.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr "Привіт, %1$s\n\nМи зауважили, що ви скасували дозвіл на з’єднання між Facebook та вашим акаунтом на %2$s. Перед цим ви не встановили пароль для свого акаунту на %2$s, тож тепер не зможете увійти на наш сайт знову. Якщо ви все ж таки бажаєте користуватися своїм акаунтом на %2$s далі, то зв’яжіться, будь ласка, з адміністратором сайту (%3$s), аби встановити пароль для входу.\n\nЩиро ваші,\n\n%2$s\n"


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-06 16:16+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Urdu (Pakistan) (http://www.transifex.com/projects/p/gnu-social/language/ur_PK/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ur_PK\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Title for Facebook administration panel.
#: actions/facebookadminpanel.php:53
msgctxt "TITLE"
msgid "Facebook integration settings"
msgstr ""

#. TRANS: Instruction for Facebook administration panel.
#: actions/facebookadminpanel.php:64
msgid "Facebook integration settings"
msgstr ""

#. TRANS: Client error displayed when providing too long a Facebook
#. application ID.
#: actions/facebookadminpanel.php:126
msgid "Invalid Facebook ID. Maximum length is 255 characters."
msgstr ""

#. TRANS: Client error displayed when providing too long a Facebook secret
#. key.
#: actions/facebookadminpanel.php:133
msgid "Invalid Facebook secret. Maximum length is 255 characters."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookadminpanel.php:183
msgid "Facebook application settings"
msgstr ""

#. TRANS: Field label for Facebook application ID.
#: actions/facebookadminpanel.php:190
msgid "Application ID"
msgstr ""

#. TRANS: Field title for Facebook application ID.
#: actions/facebookadminpanel.php:192
msgid "ID of your Facebook application."
msgstr ""

#. TRANS: Field label for Facebook secret key.
#: actions/facebookadminpanel.php:201
msgid "Secret"
msgstr ""

#. TRANS: Field title for Facebook secret key.
#: actions/facebookadminpanel.php:203
msgid "Application secret."
msgstr ""

#. TRANS: Button text to save Facebook integration settings.
#. TRANS: Submit button to save synchronisation settings.
#: actions/facebookadminpanel.php:220 actions/facebooksettings.php:188
msgctxt "BUTTON"
msgid "Save"
msgstr "تبدیلیاں محفوظ کریں"

#. TRANS: Button title to save Facebook integration settings.
#: actions/facebookadminpanel.php:222
msgid "Save Facebook settings."
msgstr ""

#. TRANS: Client error displayed when trying to login while already logged in.
#: actions/facebooklogin.php:43
msgid "Already logged in."
msgstr ""

#. TRANS: Form instructions.
#: actions/facebooklogin.php:52
msgid "Login with your Facebook Account"
msgstr ""

#. TRANS: Page title.
#. TRANS: Alt text for "Login with Facebook" image.
#: actions/facebooklogin.php:67 actions/facebooklogin.php:92
msgid "Login with Facebook"
msgstr ""

#. TRANS: Title for "Login with Facebook" image.
#: actions/facebooklogin.php:94
msgid "Login with Facebook."
msgstr ""

#: actions/facebookfinishlogin.php:50
msgid "Unable to authenticate you with Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to Facebook while not
#. logged in.
#: actions/facebookfinishlogin.php:73
msgid ""
"You must be logged into Facebook to register a local account using Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to a Facebook account
#. that is already linked
#. TRANS: in the same StatusNet site.
#: actions/facebookfinishlogin.php:117 actions/facebookfinishlogin.php:131
msgid "There is already a local account linked with that Facebook account."
msgstr ""

#. TRANS: Client error displayed when the session token does not match or is
#. not given.
#: actions/facebookfinishlogin.php:144 actions/facebooksettings.php:87
msgid "There was a problem with your session token. Try again, please."
msgstr ""

#. TRANS: Form validation error displayed when user has not agreed to the
#. license.
#: actions/facebookfinishlogin.php:154
msgid "You cannot register if you do not agree to the license."
msgstr ""

#. TRANS: Form validation error displayed when an unhandled error occurs.
#: actions/facebookfinishlogin.php:172
msgid "An unknown error has occured."
msgstr ""

#. TRANS: Form instructions for connecting to Facebook.
#. TRANS: %s is the site name.
#: actions/facebookfinishlogin.php:191
#, php-format
msgid ""
"This is the first time you have logged into %s so we must connect your "
"Facebook to a local account. You can either create a new local account, or "
"connect with an existing local account."
msgstr ""

#. TRANS: Page title.
#: actions/facebookfinishlogin.php:201
msgid "Facebook Setup"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:235
msgid "Connection options"
msgstr ""

#. TRANS: %s is the name of the license used by the user for their status
#. updates.
#: actions/facebookfinishlogin.php:245
#, php-format
msgid ""
"My text and files are available under %s except this private data: password,"
" email address, IM address, and phone number."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:262
msgid "Create new account"
msgstr ""

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:265
msgid "Create a new user with this nickname."
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:273
msgid "New nickname"
msgstr ""

#. TRANS: Field title.
#: actions/facebookfinishlogin.php:276
msgid "1-64 lowercase letters or numbers, no punctuation or spaces."
msgstr ""

#. TRANS: Submit button to create a new account.
#: actions/facebookfinishlogin.php:284
msgctxt "BUTTON"
msgid "Create"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:290
msgid "Connect existing account"
msgstr ""

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:293
msgid ""
"If you already have an account, login with your username and password to "
"connect it to your Facebook."
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:297
msgid "Existing nickname"
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:301
msgid "Password"
msgstr ""

#. TRANS: Submit button to connect a Facebook account to an existing StatusNet
#. account.
#: actions/facebookfinishlogin.php:305
msgctxt "BUTTON"
msgid "Connect"
msgstr ""

#. TRANS: Client error trying to register with registrations not allowed.
#. TRANS: Client error trying to register with registrations 'invite only'.
#: actions/facebookfinishlogin.php:326 actions/facebookfinishlogin.php:335
msgid "Registration not allowed."
msgstr ""

#. TRANS: Client error trying to register with an invalid invitation code.
#: actions/facebookfinishlogin.php:342
msgid "Not a valid invitation code."
msgstr ""

#. TRANS: Server error displayed when connecting to Facebook fails.
#: actions/facebookfinishlogin.php:378 actions/facebookfinishlogin.php:511
msgid "Error connecting user to Facebook."
msgstr ""

#. TRANS: Form validation error displayed when username/password combination
#. is incorrect.
#: actions/facebookfinishlogin.php:478
msgid "Invalid username or password."
msgstr ""

#. TRANS: Page title for Facebook settings.
#: actions/facebooksettings.php:106
msgctxt "TITLE"
msgid "Facebook settings"
msgstr ""

#. TRANS: Instructions for Facebook settings.
#: actions/facebooksettings.php:116
msgid "Facebook settings"
msgstr ""

#. TRANS: Form note. User is connected to facebook.
#: actions/facebooksettings.php:140
msgid "Connected Facebook user"
msgstr ""

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:168
msgid "Publish my notices to Facebook."
msgstr ""

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:179
msgid "Send \"@\" replies to Facebook."
msgstr ""

#. TRANS: Fieldset legend for form to disconnect from Facebook.
#: actions/facebooksettings.php:197
msgid "Disconnect my account from Facebook"
msgstr ""

#. TRANS: Notice in disconnect from Facebook form if user has no local
#. StatusNet password.
#: actions/facebooksettings.php:204
#, php-format
msgid ""
"Disconnecting your Faceboook would make it impossible to log in! Please [set"
" a password](%s) first."
msgstr ""

#. TRANS: Message displayed when initiating disconnect of a StatusNet user
#. TRANS: from a Facebook account. %1$s is the StatusNet site name.
#: actions/facebooksettings.php:215
#, php-format
msgid ""
"Keep your %1$s account but disconnect from Facebook. You'll use your %1$s "
"password to log in."
msgstr ""

#. TRANS: Submit button.
#: actions/facebooksettings.php:221
msgctxt "BUTTON"
msgid "Disconnect"
msgstr ""

#. TRANS: Notice in case saving of synchronisation preferences fail.
#: actions/facebooksettings.php:245
msgid "There was a problem saving your sync preferences."
msgstr ""

#. TRANS: Confirmation that synchronisation settings have been saved into the
#. system.
#: actions/facebooksettings.php:248
msgid "Sync preferences saved."
msgstr ""

#. TRANS: Server error displayed when deleting the link to a Facebook account
#. fails.
#: actions/facebooksettings.php:263
msgid "Could not delete link to Facebook."
msgstr ""

#. TRANS: Confirmation message. StatusNet account was unlinked from Facebook.
#: actions/facebooksettings.php:267
msgid "You have disconnected from Facebook."
msgstr ""

#. TRANS: Menu item for "Facebook" in administration panel.
#. TRANS: Menu item for "Facebook" in user settings.
#: FacebookBridgePlugin.php:202 FacebookBridgePlugin.php:241
#: FacebookBridgePlugin.php:281
msgctxt "MENU"
msgid "Facebook"
msgstr ""

#. TRANS: Menu title for "Facebook" login.
#: FacebookBridgePlugin.php:204
msgid "Login or register using Facebook."
msgstr ""

#. TRANS: Menu title for "Facebook" in administration panel.
#: FacebookBridgePlugin.php:243
msgid "Facebook integration configuration."
msgstr ""

#. TRANS: Menu title for "Facebook" in user settings.
#: FacebookBridgePlugin.php:283
msgid "Facebook settings."
msgstr ""

#. TRANS: Plugin description.
#: FacebookBridgePlugin.php:624
msgid "A plugin for integrating StatusNet with Facebook."
msgstr ""

#. TRANS: E-mail subject.
#: lib/facebookclient.php:790
msgid "Your Facebook connection has been removed"
msgstr ""

#. TRANS: E-mail body. %1$s is a username, %2$s is the StatusNet sitename.
#: lib/facebookclient.php:793
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We are sorry to inform you we are unable to publish your notice to\n"
"Facebook, and have removed the connection between your %2$s account and\n"
"Facebook.\n"
"\n"
"This may have happened because you have removed permission for %2$s\n"
"to post on your behalf, or perhaps you have deactivated your Facebook\n"
"account. You can reconnect your %2$s account to Facebook at any time by\n"
"logging in with Facebook again.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""

#. TRANS: E-mail subject. %s is the StatusNet sitename.
#: lib/facebookclient.php:846
#, php-format
msgid "Contact the %s administrator to retrieve your account"
msgstr ""

#. TRANS: E-mail body. %1$s is a username,
#. TRANS: %2$s is the StatusNet sitename, %3$s is the site contact e-mail
#. address.
#: lib/facebookclient.php:850
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We have noticed you have deauthorized the Facebook connection for your\n"
"%2$s account.  You have not set a password for your %2$s account yet, so\n"
"you will not be able to login. If you wish to continue using your %2$s\n"
"account, please contact the site administrator (%3$s) to set a password.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""

repo_name: piratas/tortuga

license: mit


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-06 16:16+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Vietnamese (http://www.transifex.com/projects/p/gnu-social/language/vi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: vi\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Title for Facebook administration panel.
#: actions/facebookadminpanel.php:53
msgctxt "TITLE"
msgid "Facebook integration settings"
msgstr ""

#. TRANS: Instruction for Facebook administration panel.
#: actions/facebookadminpanel.php:64
msgid "Facebook integration settings"
msgstr ""

#. TRANS: Client error displayed when providing too long a Facebook
#. application ID.
#: actions/facebookadminpanel.php:126
msgid "Invalid Facebook ID. Maximum length is 255 characters."
msgstr ""

#. TRANS: Client error displayed when providing too long a Facebook secret
#. key.
#: actions/facebookadminpanel.php:133
msgid "Invalid Facebook secret. Maximum length is 255 characters."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookadminpanel.php:183
msgid "Facebook application settings"
msgstr ""

#. TRANS: Field label for Facebook application ID.
#: actions/facebookadminpanel.php:190
msgid "Application ID"
msgstr ""

#. TRANS: Field title for Facebook application ID.
#: actions/facebookadminpanel.php:192
msgid "ID of your Facebook application."
msgstr ""

#. TRANS: Field label for Facebook secret key.
#: actions/facebookadminpanel.php:201
msgid "Secret"
msgstr ""

#. TRANS: Field title for Facebook secret key.
#: actions/facebookadminpanel.php:203
msgid "Application secret."
msgstr ""

#. TRANS: Button text to save Facebook integration settings.
#. TRANS: Submit button to save synchronisation settings.
#: actions/facebookadminpanel.php:220 actions/facebooksettings.php:188
msgctxt "BUTTON"
msgid "Save"
msgstr "Lưu"

#. TRANS: Button title to save Facebook integration settings.
#: actions/facebookadminpanel.php:222
msgid "Save Facebook settings."
msgstr ""

#. TRANS: Client error displayed when trying to login while already logged in.
#: actions/facebooklogin.php:43
msgid "Already logged in."
msgstr "Đã đăng nhập."

#. TRANS: Form instructions.
#: actions/facebooklogin.php:52
msgid "Login with your Facebook Account"
msgstr ""

#. TRANS: Page title.
#. TRANS: Alt text for "Login with Facebook" image.
#: actions/facebooklogin.php:67 actions/facebooklogin.php:92
msgid "Login with Facebook"
msgstr ""

#. TRANS: Title for "Login with Facebook" image.
#: actions/facebooklogin.php:94
msgid "Login with Facebook."
msgstr ""

#: actions/facebookfinishlogin.php:50
msgid "Unable to authenticate you with Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to Facebook while not
#. logged in.
#: actions/facebookfinishlogin.php:73
msgid ""
"You must be logged into Facebook to register a local account using Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to a Facebook account
#. that is already linked
#. TRANS: in the same StatusNet site.
#: actions/facebookfinishlogin.php:117 actions/facebookfinishlogin.php:131
msgid "There is already a local account linked with that Facebook account."
msgstr ""

#. TRANS: Client error displayed when the session token does not match or is
#. not given.
#: actions/facebookfinishlogin.php:144 actions/facebooksettings.php:87
msgid "There was a problem with your session token. Try again, please."
msgstr "Có lỗi xảy ra khi thao tác. Hãy thử lại lần nữa."

#. TRANS: Form validation error displayed when user has not agreed to the
#. license.
#: actions/facebookfinishlogin.php:154
msgid "You cannot register if you do not agree to the license."
msgstr ""

#. TRANS: Form validation error displayed when an unhandled error occurs.
#: actions/facebookfinishlogin.php:172
msgid "An unknown error has occured."
msgstr ""

#. TRANS: Form instructions for connecting to Facebook.
#. TRANS: %s is the site name.
#: actions/facebookfinishlogin.php:191
#, php-format
msgid ""
"This is the first time you have logged into %s so we must connect your "
"Facebook to a local account. You can either create a new local account, or "
"connect with an existing local account."
msgstr ""

#. TRANS: Page title.
#: actions/facebookfinishlogin.php:201
msgid "Facebook Setup"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:235
msgid "Connection options"
msgstr ""

#. TRANS: %s is the name of the license used by the user for their status
#. updates.
#: actions/facebookfinishlogin.php:245
#, php-format
msgid ""
"My text and files are available under %s except this private data: password,"
" email address, IM address, and phone number."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:262
msgid "Create new account"
msgstr ""

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:265
msgid "Create a new user with this nickname."
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:273
msgid "New nickname"
msgstr ""

#. TRANS: Field title.
#: actions/facebookfinishlogin.php:276
msgid "1-64 lowercase letters or numbers, no punctuation or spaces."
msgstr ""

#. TRANS: Submit button to create a new account.
#: actions/facebookfinishlogin.php:284
msgctxt "BUTTON"
msgid "Create"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:290
msgid "Connect existing account"
msgstr ""

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:293
msgid ""
"If you already have an account, login with your username and password to "
"connect it to your Facebook."
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:297
msgid "Existing nickname"
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:301
msgid "Password"
msgstr "Mật khẩu"

#. TRANS: Submit button to connect a Facebook account to an existing StatusNet
#. account.
#: actions/facebookfinishlogin.php:305
msgctxt "BUTTON"
msgid "Connect"
msgstr ""

#. TRANS: Client error trying to register with registrations not allowed.
#. TRANS: Client error trying to register with registrations 'invite only'.
#: actions/facebookfinishlogin.php:326 actions/facebookfinishlogin.php:335
msgid "Registration not allowed."
msgstr "Đăng ký"

#. TRANS: Client error trying to register with an invalid invitation code.
#: actions/facebookfinishlogin.php:342
msgid "Not a valid invitation code."
msgstr ""

#. TRANS: Server error displayed when connecting to Facebook fails.
#: actions/facebookfinishlogin.php:378 actions/facebookfinishlogin.php:511
msgid "Error connecting user to Facebook."
msgstr ""

#. TRANS: Form validation error displayed when username/password combination
#. is incorrect.
#: actions/facebookfinishlogin.php:478
msgid "Invalid username or password."
msgstr "Tên đăng nhập hoặc mật khẩu không hợp lệ."

#. TRANS: Page title for Facebook settings.
#: actions/facebooksettings.php:106
msgctxt "TITLE"
msgid "Facebook settings"
msgstr ""

#. TRANS: Instructions for Facebook settings.
#: actions/facebooksettings.php:116
msgid "Facebook settings"
msgstr ""

#. TRANS: Form note. User is connected to facebook.
#: actions/facebooksettings.php:140
msgid "Connected Facebook user"
msgstr ""

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:168
msgid "Publish my notices to Facebook."
msgstr ""

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:179
msgid "Send \"@\" replies to Facebook."
msgstr ""

#. TRANS: Fieldset legend for form to disconnect from Facebook.
#: actions/facebooksettings.php:197
msgid "Disconnect my account from Facebook"
msgstr ""

#. TRANS: Notice in disconnect from Facebook form if user has no local
#. StatusNet password.
#: actions/facebooksettings.php:204
#, php-format
msgid ""
"Disconnecting your Faceboook would make it impossible to log in! Please [set"
" a password](%s) first."
msgstr ""

#. TRANS: Message displayed when initiating disconnect of a StatusNet user
#. TRANS: from a Facebook account. %1$s is the StatusNet site name.
#: actions/facebooksettings.php:215
#, php-format
msgid ""
"Keep your %1$s account but disconnect from Facebook. You'll use your %1$s "
"password to log in."
msgstr ""

#. TRANS: Submit button.
#: actions/facebooksettings.php:221
msgctxt "BUTTON"
msgid "Disconnect"
msgstr ""

#. TRANS: Notice in case saving of synchronisation preferences fail.
#: actions/facebooksettings.php:245
msgid "There was a problem saving your sync preferences."
msgstr ""

#. TRANS: Confirmation that synchronisation settings have been saved into the
#. system.
#: actions/facebooksettings.php:248
msgid "Sync preferences saved."
msgstr ""

#. TRANS: Server error displayed when deleting the link to a Facebook account
#. fails.
#: actions/facebooksettings.php:263
msgid "Could not delete link to Facebook."
msgstr ""

#. TRANS: Confirmation message. StatusNet account was unlinked from Facebook.
#: actions/facebooksettings.php:267
msgid "You have disconnected from Facebook."
msgstr ""

#. TRANS: Menu item for "Facebook" in administration panel.
#. TRANS: Menu item for "Facebook" in user settings.
#: FacebookBridgePlugin.php:202 FacebookBridgePlugin.php:241
#: FacebookBridgePlugin.php:281
msgctxt "MENU"
msgid "Facebook"
msgstr ""

#. TRANS: Menu title for "Facebook" login.
#: FacebookBridgePlugin.php:204
msgid "Login or register using Facebook."
msgstr ""

#. TRANS: Menu title for "Facebook" in administration panel.
#: FacebookBridgePlugin.php:243
msgid "Facebook integration configuration."
msgstr ""

#. TRANS: Menu title for "Facebook" in user settings.
#: FacebookBridgePlugin.php:283
msgid "Facebook settings."
msgstr ""

#. TRANS: Plugin description.
#: FacebookBridgePlugin.php:624
msgid "A plugin for integrating StatusNet with Facebook."
msgstr ""

#. TRANS: E-mail subject.
#: lib/facebookclient.php:790
msgid "Your Facebook connection has been removed"
msgstr ""

#. TRANS: E-mail body. %1$s is a username, %2$s is the StatusNet sitename.
#: lib/facebookclient.php:793
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We are sorry to inform you we are unable to publish your notice to\n"
"Facebook, and have removed the connection between your %2$s account and\n"
"Facebook.\n"
"\n"
"This may have happened because you have removed permission for %2$s\n"
"to post on your behalf, or perhaps you have deactivated your Facebook\n"
"account. You can reconnect your %2$s account to Facebook at any time by\n"
"logging in with Facebook again.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""

#. TRANS: E-mail subject. %s is the StatusNet sitename.
#: lib/facebookclient.php:846
#, php-format
msgid "Contact the %s administrator to retrieve your account"
msgstr ""

#. TRANS: E-mail body. %1$s is a username,
#. TRANS: %2$s is the StatusNet sitename, %3$s is the site contact e-mail
#. address.
#: lib/facebookclient.php:850
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We have noticed you have deauthorized the Facebook connection for your\n"
"%2$s account.  You have not set a password for your %2$s account yet, so\n"
"you will not be able to login. If you wish to continue using your %2$s\n"
"account, please contact the site administrator (%3$s) to set a password.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-07 14:33+0000\n"
"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/gnu-social/language/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Title for Facebook administration panel.
#: actions/facebookadminpanel.php:53
msgctxt "TITLE"
msgid "Facebook integration settings"
msgstr "Facebook 集成设置"

#. TRANS: Instruction for Facebook administration panel.
#: actions/facebookadminpanel.php:64
msgid "Facebook integration settings"
msgstr "Facebook 集成设置"

#. TRANS: Client error displayed when providing too long a Facebook
#. application ID.
#: actions/facebookadminpanel.php:126
msgid "Invalid Facebook ID. Maximum length is 255 characters."
msgstr ""

#. TRANS: Client error displayed when providing too long a Facebook secret
#. key.
#: actions/facebookadminpanel.php:133
msgid "Invalid Facebook secret. Maximum length is 255 characters."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookadminpanel.php:183
msgid "Facebook application settings"
msgstr "Facebook 应用程序设置"

#. TRANS: Field label for Facebook application ID.
#: actions/facebookadminpanel.php:190
msgid "Application ID"
msgstr "应用程序 ID"

#. TRANS: Field title for Facebook application ID.
#: actions/facebookadminpanel.php:192
msgid "ID of your Facebook application."
msgstr ""

#. TRANS: Field label for Facebook secret key.
#: actions/facebookadminpanel.php:201
msgid "Secret"
msgstr "秘密"

#. TRANS: Field title for Facebook secret key.
#: actions/facebookadminpanel.php:203
msgid "Application secret."
msgstr ""

#. TRANS: Button text to save Facebook integration settings.
#. TRANS: Submit button to save synchronisation settings.
#: actions/facebookadminpanel.php:220 actions/facebooksettings.php:188
msgctxt "BUTTON"
msgid "Save"
msgstr "保存"

#. TRANS: Button title to save Facebook integration settings.
#: actions/facebookadminpanel.php:222
msgid "Save Facebook settings."
msgstr ""

#. TRANS: Client error displayed when trying to login while already logged in.
#: actions/facebooklogin.php:43
msgid "Already logged in."
msgstr "已登录。"

#. TRANS: Form instructions.
#: actions/facebooklogin.php:52
msgid "Login with your Facebook Account"
msgstr "与您的 Facebook 帐户登录"

#. TRANS: Page title.
#. TRANS: Alt text for "Login with Facebook" image.
#: actions/facebooklogin.php:67 actions/facebooklogin.php:92
msgid "Login with Facebook"
msgstr "使用 Facebook 登录"

#. TRANS: Title for "Login with Facebook" image.
#: actions/facebooklogin.php:94
msgid "Login with Facebook."
msgstr ""

#: actions/facebookfinishlogin.php:50
msgid "Unable to authenticate you with Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to Facebook while not
#. logged in.
#: actions/facebookfinishlogin.php:73
msgid ""
"You must be logged into Facebook to register a local account using Facebook."
msgstr "您必须登录到 Facebook 注册使用 Facebook 的本地帐户。"

#. TRANS: Client error displayed when trying to connect to a Facebook account
#. that is already linked
#. TRANS: in the same StatusNet site.
#: actions/facebookfinishlogin.php:117 actions/facebookfinishlogin.php:131
msgid "There is already a local account linked with that Facebook account."
msgstr "已存在与该 Facebook 帐户相关的本地帐户。"

#. TRANS: Client error displayed when the session token does not match or is
#. not given.
#: actions/facebookfinishlogin.php:144 actions/facebooksettings.php:87
msgid "There was a problem with your session token. Try again, please."
msgstr "有一个与您的会话令牌的问题。请再次尝试。"

#. TRANS: Form validation error displayed when user has not agreed to the
#. license.
#: actions/facebookfinishlogin.php:154
msgid "You cannot register if you do not agree to the license."
msgstr "你必须同意许可协议才能注册。"

#. TRANS: Form validation error displayed when an unhandled error occurs.
#: actions/facebookfinishlogin.php:172
msgid "An unknown error has occured."
msgstr "出现了一个未知的错误。"

#. TRANS: Form instructions for connecting to Facebook.
#. TRANS: %s is the site name.
#: actions/facebookfinishlogin.php:191
#, php-format
msgid ""
"This is the first time you have logged into %s so we must connect your "
"Facebook to a local account. You can either create a new local account, or "
"connect with an existing local account."
msgstr ""

#. TRANS: Page title.
#: actions/facebookfinishlogin.php:201
msgid "Facebook Setup"
msgstr "Facebook 安装程序"

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:235
msgid "Connection options"
msgstr "连接选项"

#. TRANS: %s is the name of the license used by the user for their status
#. updates.
#: actions/facebookfinishlogin.php:245
#, php-format
msgid ""
"My text and files are available under %s except this private data: password,"
" email address, IM address, and phone number."
msgstr "我的文字和文件在%s下提供，除了如下隐私内容：密码、电子邮件地址、IM 地址和电话号码。"

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:262
msgid "Create new account"
msgstr "创建新的帐户"

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:265
msgid "Create a new user with this nickname."
msgstr "此别名与创建新用户。"

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:273
msgid "New nickname"
msgstr "新的昵称"

#. TRANS: Field title.
#: actions/facebookfinishlogin.php:276
msgid "1-64 lowercase letters or numbers, no punctuation or spaces."
msgstr "1 到 64 个小写字母或数字，不包含标点或空格。"

#. TRANS: Submit button to create a new account.
#: actions/facebookfinishlogin.php:284
msgctxt "BUTTON"
msgid "Create"
msgstr "创建"

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:290
msgid "Connect existing account"
msgstr "连接现有的帐户"

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:293
msgid ""
"If you already have an account, login with your username and password to "
"connect it to your Facebook."
msgstr "如果您已经有一个的帐户使用您的用户名和密码以连接到在 Facebook 的登录。"

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:297
msgid "Existing nickname"
msgstr "现有的昵称"

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:301
msgid "Password"
msgstr "密码"

#. TRANS: Submit button to connect a Facebook account to an existing StatusNet
#. account.
#: actions/facebookfinishlogin.php:305
msgctxt "BUTTON"
msgid "Connect"
msgstr "连接"

#. TRANS: Client error trying to register with registrations not allowed.
#. TRANS: Client error trying to register with registrations 'invite only'.
#: actions/facebookfinishlogin.php:326 actions/facebookfinishlogin.php:335
msgid "Registration not allowed."
msgstr "不允许注册。"

#. TRANS: Client error trying to register with an invalid invitation code.
#: actions/facebookfinishlogin.php:342
msgid "Not a valid invitation code."
msgstr "不是一个有效的邀请代码。"

#. TRANS: Server error displayed when connecting to Facebook fails.
#: actions/facebookfinishlogin.php:378 actions/facebookfinishlogin.php:511
msgid "Error connecting user to Facebook."
msgstr "Facebook 中连接用户时出错。"

#. TRANS: Form validation error displayed when username/password combination
#. is incorrect.
#: actions/facebookfinishlogin.php:478
msgid "Invalid username or password."
msgstr "无效的用户名或密码。"

#. TRANS: Page title for Facebook settings.
#: actions/facebooksettings.php:106
msgctxt "TITLE"
msgid "Facebook settings"
msgstr "Facebook 的设置"

#. TRANS: Instructions for Facebook settings.
#: actions/facebooksettings.php:116
msgid "Facebook settings"
msgstr "Facebook 的设置"

#. TRANS: Form note. User is connected to facebook.
#: actions/facebooksettings.php:140
msgid "Connected Facebook user"
msgstr "已连接的 Facebook 用户"

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:168
msgid "Publish my notices to Facebook."
msgstr "将我的通知发布到 Facebook。"

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:179
msgid "Send \"@\" replies to Facebook."
msgstr "发送 \"@\" Facebook 的答复。"

#. TRANS: Fieldset legend for form to disconnect from Facebook.
#: actions/facebooksettings.php:197
msgid "Disconnect my account from Facebook"
msgstr "从 Facebook 拔下我的账户"

#. TRANS: Notice in disconnect from Facebook form if user has no local
#. StatusNet password.
#: actions/facebooksettings.php:204
#, php-format
msgid ""
"Disconnecting your Faceboook would make it impossible to log in! Please [set"
" a password](%s) first."
msgstr ""

#. TRANS: Message displayed when initiating disconnect of a StatusNet user
#. TRANS: from a Facebook account. %1$s is the StatusNet site name.
#: actions/facebooksettings.php:215
#, php-format
msgid ""
"Keep your %1$s account but disconnect from Facebook. You'll use your %1$s "
"password to log in."
msgstr ""

#. TRANS: Submit button.
#: actions/facebooksettings.php:221
msgctxt "BUTTON"
msgid "Disconnect"
msgstr ""

#. TRANS: Notice in case saving of synchronisation preferences fail.
#: actions/facebooksettings.php:245
msgid "There was a problem saving your sync preferences."
msgstr ""

#. TRANS: Confirmation that synchronisation settings have been saved into the
#. system.
#: actions/facebooksettings.php:248
msgid "Sync preferences saved."
msgstr ""

#. TRANS: Server error displayed when deleting the link to a Facebook account
#. fails.
#: actions/facebooksettings.php:263
msgid "Could not delete link to Facebook."
msgstr ""

#. TRANS: Confirmation message. StatusNet account was unlinked from Facebook.
#: actions/facebooksettings.php:267
msgid "You have disconnected from Facebook."
msgstr ""

#. TRANS: Menu item for "Facebook" in administration panel.
#. TRANS: Menu item for "Facebook" in user settings.
#: FacebookBridgePlugin.php:202 FacebookBridgePlugin.php:241
#: FacebookBridgePlugin.php:281
msgctxt "MENU"
msgid "Facebook"
msgstr "Facebook"

#. TRANS: Menu title for "Facebook" login.
#: FacebookBridgePlugin.php:204
msgid "Login or register using Facebook."
msgstr ""

#. TRANS: Menu title for "Facebook" in administration panel.
#: FacebookBridgePlugin.php:243
msgid "Facebook integration configuration."
msgstr ""

#. TRANS: Menu title for "Facebook" in user settings.
#: FacebookBridgePlugin.php:283
msgid "Facebook settings."
msgstr ""

#. TRANS: Plugin description.
#: FacebookBridgePlugin.php:624
msgid "A plugin for integrating StatusNet with Facebook."
msgstr "StatusNet 与结合 Facebook 的插件。"

#. TRANS: E-mail subject.
#: lib/facebookclient.php:790
msgid "Your Facebook connection has been removed"
msgstr "Facebook 的连接已被删除"

#. TRANS: E-mail body. %1$s is a username, %2$s is the StatusNet sitename.
#: lib/facebookclient.php:793
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We are sorry to inform you we are unable to publish your notice to\n"
"Facebook, and have removed the connection between your %2$s account and\n"
"Facebook.\n"
"\n"
"This may have happened because you have removed permission for %2$s\n"
"to post on your behalf, or perhaps you have deactivated your Facebook\n"
"account. You can reconnect your %2$s account to Facebook at any time by\n"
"logging in with Facebook again.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""

#. TRANS: E-mail subject. %s is the StatusNet sitename.
#: lib/facebookclient.php:846
#, php-format
msgid "Contact the %s administrator to retrieve your account"
msgstr "与 %s 管理员联系，以检索您的帐户"

#. TRANS: E-mail body. %1$s is a username,
#. TRANS: %2$s is the StatusNet sitename, %3$s is the site contact e-mail
#. address.
#: lib/facebookclient.php:850
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We have noticed you have deauthorized the Facebook connection for your\n"
"%2$s account.  You have not set a password for your %2$s account yet, so\n"
"you will not be able to login. If you wish to continue using your %2$s\n"
"account, please contact the site administrator (%3$s) to set a password.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: GNU social\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-02-02 17:47+0100\n"
"PO-Revision-Date: 2015-02-06 16:16+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/gnu-social/language/zh_TW/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_TW\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Title for Facebook administration panel.
#: actions/facebookadminpanel.php:53
msgctxt "TITLE"
msgid "Facebook integration settings"
msgstr ""

#. TRANS: Instruction for Facebook administration panel.
#: actions/facebookadminpanel.php:64
msgid "Facebook integration settings"
msgstr ""

#. TRANS: Client error displayed when providing too long a Facebook
#. application ID.
#: actions/facebookadminpanel.php:126
msgid "Invalid Facebook ID. Maximum length is 255 characters."
msgstr ""

#. TRANS: Client error displayed when providing too long a Facebook secret
#. key.
#: actions/facebookadminpanel.php:133
msgid "Invalid Facebook secret. Maximum length is 255 characters."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookadminpanel.php:183
msgid "Facebook application settings"
msgstr ""

#. TRANS: Field label for Facebook application ID.
#: actions/facebookadminpanel.php:190
msgid "Application ID"
msgstr ""

#. TRANS: Field title for Facebook application ID.
#: actions/facebookadminpanel.php:192
msgid "ID of your Facebook application."
msgstr ""

#. TRANS: Field label for Facebook secret key.
#: actions/facebookadminpanel.php:201
msgid "Secret"
msgstr ""

#. TRANS: Field title for Facebook secret key.
#: actions/facebookadminpanel.php:203
msgid "Application secret."
msgstr ""

#. TRANS: Button text to save Facebook integration settings.
#. TRANS: Submit button to save synchronisation settings.
#: actions/facebookadminpanel.php:220 actions/facebooksettings.php:188
msgctxt "BUTTON"
msgid "Save"
msgstr ""

#. TRANS: Button title to save Facebook integration settings.
#: actions/facebookadminpanel.php:222
msgid "Save Facebook settings."
msgstr ""

#. TRANS: Client error displayed when trying to login while already logged in.
#: actions/facebooklogin.php:43
msgid "Already logged in."
msgstr "已登入"

#. TRANS: Form instructions.
#: actions/facebooklogin.php:52
msgid "Login with your Facebook Account"
msgstr ""

#. TRANS: Page title.
#. TRANS: Alt text for "Login with Facebook" image.
#: actions/facebooklogin.php:67 actions/facebooklogin.php:92
msgid "Login with Facebook"
msgstr ""

#. TRANS: Title for "Login with Facebook" image.
#: actions/facebooklogin.php:94
msgid "Login with Facebook."
msgstr ""

#: actions/facebookfinishlogin.php:50
msgid "Unable to authenticate you with Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to Facebook while not
#. logged in.
#: actions/facebookfinishlogin.php:73
msgid ""
"You must be logged into Facebook to register a local account using Facebook."
msgstr ""

#. TRANS: Client error displayed when trying to connect to a Facebook account
#. that is already linked
#. TRANS: in the same StatusNet site.
#: actions/facebookfinishlogin.php:117 actions/facebookfinishlogin.php:131
msgid "There is already a local account linked with that Facebook account."
msgstr ""

#. TRANS: Client error displayed when the session token does not match or is
#. not given.
#: actions/facebookfinishlogin.php:144 actions/facebooksettings.php:87
msgid "There was a problem with your session token. Try again, please."
msgstr ""

#. TRANS: Form validation error displayed when user has not agreed to the
#. license.
#: actions/facebookfinishlogin.php:154
msgid "You cannot register if you do not agree to the license."
msgstr ""

#. TRANS: Form validation error displayed when an unhandled error occurs.
#: actions/facebookfinishlogin.php:172
msgid "An unknown error has occured."
msgstr ""

#. TRANS: Form instructions for connecting to Facebook.
#. TRANS: %s is the site name.
#: actions/facebookfinishlogin.php:191
#, php-format
msgid ""
"This is the first time you have logged into %s so we must connect your "
"Facebook to a local account. You can either create a new local account, or "
"connect with an existing local account."
msgstr ""

#. TRANS: Page title.
#: actions/facebookfinishlogin.php:201
msgid "Facebook Setup"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:235
msgid "Connection options"
msgstr ""

#. TRANS: %s is the name of the license used by the user for their status
#. updates.
#: actions/facebookfinishlogin.php:245
#, php-format
msgid ""
"My text and files are available under %s except this private data: password,"
" email address, IM address, and phone number."
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:262
msgid "Create new account"
msgstr ""

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:265
msgid "Create a new user with this nickname."
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:273
msgid "New nickname"
msgstr ""

#. TRANS: Field title.
#: actions/facebookfinishlogin.php:276
msgid "1-64 lowercase letters or numbers, no punctuation or spaces."
msgstr ""

#. TRANS: Submit button to create a new account.
#: actions/facebookfinishlogin.php:284
msgctxt "BUTTON"
msgid "Create"
msgstr ""

#. TRANS: Fieldset legend.
#: actions/facebookfinishlogin.php:290
msgid "Connect existing account"
msgstr ""

#. TRANS: Form instructions.
#: actions/facebookfinishlogin.php:293
msgid ""
"If you already have an account, login with your username and password to "
"connect it to your Facebook."
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:297
msgid "Existing nickname"
msgstr ""

#. TRANS: Field label.
#: actions/facebookfinishlogin.php:301
msgid "Password"
msgstr ""

#. TRANS: Submit button to connect a Facebook account to an existing StatusNet
#. account.
#: actions/facebookfinishlogin.php:305
msgctxt "BUTTON"
msgid "Connect"
msgstr ""

#. TRANS: Client error trying to register with registrations not allowed.
#. TRANS: Client error trying to register with registrations 'invite only'.
#: actions/facebookfinishlogin.php:326 actions/facebookfinishlogin.php:335
msgid "Registration not allowed."
msgstr ""

#. TRANS: Client error trying to register with an invalid invitation code.
#: actions/facebookfinishlogin.php:342
msgid "Not a valid invitation code."
msgstr ""

#. TRANS: Server error displayed when connecting to Facebook fails.
#: actions/facebookfinishlogin.php:378 actions/facebookfinishlogin.php:511
msgid "Error connecting user to Facebook."
msgstr ""

#. TRANS: Form validation error displayed when username/password combination
#. is incorrect.
#: actions/facebookfinishlogin.php:478
msgid "Invalid username or password."
msgstr "使用者名稱或密碼無效"

#. TRANS: Page title for Facebook settings.
#: actions/facebooksettings.php:106
msgctxt "TITLE"
msgid "Facebook settings"
msgstr ""

#. TRANS: Instructions for Facebook settings.
#: actions/facebooksettings.php:116
msgid "Facebook settings"
msgstr ""

#. TRANS: Form note. User is connected to facebook.
#: actions/facebooksettings.php:140
msgid "Connected Facebook user"
msgstr ""

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:168
msgid "Publish my notices to Facebook."
msgstr ""

#. TRANS: Checkbox label in Facebook settings.
#: actions/facebooksettings.php:179
msgid "Send \"@\" replies to Facebook."
msgstr ""

#. TRANS: Fieldset legend for form to disconnect from Facebook.
#: actions/facebooksettings.php:197
msgid "Disconnect my account from Facebook"
msgstr ""

#. TRANS: Notice in disconnect from Facebook form if user has no local
#. StatusNet password.
#: actions/facebooksettings.php:204
#, php-format
msgid ""
"Disconnecting your Faceboook would make it impossible to log in! Please [set"
" a password](%s) first."
msgstr ""

#. TRANS: Message displayed when initiating disconnect of a StatusNet user
#. TRANS: from a Facebook account. %1$s is the StatusNet site name.
#: actions/facebooksettings.php:215
#, php-format
msgid ""
"Keep your %1$s account but disconnect from Facebook. You'll use your %1$s "
"password to log in."
msgstr ""

#. TRANS: Submit button.
#: actions/facebooksettings.php:221
msgctxt "BUTTON"
msgid "Disconnect"
msgstr ""

#. TRANS: Notice in case saving of synchronisation preferences fail.
#: actions/facebooksettings.php:245
msgid "There was a problem saving your sync preferences."
msgstr ""

#. TRANS: Confirmation that synchronisation settings have been saved into the
#. system.
#: actions/facebooksettings.php:248
msgid "Sync preferences saved."
msgstr ""

#. TRANS: Server error displayed when deleting the link to a Facebook account
#. fails.
#: actions/facebooksettings.php:263
msgid "Could not delete link to Facebook."
msgstr ""

#. TRANS: Confirmation message. StatusNet account was unlinked from Facebook.
#: actions/facebooksettings.php:267
msgid "You have disconnected from Facebook."
msgstr ""

#. TRANS: Menu item for "Facebook" in administration panel.
#. TRANS: Menu item for "Facebook" in user settings.
#: FacebookBridgePlugin.php:202 FacebookBridgePlugin.php:241
#: FacebookBridgePlugin.php:281
msgctxt "MENU"
msgid "Facebook"
msgstr ""

#. TRANS: Menu title for "Facebook" login.
#: FacebookBridgePlugin.php:204
msgid "Login or register using Facebook."
msgstr ""

#. TRANS: Menu title for "Facebook" in administration panel.
#: FacebookBridgePlugin.php:243
msgid "Facebook integration configuration."
msgstr ""

#. TRANS: Menu title for "Facebook" in user settings.
#: FacebookBridgePlugin.php:283
msgid "Facebook settings."
msgstr ""

#. TRANS: Plugin description.
#: FacebookBridgePlugin.php:624
msgid "A plugin for integrating StatusNet with Facebook."
msgstr ""

#. TRANS: E-mail subject.
#: lib/facebookclient.php:790
msgid "Your Facebook connection has been removed"
msgstr ""

#. TRANS: E-mail body. %1$s is a username, %2$s is the StatusNet sitename.
#: lib/facebookclient.php:793
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We are sorry to inform you we are unable to publish your notice to\n"
"Facebook, and have removed the connection between your %2$s account and\n"
"Facebook.\n"
"\n"
"This may have happened because you have removed permission for %2$s\n"
"to post on your behalf, or perhaps you have deactivated your Facebook\n"
"account. You can reconnect your %2$s account to Facebook at any time by\n"
"logging in with Facebook again.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""

#. TRANS: E-mail subject. %s is the StatusNet sitename.
#: lib/facebookclient.php:846
#, php-format
msgid "Contact the %s administrator to retrieve your account"
msgstr ""

#. TRANS: E-mail body. %1$s is a username,
#. TRANS: %2$s is the StatusNet sitename, %3$s is the site contact e-mail
#. address.
#: lib/facebookclient.php:850
#, php-format
msgid ""
"Hi %1$s,\n"
"\n"
"We have noticed you have deauthorized the Facebook connection for your\n"
"%2$s account.  You have not set a password for your %2$s account yet, so\n"
"you will not be able to login. If you wish to continue using your %2$s\n"
"account, please contact the site administrator (%3$s) to set a password.\n"
"\n"
"Sincerely,\n"
"\n"
"%2$s\n"
msgstr ""


code:
Events that come with the Favorite plugin
=========================================

EndFavorNotice: After saving a notice as a favorite
- $profile: profile of the person faving (can be remote!)
- $notice: notice being faved

StartDisfavorNotice: Saving a notice as a favorite
- $profile: profile of the person faving (can be remote!)
- $notice: notice being faved
- &$result: result of the disfavoring (if you override)

EndDisfavorNotice: After saving a notice as a favorite
- $profile: profile of the person faving (can be remote!)
- $notice: notice being faved

StartFavorNoticeForm: starting the data in the form for favoring a notice
- $FavorForm: the favor form being shown
- $notice: notice being favored

EndFavorNoticeForm: Ending the data in the form for favoring a notice
- $FavorForm: the favor form being shown
- $notice: notice being favored

StartDisFavorNoticeForm: starting the data in the form for disfavoring a notice
- $DisfavorForm: the disfavor form being shown
- $notice: notice being difavored

EndDisFavorNoticeForm: Ending the data in the form for disfavoring a notice
- $DisfavorForm: the disfavor form being shown
- $notice: notice being disfavored

StartShowFaveForm: just before showing the fave form
- $item: the NoticeListItem object being shown

EndShowFaveForm: just after showing the fave form
- $item: the NoticeListItem object being shown


code:
<?php
/*
 * GNU Social - a federating social network
 * Copyright (C) 2014, Free Software Foundation, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

if (!defined('GNUSOCIAL')) { exit(1); }

/**
 * @package     Activity
 * @maintainer  Mikael Nordfeldth <mmn@hethane.se>
 */
class FavoritePlugin extends ActivityVerbHandlerPlugin
{
    protected $email_notify_fave = 1;

    public function tag()
    {
        return 'favorite';
    }

    public function types()
    {
        return array();
    }

    public function verbs()
    {
        return array(ActivityVerb::FAVORITE, ActivityVerb::LIKE,
                    ActivityVerb::UNFAVORITE, ActivityVerb::UNLIKE);
    }

    public function onCheckSchema()
    {
        $schema = Schema::get();
        $schema->ensureTable('fave', Fave::schemaDef());
        return true;
    }

    public function initialize()
    {
        common_config_set('email', 'notify_fave', $this->email_notify_fave);
    }

    public function onStartUpgrade()
    {
        // This is a migration feature that will make sure we move
        // certain User preferences to the Profile_prefs table.
        // Introduced after commit b5fd2a048fc621ea05d756caba17275ab3dd0af4
        // on Sun Jul 13 16:30:37 2014 +0200
        $user = new User();
        $user->whereAdd('emailnotifyfav IS NOT NULL');
        if ($user->find()) {
            printfnq("Detected old User table (emailnotifyfav IS NOT NULL). Moving 'emailnotifyfav' property to Profile_prefs...");
            // First we'll make sure Profile_prefs exists
            $schema = Schema::get();
            $schema->ensureTable('profile_prefs', Profile_prefs::schemaDef());

            // Make sure we have our own tables setup properly
            while ($user->fetch()) {
                $user->setPref('email', 'notify_fave', $user->emailnotifyfav);
                $orig = clone($user);
                $user->emailnotifyfav = 'null';   // flag this preference as migrated
                $user->update($orig);
            }
            printfnq("DONE.\n");
        }
    }

    public function onEndUpgrade()
    {
        printfnq("Ensuring all faves have a URI...");

        $fave = new Fave();
        $fave->whereAdd('uri IS NULL');

        if ($fave->find()) {
            while ($fave->fetch()) {
                try {
                    $fave->decache();
                    $fave->query(sprintf('UPDATE fave '.
                                         'SET uri = "%s", '.
                                         '    modified = "%s" '.
                                         'WHERE user_id = %d '.
                                         'AND notice_id = %d',
                                         Fave::newUri($fave->user_id, $fave->notice_id, $fave->modified),
                                         common_sql_date(strtotime($fave->modified)),
                                         $fave->user_id,
                                         $fave->notice_id));
                } catch (Exception $e) {
                    common_log(LOG_ERR, "Error updating fave URI: " . $e->getMessage());
                }
            }
        }

        printfnq("DONE.\n");
    }

    public function onRouterInitialized(URLMapper $m)
    {
        // Web UI actions
        $m->connect('main/favor', array('action' => 'favor'));
        $m->connect('main/disfavor', array('action' => 'disfavor'));

        if (common_config('singleuser', 'enabled')) {
            $nickname = User::singleUserNickname();

            $m->connect('favorites',
                        array('action' => 'showfavorites',
                              'nickname' => $nickname));
            $m->connect('favoritesrss',
                        array('action' => 'favoritesrss',
                              'nickname' => $nickname));
        } else {
            $m->connect('favoritedrss', array('action' => 'favoritedrss'));
            $m->connect('favorited/', array('action' => 'favorited'));
            $m->connect('favorited', array('action' => 'favorited'));

            $m->connect(':nickname/favorites',
                        array('action' => 'showfavorites'),
                        array('nickname' => Nickname::DISPLAY_FMT));
            $m->connect(':nickname/favorites/rss',
                        array('action' => 'favoritesrss'),
                        array('nickname' => Nickname::DISPLAY_FMT));
        }

        // Favorites for API
        $m->connect('api/favorites/create.:format',
                    array('action' => 'ApiFavoriteCreate'),
                    array('format' => '(xml|json)'));
        $m->connect('api/favorites/destroy.:format',
                    array('action' => 'ApiFavoriteDestroy'),
                    array('format' => '(xml|json)'));
        $m->connect('api/favorites/list.:format',
                    array('action' => 'ApiTimelineFavorites'),
                    array('format' => '(xml|json|rss|atom|as)'));
        $m->connect('api/favorites/:id.:format',
                    array('action' => 'ApiTimelineFavorites'),
                    array('id' => Nickname::INPUT_FMT,
                          'format' => '(xml|json|rss|atom|as)'));
        $m->connect('api/favorites.:format',
                    array('action' => 'ApiTimelineFavorites'),
                    array('format' => '(xml|json|rss|atom|as)'));
        $m->connect('api/favorites/create/:id.:format',
                    array('action' => 'ApiFavoriteCreate'),
                    array('id' => '[0-9]+',
                          'format' => '(xml|json)'));
        $m->connect('api/favorites/destroy/:id.:format',
                    array('action' => 'ApiFavoriteDestroy'),
                    array('id' => '[0-9]+',
                          'format' => '(xml|json)'));

        // AtomPub API
        $m->connect('api/statusnet/app/favorites/:profile/:notice.atom',
                    array('action' => 'AtomPubShowFavorite'),
                    array('profile' => '[0-9]+',
                          'notice' => '[0-9]+'));

        $m->connect('api/statusnet/app/favorites/:profile.atom',
                    array('action' => 'AtomPubFavoriteFeed'),
                    array('profile' => '[0-9]+'));

        // Required for qvitter API
        $m->connect('api/statuses/favs/:id.:format',
                    array('action' => 'ApiStatusesFavs'),
                    array('id' => '[0-9]+',
                          'format' => '(xml|json)'));
    }

    // FIXME: Set this to abstract public in lib/activityhandlerplugin.php ddwhen all plugins have migrated!
    protected function saveObjectFromActivity(Activity $act, Notice $stored, array $options=array())
    {
        assert($this->isMyActivity($act));

        // If empty, we should've created it ourselves on our node.
        if (!isset($options['created'])) {
            $options['created'] = !empty($act->time) ? common_sql_date($act->time) : common_sql_now();
        }

        // We must have an objects[0] here because in isMyActivity we require the count to be == 1
        $actobj = $act->objects[0];

        $object = Fave::saveActivityObject($actobj, $stored);
        $stored->object_type = ActivityUtils::resolveUri($object->getObjectType(), true);

        return $object;
    }

    // FIXME: Put this in lib/activityhandlerplugin.php when we're ready
    //          with the other microapps/activityhandlers as well.
    //          Also it should be StartNoticeAsActivity (with a prepped Activity, including ->context etc.)
    public function onEndNoticeAsActivity(Notice $stored, Activity $act, Profile $scoped=null)
    {
        if (!$this->isMyNotice($stored)) {
            return true;
        }

        common_debug('Extending activity '.$stored->id.' with '.get_called_class());
        $this->extendActivity($stored, $act, $scoped);
        return false;
    }

    public function extendActivity(Notice $stored, Activity $act, Profile $scoped=null)
    {
        Fave::extendActivity($stored, $act, $scoped);
    }

    public function activityObjectFromNotice(Notice $notice)
    {
        $fave = Fave::fromStored($notice);
        return $fave->asActivityObject();
    }

    public function deleteRelated(Notice $notice)
    {
        try {
            $fave = Fave::fromStored($notice);
            $fave->delete();
        } catch (NoResultException $e) {
            // Cool, no problem. We wanted to get rid of it anyway.
        }
    }

    // API stuff

    /**
     * Typically just used to fill out Twitter-compatible API status data.
     *
     * FIXME: Make all the calls before this end up with a Notice instead of ArrayWrapper please...
     */
    public function onNoticeSimpleStatusArray($notice, array &$status, Profile $scoped=null, array $args=array())
    {
        if ($scoped instanceof Profile) {
            $status['favorited'] = Fave::existsForProfile($notice, $scoped);
        } else {
            $status['favorited'] = false;
        }
        return true;
    }

    public function onTwitterUserArray(Profile $profile, array &$userdata, Profile $scoped=null, array $args=array())
    {
        $userdata['favourites_count'] = Fave::countByProfile($profile);
    }

    /**
     * Typically just used to fill out StatusNet specific data in API calls in the referenced $info array.
     */
    public function onStatusNetApiNoticeInfo(Notice $notice, array &$info, Profile $scoped=null, array $args=array())
    {
        if ($scoped instanceof Profile) {
            $info['favorite'] = Fave::existsForProfile($notice, $scoped) ? 'true' : 'false';
        }
        return true;
    }

    public function onNoticeDeleteRelated(Notice $notice)
    {
        parent::onNoticeDeleteRelated($notice);

        // The below algorithm is because we want to delete fave
        // activities on any notice which _has_ faves, and not as
        // in the parent function only ones that _are_ faves.

        $fave = new Fave();
        $fave->notice_id = $notice->id;

        if ($fave->find()) {
            while ($fave->fetch()) {
                $fave->delete();
            }
        }

        $fave->free();
    }

    public function onProfileDeleteRelated(Profile $profile, array &$related)
    {
        $fave = new Fave();
        $fave->user_id = $profile->id;
        $fave->delete();    // Will perform a DELETE matching "user_id = {$user->id}"
        $fave->free();

        Fave::blowCacheForProfileId($profile->id);
        return true;
    }

    public function onStartNoticeListPrefill(array &$notices, array $notice_ids, Profile $scoped=null)
    {
        // prefill array of objects, before pluginfication it was Notice::fillFaves($notices)
        Fave::fillFaves($notice_ids);

        // DB caching
        if ($scoped instanceof Profile) {
            Fave::pivotGet('notice_id', $notice_ids, array('user_id' => $scoped->id));
        }
    }

    /**
     * show the "favorite" form in the notice options element
     * FIXME: Don't let a NoticeListItemAdapter slip in here (or extend that from NoticeListItem)
     *
     * @return void
     */
    public function onStartShowNoticeOptionItems($nli)
    {
        if (Event::handle('StartShowFaveForm', array($nli))) {
            $scoped = Profile::current();
            if ($scoped instanceof Profile) {
                if (Fave::existsForProfile($nli->notice, $scoped)) {
                    $disfavor = new DisfavorForm($nli->out, $nli->notice);
                    $disfavor->show();
                } else {
                    $favor = new FavorForm($nli->out, $nli->notice);
                    $favor->show();
                }
            }
            Event::handle('EndShowFaveForm', array($nli));
        }
    }

    public function showNoticeListItem(NoticeListItem $nli)
    {
        // pass
    }
    public function openNoticeListItemElement(NoticeListItem $nli)
    {
        // pass
    }
    public function closeNoticeListItemElement(NoticeListItem $nli)
    {
        // pass
    }

    public function onAppendUserActivityStreamObjects(UserActivityStream $uas, array &$objs)
    {
        $fave = new Fave();
        $fave->user_id = $uas->getUser()->id;

        if (!empty($uas->after)) {
            $fave->whereAdd("modified > '" . common_sql_date($uas->after) . "'");
        }

        if ($fave->find()) {
            while ($fave->fetch()) {
                $objs[] = clone($fave);
            }
        }

        return true;
    }

    public function onEndShowThreadedNoticeTailItems(NoticeListItem $nli, Notice $notice, &$threadActive)
    {
        if ($nli instanceof ThreadedNoticeListSubItem) {
            // The sub-items are replies to a conversation, thus we use different HTML elements etc.
            $item = new ThreadedNoticeListInlineFavesItem($notice, $nli->out);
        } else {
            $item = new ThreadedNoticeListFavesItem($notice, $nli->out);
        }
        $threadActive = $item->show() || $threadActive;
        return true;
    }

    public function onEndFavorNotice(Profile $actor, Notice $target)
    {
        try {
            $notice_author = $target->getProfile();
            // Don't notify ourselves of our own favorite on our own notice,
            // or if it's a remote user (since we don't know their email addresses etc.)
            if ($notice_author->id == $actor->id || !$notice_author->isLocal()) {
                return true;
            }
            $local_user = $notice_author->getUser();
            mail_notify_fave($local_user, $actor, $target);
        } catch (Exception $e) {
            // Mm'kay, probably not a local user. Let's skip this favor notification.
        }
    }

    /**
     * EndInterpretCommand for FavoritePlugin will handle the 'fav' command
     * using the class FavCommand.
     *
     * @param string  $cmd     Command being run
     * @param string  $arg     Rest of the message (including address)
     * @param User    $user    User sending the message
     * @param Command &$result The resulting command object to be run.
     *
     * @return boolean hook value
     */
    public function onStartInterpretCommand($cmd, $arg, $user, &$result)
    {
        if ($result === false && $cmd == 'fav') {
            if (empty($arg)) {
                $result = null;
            } else {
                list($other, $extra) = CommandInterpreter::split_arg($arg);
                if (!empty($extra)) {
                    $result = null;
                } else {
                    $result = new FavCommand($user, $other);
                }
            }
            return false;
        }
        return true;
    }

    public function onHelpCommandMessages(HelpCommand $help, array &$commands)
    {
        // TRANS: Help message for IM/SMS command "fav <nickname>".
        $commands['fav <nickname>'] = _m('COMMANDHELP', "add user's last notice as a 'fave'");
        // TRANS: Help message for IM/SMS command "fav #<notice_id>".
        $commands['fav #<notice_id>'] = _m('COMMANDHELP', "add notice with the given id as a 'fave'");
    }

    /**
     * Are we allowed to perform a certain command over the API?
     */
    public function onCommandSupportedAPI(Command $cmd, &$supported)
    {
        $supported = $supported || $cmd instanceof FavCommand;
    }

    // Form stuff (settings etc.)

    public function onEndEmailFormData(Action $action, Profile $scoped)
    {
        $emailfave = $scoped->getConfigPref('email', 'notify_fave') ? 1 : 0;

        $action->elementStart('li');
        $action->checkbox('email-notify_fave',
                        // TRANS: Checkbox label in e-mail preferences form.
                        _('Send me email when someone adds my notice as a favorite.'),
                        $emailfave);
        $action->elementEnd('li');

        return true;
    }

    public function onStartEmailSaveForm(Action $action, Profile $scoped)
    {
        $emailfave = $action->booleanintstring('email-notify_fave');
        try {
            if ($emailfave == $scoped->getPref('email', 'notify_fave')) {
                // No need to update setting
                return true;
            }
        } catch (NoResultException $e) {
            // Apparently there's no previously stored setting, then continue to save it as it is now.
        }

        $scoped->setPref('email', 'notify_fave', $emailfave);

        return true;
    }

    // Layout stuff

    public function onEndPersonalGroupNav(Menu $menu, Profile $target, Profile $scoped=null)
    {
        $menu->out->menuItem(common_local_url('showfavorites', array('nickname' => $target->getNickname())),
                             // TRANS: Menu item in personal group navigation menu.
                             _m('MENU','Favorites'),
                             // @todo i18n FIXME: Need to make this two messages.
                             // TRANS: Menu item title in personal group navigation menu.
                             // TRANS: %s is a username.
                             sprintf(_('%s\'s favorite notices'), $target->getBestName()),
                             $scoped instanceof Profile && $target->id === $scoped->id && $menu->actionName =='showfavorites',
                            'nav_timeline_favorites');
    }

    public function onEndPublicGroupNav(Menu $menu)
    {
        if (!common_config('singleuser', 'enabled')) {
            // TRANS: Menu item in search group navigation panel.
            $menu->out->menuItem(common_local_url('favorited'), _m('MENU','Popular'),
                                 // TRANS: Menu item title in search group navigation panel.
                                 _('Popular notices'), $menu->actionName == 'favorited', 'nav_timeline_favorited');
        }
    }

    public function onEndShowSections(Action $action)
    {
        if (!$action->isAction(array('all', 'public'))) {
            return true;
        }

        if (!common_config('performance', 'high')) {
            $section = new PopularNoticeSection($action, $action->getScoped());
            $section->show();
        }
    }

    protected function getActionTitle(ManagedAction $action, $verb, Notice $target, Profile $scoped)
    {
        return Fave::existsForProfile($target, $scoped)
                // TRANS: Page/dialog box title when a notice is marked as favorite already
                ? _m('TITLE', 'Unmark notice as favorite')
                // TRANS: Page/dialog box title when a notice is not marked as favorite
                : _m('TITLE', 'Mark notice as favorite');
    }

    protected function doActionPreparation(ManagedAction $action, $verb, Notice $target, Profile $scoped)
    {
        if ($action->isPost()) {
            // The below tests are only for presenting to the user. POSTs which inflict
            // duplicate favorite entries are handled with AlreadyFulfilledException.
            return false;
        }

        $exists = Fave::existsForProfile($target, $scoped);
        $expected_verb = $exists ? ActivityVerb::UNFAVORITE : ActivityVerb::FAVORITE;

        switch (true) {
        case $exists && ActivityUtils::compareTypes($verb, array(ActivityVerb::FAVORITE, ActivityVerb::LIKE)):
        case !$exists && ActivityUtils::compareTypes($verb, array(ActivityVerb::UNFAVORITE, ActivityVerb::UNLIKE)):
            common_redirect(common_local_url('activityverb',
                                array('id'   => $target->getID(),
                                      'verb' => ActivityUtils::resolveUri($expected_verb, true))));
            break;
        default:
            // No need to redirect as we are on the correct action already.
        }

        return false;
    }

    protected function doActionPost(ManagedAction $action, $verb, Notice $target, Profile $scoped)
    {
        switch (true) {
        case ActivityUtils::compareTypes($verb, array(ActivityVerb::FAVORITE, ActivityVerb::LIKE)):
            Fave::addNew($scoped, $target);
            break;
        case ActivityUtils::compareTypes($verb, array(ActivityVerb::UNFAVORITE, ActivityVerb::UNLIKE)):
            Fave::removeEntry($scoped, $target);
            break;
        default:
            throw new ServerException('ActivityVerb POST not handled by plugin that was supposed to do it.');
        }
        return false;
    }

    protected function getActivityForm(ManagedAction $action, $verb, Notice $target, Profile $scoped)
    {
        return Fave::existsForProfile($target, $scoped)
                ? new DisfavorForm($action, $target)
                : new FavorForm($action, $target);
    }

    public function onPluginVersion(array &$versions)
    {
        $versions[] = array('name' => 'Favorite',
                            'version' => GNUSOCIAL_VERSION,
                            'author' => 'Mikael Nordfeldth',
                            'homepage' => 'http://gnu.io/',
                            'rawdescription' =>
                            // TRANS: Plugin description.
                            _m('Favorites (likes) using ActivityStreams.'));

        return true;
    }
}

/**
 * Notify a user that one of their notices has been chosen as a 'fave'
 *
 * @param User    $rcpt   The user whose notice was faved
 * @param Profile $sender The user who faved the notice
 * @param Notice  $notice The notice that was faved
 *
 * @return void
 */
function mail_notify_fave(User $rcpt, Profile $sender, Notice $notice)
{
    if (!$rcpt->receivesEmailNotifications() || !$rcpt->getConfigPref('email', 'notify_fave')) {
        return;
    }

    // This test is actually "if the sender is sandboxed"
    if (!$sender->hasRight(Right::EMAILONFAVE)) {
        return;
    }

    if ($rcpt->hasBlocked($sender)) {
        // If the author has blocked us, don't spam them with a notification.
        return;
    }

    // We need the global mail.php for various mail related functions below.
    require_once INSTALLDIR.'/lib/mail.php';

    $bestname = $sender->getBestName();

    common_switch_locale($rcpt->language);

    // TRANS: Subject for favorite notification e-mail.
    // TRANS: %1$s is the adding user's long name, %2$s is the adding user's nickname.
    $subject = sprintf(_('%1$s (@%2$s) added your notice as a favorite'), $bestname, $sender->getNickname());

    // TRANS: Body for favorite notification e-mail.
    // TRANS: %1$s is the adding user's long name, $2$s is the date the notice was created,
    // TRANS: %3$s is a URL to the faved notice, %4$s is the faved notice text,
    // TRANS: %5$s is a URL to all faves of the adding user, %6$s is the StatusNet sitename,
    // TRANS: %7$s is the adding user's nickname.
    $body = sprintf(_("%1\$s (@%7\$s) just added your notice from %2\$s".
                      " as one of their favorites.\n\n" .
                      "The URL of your notice is:\n\n" .
                      "%3\$s\n\n" .
                      "The text of your notice is:\n\n" .
                      "%4\$s\n\n" .
                      "You can see the list of %1\$s's favorites here:\n\n" .
                      "%5\$s"),
                    $bestname,
                    common_exact_date($notice->created),
                    common_local_url('shownotice',
                                     array('notice' => $notice->id)),
                    $notice->content,
                    common_local_url('showfavorites',
                                     array('nickname' => $sender->getNickname())),
                    common_config('site', 'name'),
                    $sender->getNickname()) .
            mail_footer_block();

    $headers = _mail_prepare_headers('fave', $rcpt->getNickname(), $sender->getNickname());

    common_switch_locale();
    mail_to_user($rcpt, $subject, $body, $headers);
}


code:
<?php
/**
 * StatusNet, the distributed open-source microblogging tool
 *
 * Add a notice to a user's list of favorite notices via the API
 *
 * PHP version 5
 *
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  API
 * @package   StatusNet
 * @author    Craig Andrews <candrews@integralblue.com>
 * @author    Evan Prodromou <evan@status.net>
 * @author    Zach Copley <zach@status.net>
 * @author   Mikael Nordfeldth <mmn@hethane.se>
 * @copyright 2009 StatusNet, Inc.
 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link      http://gnu.io/
 */

if (!defined('GNUSOCIAL')) { exit(1); }

/**
 * Favorites the status specified in the ID parameter as the authenticating user.
 * Returns the favorite status when successful.
 *
 * @category API
 * @package  StatusNet
 * @author   Craig Andrews <candrews@integralblue.com>
 * @author   Evan Prodromou <evan@status.net>
 * @author   Zach Copley <zach@status.net>
 * @author   Mikael Nordfeldth <mmn@hethane.se>
 * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link     http://gnu.io/
 */
class ApiFavoriteCreateAction extends ApiAuthAction
{
    var $notice = null;

    protected $needPost = true;

    protected function prepare(array $args=array())
    {
        parent::prepare($args);

        $this->notice = Notice::getKV($this->arg('id'));
        if (!empty($this->notice->repeat_of)) {
                common_log(LOG_DEBUG, 'Trying to Fave '.$this->notice->id.', repeat of '.$this->notice->repeat_of);
                common_log(LOG_DEBUG, 'Will Fave '.$this->notice->repeat_of.' instead');
                $real_notice_id = $this->notice->repeat_of;
                $this->notice = Notice::getKV($real_notice_id);
        }

        return true;
    }

    protected function handle()
    {
        parent::handle();

        if (!in_array($this->format, array('xml', 'json'))) {
            $this->clientError(
                // TRANS: Client error displayed when coming across a non-supported API method.
                _('API method not found.'),
                404,
                $this->format
            );
        }

        if (empty($this->notice)) {
            $this->clientError(
                // TRANS: Client error displayed when requesting a status with a non-existing ID.
                _('No status found with that ID.'),
                404,
                $this->format
            );
        }

        try {
            $stored = Fave::addNew($this->scoped, $this->notice);
        } catch (AlreadyFulfilledException $e) {
            // Note: Twitter lets you fave things repeatedly via API.
            $this->clientError($e->getMessage(), 403);
        }

        if ($this->format == 'xml') {
            $this->showSingleXmlStatus($this->notice);
        } elseif ($this->format == 'json') {
            $this->show_single_json_status($this->notice);
        }
    }
}


code:
<?php
/**
 * StatusNet, the distributed open-source microblogging tool
 *
 * Remote a notice from a user's list of favorite notices via the API
 *
 * PHP version 5
 *
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  API
 * @package   StatusNet
 * @author    Craig Andrews <candrews@integralblue.com>
 * @author    Evan Prodromou <evan@status.net>
 * @author    Zach Copley <zach@status.net>
 * @copyright 2009 StatusNet, Inc.
 * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link      http://status.net/
 */

if (!defined('STATUSNET')) {
    exit(1);
}

/**
 * Un-favorites the status specified in the ID parameter as the authenticating user.
 * Returns the un-favorited status in the requested format when successful.
 *
 * @category API
 * @package  StatusNet
 * @author   Craig Andrews <candrews@integralblue.com>
 * @author   Evan Prodromou <evan@status.net>
 * @author   Zach Copley <zach@status.net>
 * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link     http://status.net/
 */
class ApiFavoriteDestroyAction extends ApiAuthAction
{
    var $notice = null;

    /**
     * Take arguments for running
     *
     * @param array $args $_REQUEST args
     *
     * @return boolean success flag
     */
    function prepare($args)
    {
        parent::prepare($args);

        $this->user   = $this->auth_user;
        $this->notice = Notice::getKV($this->arg('id'));
        if ($this->notice->repeat_of != '' ) {
                common_log(LOG_DEBUG, 'Trying to unFave '.$this->notice->id);
                common_log(LOG_DEBUG, 'Will unFave '.$this->notice->repeat_of.' instead');
                $real_notice_id = $this->notice->repeat_of;
                $this->notice = Notice::getKV($real_notice_id);
        }

        return true;
    }

    /**
     * Handle the request
     *
     * Check the format and show the user info
     *
     * @param array $args $_REQUEST data (unused)
     *
     * @return void
     */
    function handle($args)
    {
        parent::handle($args);

        if ($_SERVER['REQUEST_METHOD'] != 'POST') {
            $this->clientError(
                // TRANS: Client error. POST is a HTTP command. It should not be translated.
                _('This method requires a POST.'),
                400,
                $this->format
            );
            return;
        }

        if (!in_array($this->format, array('xml', 'json'))) {
            $this->clientError(
                // TRANS: Client error displayed when coming across a non-supported API method.
                _('API method not found.'),
                404,
                $this->format
            );
            return;
        }

        if (empty($this->notice)) {
            $this->clientError(
                // TRANS: Client error displayed when trying to remove a favourite with an invalid ID.
                _('No status found with that ID.'),
                404,
                $this->format
            );
            return;
        }

        $fave            = new Fave();
        $fave->user_id   = $this->user->id;
        $fave->notice_id = $this->notice->id;

        if (!$fave->find(true)) {
            $this->clientError(
                // TRANS: Client error displayed when trying to remove a favourite that was not a favourite.
                _('That status is not a favorite.'),
                403,
                $this->favorite
            );
            return;
        }

        $result = $fave->delete();

        if (!$result) {
            common_log_db_error($fave, 'DELETE', __FILE__);
            $this->clientError(
                // TRANS: Client error displayed when removing a favourite has failed.
                _('Could not delete favorite.'),
                404,
                $this->format
            );
            return;
        }

        Fave::blowCacheForProfileId($this->user->id);

        if ($this->format == 'xml') {
            $this->showSingleXmlStatus($this->notice);
        } elseif ($this->format == 'json') {
            $this->show_single_json_status($this->notice);
        }
    }
}


code:
<?php
/**
 * StatusNet, the distributed open-source microblogging tool
 *
 * Show up to 100 favs of a notice
 *
 * PHP version 5
 *
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category  API
 * @package   GNUsocial
 * @author    Hannes Mannerheim <h@nnesmannerhe.im>
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
 * @link      http://www.gnu.org/software/social/
 */

if (!defined('GNUSOCIAL')) { exit(1); }

/**
 * Show up to 100 favs of a notice
 *
 */
class ApiStatusesFavsAction extends ApiAuthAction
{
    const MAXCOUNT = 100;

    var $original = null;   // Notice object for which to retrieve favs
    var $cnt      = self::MAXCOUNT;

    /**
     * Take arguments for running
     *
     * @param array $args $_REQUEST args
     *
     * @return boolean success flag
     */
    protected function prepare(array $args=array())
    {
        parent::prepare($args);

        if ($this->format !== 'json') {
            $this->clientError('This method currently only serves JSON.', 415);
        }

        $id = $this->trimmed('id');

        $this->original = Notice::getKV('id', $id);

        if (!($this->original instanceof Notice)) {
            // TRANS: Client error displayed trying to display redents of a non-exiting notice.
            $this->clientError(_('No such notice.'), 400);
        }

        $cnt = $this->trimmed('count');

        if (empty($cnt) || !is_integer($cnt)) {
            $cnt = 100;
        } else {
            $this->cnt = min((int)$cnt, self::MAXCOUNT);
        }

        return true;
    }

    /**
     * Handle the request
     *
     * Get favs and return them as json object
     *
     * @param array $args $_REQUEST data (unused)
     *
     * @return void
     */
    protected function handle()
    {
        parent::handle();

        $fave = new Fave();
        $fave->selectAdd();
        $fave->selectAdd('user_id');
        $fave->notice_id = $this->original->id;
        $fave->orderBy('modified');
        if (!is_null($this->cnt)) {
            $fave->limit(0, $this->cnt);
        }

		$ids = $fave->fetchAll('user_id');

		// get nickname and profile image
		$ids_with_profile_data = array();
		$i=0;
		foreach($ids as $id) {
			$profile = Profile::getKV('id', $id);
			$ids_with_profile_data[$i]['user_id'] = $id;
			$ids_with_profile_data[$i]['nickname'] = $profile->nickname;
			$ids_with_profile_data[$i]['fullname'] = $profile->fullname;
			$ids_with_profile_data[$i]['profileurl'] = $profile->profileurl;
			$profile = new Profile();
			$profile->id = $id;
			$avatarurl = $profile->avatarUrl(24);
			$ids_with_profile_data[$i]['avatarurl'] = $avatarurl;
			$i++;
		}

		$this->initDocument('json');
		$this->showJsonObjects($ids_with_profile_data);
		$this->endDocument('json');
    }

    /**
     * Return true if read only.
     *
     * MAY override
     *
     * @param array $args other arguments
     *
     * @return boolean is read only action?
     */

    function isReadOnly($args)
    {
        return true;
    }
}