code:
# Translation of StatusNet - RequireValidatedEmail to Dutch (Nederlands)
# Exported from translatewiki.net
#
# Author: Siebrand
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - RequireValidatedEmail\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Language-Team: Dutch <https://translatewiki.net/wiki/Portal:nl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-18 16:19:28+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: nl\n"
"X-Message-Group: #out-statusnet-plugin-requirevalidatedemail\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
msgid "You must validate your email address before posting."
msgstr "U moet uw e-mailadres bevestigen voordat u berichten kunt plaatsen."

#. TRANS: Client exception thrown when trying to register without providing an e-mail address.
msgid "You must provide an email address to register."
msgstr "U moet een e-mailadres opgeven om te kunnen registreren."

#. TRANS: Plugin description.
msgid "Disables posting without a validated email address."
msgstr "Schakelt berichten plaatsen zonder gevalideerd e-mailadres uit."

#. TRANS: Client exception thrown when trying to register while already logged in.
msgid "You are already logged in."
msgstr "U bent al aangemeld."

#. TRANS: Client exception thrown when trying to register with a non-existing confirmation code.
msgid "Confirmation code not found."
msgstr "De bevestigingscode is niet gevonden."

#. TRANS: Client exception thrown when trying to register with a confirmation code that is not connected with a user.
msgid "No user for that confirmation code."
msgstr "Er is geen gebruiker voor die bevestigingscode."

#. TRANS: Client exception thrown when trying to register with a invalid e-mail address.
#. TRANS: %s is the invalid e-mail address.
#, php-format
msgid "Unrecognized address type %s."
msgstr "Onbekend adrestype %s."

#. TRANS: Client error for an already confirmed email/jabber/sms address.
msgid "That address has already been confirmed."
msgstr "Dit adres is al bevestigd."

#. TRANS: Client exception thrown when trying to register with too short a password.
msgid "Password too short."
msgstr "Het wachtwoord is te kort."

#. TRANS: Client exception thrown when trying to register without providing the same password twice.
msgid "Passwords do not match."
msgstr "De wachtwoorden komen niet overeen."

#. TRANS: Form instructions. %s is the nickname of the to be registered user.
#, php-format
msgid ""
"You have confirmed the email address for your new user account %s. Use the "
"form below to set your new password."
msgstr ""
"U hebt het e-mailadres bevestigd voor uw nieuwe gebruiker %s. Gebruik het "
"formulier hieronder om uw nieuwe wachtwoord in te stellen."

#. TRANS: Page title.
msgid "Set a password"
msgstr "Stel een wachtwoord in"

#. TRANS: Form legend.
msgid "Confirm email address"
msgstr "E-mailadres bevestigen"

#. TRANS: Field label.
msgid "New password"
msgstr "Nieuw wachtwoord"

#. TRANS: Field title for password field.
msgid "6 or more characters."
msgstr "Zes of meer tekens."

#. TRANS: Field label for repeat password field.
msgctxt "LABEL"
msgid "Confirm"
msgstr "Bevestigen"

#. TRANS: Field title for repeat password field.
msgid "Same as password above."
msgstr "Gelijk aan het wachtwoord hierboven."

#. TRANS: Button text for completing registration by e-mail.
msgctxt "BUTTON"
msgid "Save"
msgstr "Opslaan"


code:
# Translation of StatusNet - RequireValidatedEmail to Polish (polski)
# Exported from translatewiki.net
#
# Author: Woytecr
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - RequireValidatedEmail\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Language-Team: Polish <https://translatewiki.net/wiki/Portal:pl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-18 16:19:28+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: pl\n"
"X-Message-Group: #out-statusnet-plugin-requirevalidatedemail\n"
"Plural-Forms: nplurals=3; plural=(n == 1) ? 0 : ( (n%10 >= 2 && n%10 <= 4 && "
"(n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n"

#. TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
msgid "You must validate your email address before posting."
msgstr ""

#. TRANS: Client exception thrown when trying to register without providing an e-mail address.
msgid "You must provide an email address to register."
msgstr ""

#. TRANS: Plugin description.
msgid "Disables posting without a validated email address."
msgstr ""

#. TRANS: Client exception thrown when trying to register while already logged in.
msgid "You are already logged in."
msgstr "Jesteś już zalogowany"

#. TRANS: Client exception thrown when trying to register with a non-existing confirmation code.
msgid "Confirmation code not found."
msgstr "Nie odnaleziono kodu potwierdzającego."

#. TRANS: Client exception thrown when trying to register with a confirmation code that is not connected with a user.
msgid "No user for that confirmation code."
msgstr ""

#. TRANS: Client exception thrown when trying to register with a invalid e-mail address.
#. TRANS: %s is the invalid e-mail address.
#, php-format
msgid "Unrecognized address type %s."
msgstr ""

#. TRANS: Client error for an already confirmed email/jabber/sms address.
msgid "That address has already been confirmed."
msgstr "Adres został już potwierdzony."

#. TRANS: Client exception thrown when trying to register with too short a password.
msgid "Password too short."
msgstr "Hasło jest za krótkie."

#. TRANS: Client exception thrown when trying to register without providing the same password twice.
msgid "Passwords do not match."
msgstr "Hasła nie pasują do siebie."

#. TRANS: Form instructions. %s is the nickname of the to be registered user.
#, php-format
msgid ""
"You have confirmed the email address for your new user account %s. Use the "
"form below to set your new password."
msgstr ""

#. TRANS: Page title.
msgid "Set a password"
msgstr "Ustaw hasło"

#. TRANS: Form legend.
msgid "Confirm email address"
msgstr "Potwierdź adres e-mail"

#. TRANS: Field label.
msgid "New password"
msgstr "Nowe hasło"

#. TRANS: Field title for password field.
msgid "6 or more characters."
msgstr "6 lub więcej znaków."

#. TRANS: Field label for repeat password field.
msgctxt "LABEL"
msgid "Confirm"
msgstr "Potwierdź"

#. TRANS: Field title for repeat password field.
msgid "Same as password above."
msgstr ""

#. TRANS: Button text for completing registration by e-mail.
msgctxt "BUTTON"
msgid "Save"
msgstr "Zapisz"

license: mit


code:
# Translation of StatusNet - RequireValidatedEmail to Tagalog (Tagalog)
# Exported from translatewiki.net
#
# Author: AnakngAraw
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - RequireValidatedEmail\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Language-Team: Tagalog <https://translatewiki.net/wiki/Portal:tl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-18 16:19:28+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: tl\n"
"X-Message-Group: #out-statusnet-plugin-requirevalidatedemail\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
msgid "You must validate your email address before posting."
msgstr "Kailangan patunayan mo ang iyong tirahan ng e-liham bago magpaskil."

#. TRANS: Client exception thrown when trying to register without providing an e-mail address.
msgid "You must provide an email address to register."
msgstr "Dapat kang magbigay ng isang tirahan ng e-liham upang makapagpatala."

#. TRANS: Plugin description.
msgid "Disables posting without a validated email address."
msgstr ""
"Hindi nagpapagana ng pagpapaskil na walang isang napatunayang tirahan ng e-"
"liham."

#. TRANS: Client exception thrown when trying to register while already logged in.
msgid "You are already logged in."
msgstr "Nakalagda ka na."

#. TRANS: Client exception thrown when trying to register with a non-existing confirmation code.
msgid "Confirmation code not found."
msgstr "Hindi natagpuan ang kodigo ng pagtitiyak."

#. TRANS: Client exception thrown when trying to register with a confirmation code that is not connected with a user.
msgid "No user for that confirmation code."
msgstr "Walang tagagamit para sa ganyang kodigo ng paniniyak."

#. TRANS: Client exception thrown when trying to register with a invalid e-mail address.
#. TRANS: %s is the invalid e-mail address.
#, php-format
msgid "Unrecognized address type %s."
msgstr "Hindi nakikilalang uri ng tirahan na %s."

#. TRANS: Client error for an already confirmed email/jabber/sms address.
msgid "That address has already been confirmed."
msgstr "Natiyak na ang ganyang tirahan."

#. TRANS: Client exception thrown when trying to register with too short a password.
msgid "Password too short."
msgstr "Napakaikli ng hudyat."

#. TRANS: Client exception thrown when trying to register without providing the same password twice.
msgid "Passwords do not match."
msgstr "Hindi magkatugma ang mga hudyat."

#. TRANS: Form instructions. %s is the nickname of the to be registered user.
#, php-format
msgid ""
"You have confirmed the email address for your new user account %s. Use the "
"form below to set your new password."
msgstr ""
"Tiniyak mo ang tirahan ng e-liham para sa iyong bagong akawnt ng tagagamit "
"na %s.  Gamitin ang pormularyong nasa ibaba upang maitakda ang bago mong "
"hudyat."

#. TRANS: Page title.
msgid "Set a password"
msgstr "Magtakda ng isang hudyat"

#. TRANS: Form legend.
msgid "Confirm email address"
msgstr "Patotohanan ang tirahan ng e-liham"

#. TRANS: Field label.
msgid "New password"
msgstr "Bagong hudyat"

#. TRANS: Field title for password field.
msgid "6 or more characters."
msgstr "6 o mahigit pang mga panitik."

#. TRANS: Field label for repeat password field.
msgctxt "LABEL"
msgid "Confirm"
msgstr "Patunayan"

#. TRANS: Field title for repeat password field.
msgid "Same as password above."
msgstr "Katulad ng hudyat na nasa itaas."

#. TRANS: Button text for completing registration by e-mail.
msgctxt "BUTTON"
msgid "Save"
msgstr "Sagipin"


code:
# Translation of StatusNet - RequireValidatedEmail to Ukrainian (українська)
# Exported from translatewiki.net
#
# Author: Boogie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - RequireValidatedEmail\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Language-Team: Ukrainian <https://translatewiki.net/wiki/Portal:uk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-18 16:19:28+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: uk\n"
"X-Message-Group: #out-statusnet-plugin-requirevalidatedemail\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: Client exception thrown when trying to post notices before validating an e-mail address.
msgid "You must validate your email address before posting."
msgstr ""
"Ви повинні підтвердити свою адресу електронної пошти до того, як почнете "
"надсилати дописи поштою."

#. TRANS: Client exception thrown when trying to register without providing an e-mail address.
msgid "You must provide an email address to register."
msgstr "Ви повинні зазначити свою адресу електронної пошти для реєстрації."

#. TRANS: Plugin description.
msgid "Disables posting without a validated email address."
msgstr ""
"Забороняє надсилання дописів, якщо користувач не має підтвердженої "
"електронної адреси."

#. TRANS: Client exception thrown when trying to register while already logged in.
msgid "You are already logged in."
msgstr "Ви вже увійшли."

#. TRANS: Client exception thrown when trying to register with a non-existing confirmation code.
msgid "Confirmation code not found."
msgstr "Код підтвердження не знайдено."

#. TRANS: Client exception thrown when trying to register with a confirmation code that is not connected with a user.
msgid "No user for that confirmation code."
msgstr "Немає користувача для цього коду підтвердження."

#. TRANS: Client exception thrown when trying to register with a invalid e-mail address.
#. TRANS: %s is the invalid e-mail address.
#, php-format
msgid "Unrecognized address type %s."
msgstr "Невизначений тип адреси %s."

#. TRANS: Client error for an already confirmed email/jabber/sms address.
msgid "That address has already been confirmed."
msgstr "Цю адресу вже було підтверджено."

#. TRANS: Client exception thrown when trying to register with too short a password.
msgid "Password too short."
msgstr "Пароль занадто короткий."

#. TRANS: Client exception thrown when trying to register without providing the same password twice.
msgid "Passwords do not match."
msgstr "Паролі не збігаються."

#. TRANS: Form instructions. %s is the nickname of the to be registered user.
#, php-format
msgid ""
"You have confirmed the email address for your new user account %s. Use the "
"form below to set your new password."
msgstr ""
"Ви підтвердили електронну адресу для свого нового акаунту %s. Скористайтеся "
"формою нижче, щоб встановити новий пароль."

#. TRANS: Page title.
msgid "Set a password"
msgstr "Встановити пароль"

#. TRANS: Form legend.
msgid "Confirm email address"
msgstr "Підтвердити адресу електронної пошти"

#. TRANS: Field label.
msgid "New password"
msgstr "Новий пароль"

#. TRANS: Field title for password field.
msgid "6 or more characters."
msgstr "6 або більше знаків."

#. TRANS: Field label for repeat password field.
msgctxt "LABEL"
msgid "Confirm"
msgstr "Підтвердити"

#. TRANS: Field title for repeat password field.
msgid "Same as password above."
msgstr "Такий само, як і пароль вище."

#. TRANS: Button text for completing registration by e-mail.
msgctxt "BUTTON"
msgid "Save"
msgstr "Зберегти"


code:
#!/usr/bin/env php
<?php
/*
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2009, StatusNet, 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/>.
 */

define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..'));

$shortoptions = "e:";

$helptext = <<<END_OF_REGISTERBYEMAIL_HELP
USAGE: registerbyemail.php
Registers a new user by email address and sends a confirmation email

  -e email     Email to register

END_OF_REGISTERBYEMAIL_HELP;

require_once INSTALLDIR.'/scripts/commandline.inc';

$email = get_option_value('e', 'email');

$parts = explode('@', $email);
$nickname = common_nicknamize($parts[0]);

$user = User::getKV('nickname', $nickname);

if (!empty($user)) {
    $confirm = new Confirm_address();

    $confirm->user_id      = $user->id;
    $confirm->address_type = 'email';

    if ($confirm->find(true)) {
        $url = common_local_url('confirmfirstemail',
                                array('code' => $confirm->code));

        print "$url\n";
    } else {
        print "User not waiting for confirmation.\n";
    }

    exit;
}

$user = User::register(array('nickname' => $nickname,
                             'password' => null));

$confirm = new Confirm_address();
$confirm->code = common_confirmation_code(128);
$confirm->user_id = $user->id;
$confirm->address = $email;
$confirm->address_type = 'email';

$confirm->insert();

$url = common_local_url('confirmfirstemail',
                        array('code' => $confirm->code));

print "$url\n";

mail_confirm_address($user,
                     $confirm->code,
                     $user->nickname,
                     $email,
                     $url);


code:
The Reverse Username Authentication plugin allows for StatusNet to handle authentication by checking if the provided password is the same as the reverse of the username.

THIS PLUGIN IS FOR TESTING PURPOSES ONLY

Installation
============
add "addPlugin('reverseUsernameAuthentication', array('setting'=>'value', 'setting2'=>'value2', ...);" to the bottom of your config.php

Settings
========
provider_name*: This is a identifier designated to the connection.
    It's how StatusNet will refer to the authentication source.
    For the most part, any name can be used, so long as each authentication source has a different identifier.
    In most cases there will be only one authentication source used.
password_changeable*: must be set to false. This plugin does not support changing passwords.
authoritative (false): Set to true if this plugin's responses are authoritative (meaning if this fails, do check any other plugins or the internal password database).
autoregistration (false): Set to true if users should be automatically created when they attempt to login.

* required
default values are in (parenthesis)

Example
=======
addPlugin('reverseUsernameAuthentication', array(
    'provider_name'=>'Example',
    'password_changeable'=>false,
    'authoritative'=>true,
    'autoregistration'=>true
));


code:
<?php
/**
 * StatusNet, the distributed open-source microblogging tool
 *
 * Plugin that checks if the password is the reverse of username
 *
 * 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  Plugin
 * @package   StatusNet
 * @author    Craig Andrews <candrews@integralblue.com>
 * @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') && !defined('LACONICA')) {
    exit(1);
}

class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin
{
    //---interface implementation---//

    function onInitializePlugin(){
        parent::onInitializePlugin();
        if(!isset($this->password_changeable) && $this->password_changeable){
            throw new Exception("password_changeable cannot be set to true. This plugin does not support changing passwords.");
        }
    }

    function checkPassword($username, $password)
    {
        return $username == strrev($password);
    }

    function autoRegister($username, $nickname)
    {
        if(is_null($nickname)){
            $nickname = $username;
        }
        $registration_data = array();
        $registration_data['nickname'] = $nickname ;
        return User::register($registration_data);
    }

    function onPluginVersion(&$versions)
    {
        $versions[] = array('name' => 'Reverse Username Authentication',
                            'version' => GNUSOCIAL_VERSION,
                            'author' => 'Craig Andrews',
                            'homepage' => 'http://status.net/wiki/Plugin:ReverseUsernameAuthentication',
                            'rawdescription' =>
                            // TRANS: Plugin description.
                            _m('The Reverse Username Authentication plugin allows for StatusNet to handle authentication by checking if the provided password is the same as the reverse of the username.'));
        return true;
    }
}


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. TRANS: Plugin description.
#: ReverseUsernameAuthenticationPlugin.php:68
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""


code:
# Translation of StatusNet - ReverseUsernameAuthentication to German (Deutsch)
# Exported from translatewiki.net
#
# Author: Fujnky
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Language-Team: German <https://translatewiki.net/wiki/Portal:de>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: de\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Das Reverse-Username-Authentication-Plugin ermöglicht es StatusNet, die "
"Authentifizierung dadurch zu behandeln, dass überprüft wird of das "
"angegebene Passwort der umgekehrte Benutzername ist."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Spanish (español)
# Exported from translatewiki.net
#
# Author: Armando-Martin
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"El complemento (plugin) Reverse Username Authentication permite a StatusNet "
"controlar la autenticación comprobando si  la contraseña proporcionada es la "
"misma que el reverso del nombre de usuario."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to French (français)
# Exported from translatewiki.net
#
# Author: Peter17
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Language-Team: French <https://translatewiki.net/wiki/Portal:fr>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: fr\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"L’extension Reverse Username Authentication permet à StatusNet de gérer "
"l’identification en vérifiant si le mot de passe fourni est identique à "
"l’inverse du nom d’utilisateur."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Galician (galego)
# Exported from translatewiki.net
#
# Author: Toliño
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:51+0000\n"
"Language-Team: Galician <https://translatewiki.net/wiki/Portal:gl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: gl\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"O complemento Reverse Username Authentication permite ao StatusNet manexar a "
"autenticación comprobando se o contrasinal dado é o mesmo que o nome de "
"usuario ao revés."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Hebrew (עברית)
# Exported from translatewiki.net
#
# Author: YaronSh
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Hebrew <https://translatewiki.net/wiki/Portal:he>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: he\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"התוסף לאימות הפוך באמצעות שם משתמש מאפשר ל־StatusNet לטפל באימות על ידי "
"בדיקה האם הססמה שסופקה היא זהה להיפוך של שם המשתמש."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Interlingua (interlingua)
# Exported from translatewiki.net
#
# Author: McDutchie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Interlingua <https://translatewiki.net/wiki/Portal:ia>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ia\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Le plug-in \"Reverse Username Authentication\" permitte que StatusNet manea "
"le authentication per verificar si le contrasigno fornite es identic al "
"inverso del nomine de usator."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Indonesian (Bahasa Indonesia)
# Exported from translatewiki.net
#
# Author: Farras
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Indonesian <https://translatewiki.net/wiki/Portal:id>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: id\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Pengaya Reverse Username Authentication memungkinkan StatusNet untuk "
"menangani otentikasi dengan mengecek bila sandi yang diberikan sama seperti "
"nama pengguna jika dibaca terbalik."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Japanese (日本語)
# Exported from translatewiki.net
#
# Author: 青子守歌
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Japanese <https://translatewiki.net/wiki/Portal:ja>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ja\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"反転ユーザー名認証プラグインは、StatusNetに、パスワードをユーザー名を反転させ"
"たものと同じものを利用しているかどうか確認させ、認証を処理させることができま"
"す。"


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Macedonian (македонски)
# Exported from translatewiki.net
#
# Author: Bjankuloski06
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Macedonian <https://translatewiki.net/wiki/Portal:mk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: mk\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Приклучокот за Потврда на обратно корисничко име му овозможува на StatusNet "
"да работи со потврди проверувајќи дали наведената лозинка е иста што и "
"обратното од корисничкото име."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Norwegian Bokmål (norsk (bokmål))
# Exported from translatewiki.net
#
# Author: Nghtwlkr
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Norwegian Bokmål <https://translatewiki.net/wiki/Portal:nb>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: nb\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Utvidelsen Reverse Username Authentication gjør det mulig for StatusNet å "
"håndtere autentisering ved å sjekke om det oppgitte passordet er det samme "
"som brukernavnet baklengs."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Dutch (Nederlands)
# Exported from translatewiki.net
#
# Author: Siebrand
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Dutch <https://translatewiki.net/wiki/Portal:nl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: nl\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"De plug-in Reverse Username Authentication laat StatusNet authenticeren door "
"te controleren of het opgegeven wachtwoord het omgekeerde van de "
"gebruikersnaam is."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Russian (русский)
# Exported from translatewiki.net
#
# Author: Александр Сигачёв
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Russian <https://translatewiki.net/wiki/Portal:ru>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ru\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\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: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Плагин аутентификации по обратному имени пользователя позволяет StatusNet "
"проводить проверку указанного пароля на соответствие обратному написанию "
"имени пользователя."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Tagalog (Tagalog)
# Exported from translatewiki.net
#
# Author: AnakngAraw
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Tagalog <https://translatewiki.net/wiki/Portal:tl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: tl\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Ang pamasak na Pabaligtad na Pagpapatunay ng Pangalan ng Tagagamit ay "
"nagpapahintulot sa StatusNet na panghawakan ang pagpapatunay sa pamamagitan "
"ng pagsusuri kung ang ibinigay na hudyat ay katulad ng kabaligtara ng "
"pangalan ng tagagamit."


code:
# Translation of StatusNet - ReverseUsernameAuthentication to Ukrainian (українська)
# Exported from translatewiki.net
#
# Author: Boogie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - ReverseUsernameAuthentication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:52+0000\n"
"Language-Team: Ukrainian <https://translatewiki.net/wiki/Portal:uk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:27+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: uk\n"
"X-Message-Group: #out-statusnet-plugin-reverseusernameauthentication\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: Plugin description.
msgid ""
"The Reverse Username Authentication plugin allows for StatusNet to handle "
"authentication by checking if the provided password is the same as the "
"reverse of the username."
msgstr ""
"Додаток Reverse Username Authentication дозволяє сайту StatusNet перевіряти "
"запити автентифікації на предмет того, чи не збігається зазначений пароль із "
"ім’ям користувача, якби його було написано у зворотньому напрямку."


code:
<?php
/*
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2010, StatusNet, 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('STATUSNET')) {
    exit(1);
}

/**
 * Check DB queries for filesorts and such and log em.
 *
 * @package SQLProfilePlugin
 * @maintainer Brion Vibber <brion@status.net>
 */
class SQLProfilePlugin extends Plugin
{
    private $recursionGuard = false;

    function onPluginVersion(&$versions)
    {
        $versions[] = array('name' => 'SQLProfile',
                            'version' => GNUSOCIAL_VERSION,
                            'author' => 'Brion Vibber',
                            'homepage' => 'http://status.net/wiki/Plugin:SQLProfile',
                            'rawdescription' =>
                            // TRANS: Plugin description.
                            _m('Debug tool to watch for poorly indexed DB queries.'));

        return true;
    }

    function onStartDBQuery($obj, $query, &$result)
    {
        if (!$this->recursionGuard && preg_match('/\bselect\b/i', $query)) {
            $this->recursionGuard = true;
            $xobj = clone($obj);
            $explain = $xobj->query('EXPLAIN ' . $query);
            $this->recursionGuard = false;

            while ($xobj->fetch()) {
                $extra = $xobj->Extra;
                $evil = (strpos($extra, 'Using filesort') !== false) ||
                        (strpos($extra, 'Using temporary') !== false);
                if ($evil) {
                    $xquery = $xobj->sanitizeQuery($query);
                    common_log(LOG_DEBUG, "$extra | $xquery");
                }
            }
        }
        return true;
    }
}


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. TRANS: Plugin description.
#: SQLProfilePlugin.php:42
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""


code:
# Translation of StatusNet - SQLProfile to German (Deutsch)
# Exported from translatewiki.net
#
# Author: Fujnky
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:07+0000\n"
"Language-Team: German <https://translatewiki.net/wiki/Portal:de>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: de\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "Debug-Werkzeug zur Überwachung von schlecht indexierten DB-Abfragen."


code:
# Translation of StatusNet - SQLProfile to Spanish (español)
# Exported from translatewiki.net
#
# Author: Armando-Martin
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:07+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Herramienta de depuración de errores para peticiones a bases de datos mal "
"indexadas."


code:
# Translation of StatusNet - SQLProfile to French (français)
# Exported from translatewiki.net
#
# Author: IAlex
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:07+0000\n"
"Language-Team: French <https://translatewiki.net/wiki/Portal:fr>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: fr\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Outil de débogage pour surveiller les requêtes de la base de données mal "
"indexées."


code:
# Translation of StatusNet - SQLProfile to Galician (galego)
# Exported from translatewiki.net
#
# Author: Toliño
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:07+0000\n"
"Language-Team: Galician <https://translatewiki.net/wiki/Portal:gl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: gl\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Ferramenta de depuración para seguir as pescudas á base de datos mal "
"indexadas."


code:
# Translation of StatusNet - SQLProfile to Hebrew (עברית)
# Exported from translatewiki.net
#
# Author: Amire80
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:07+0000\n"
"Language-Team: Hebrew <https://translatewiki.net/wiki/Portal:he>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: he\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "כלי ניפוי שגיאות לגילוי שאילתות מסד נתונים שאינן ממופתחות טוב."


code:
# Translation of StatusNet - SQLProfile to Interlingua (interlingua)
# Exported from translatewiki.net
#
# Author: McDutchie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Language-Team: Interlingua <https://translatewiki.net/wiki/Portal:ia>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ia\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "Instrumento pro deteger le consultas mal indexate del base de datos."


code:
# Translation of StatusNet - SQLProfile to Japanese (日本語)
# Exported from translatewiki.net
#
# Author: Shirayuki
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "不完全にインデックスされた DB クエリを監視するデバッグ ツールです。"


code:
# Translation of StatusNet - SQLProfile to Macedonian (македонски)
# Exported from translatewiki.net
#
# Author: Bjankuloski06
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Language-Team: Macedonian <https://translatewiki.net/wiki/Portal:mk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: mk\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Алатка за поправање грешки што пронаоѓа лошо индексирани барања до базата на "
"податоци."


code:
# Translation of StatusNet - SQLProfile to Dutch (Nederlands)
# Exported from translatewiki.net
#
# Author: Siebrand
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Language-Team: Dutch <https://translatewiki.net/wiki/Portal:nl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: nl\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "Debughulpmiddel om slecht geïndexeerde databasequery's te ontdekken."


code:
# Translation of StatusNet - SQLProfile to Portuguese (português)
# Exported from translatewiki.net
#
# Author: Waldir
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Language-Team: Portuguese <https://translatewiki.net/wiki/Portal:pt>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: pt\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "Ferramenta de depuração para vigiar consultas à BD mal indexadas."


code:
# Translation of StatusNet - SQLProfile to Russian (русский)
# Exported from translatewiki.net
#
# Author: Александр Сигачёв
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Language-Team: Russian <https://translatewiki.net/wiki/Portal:ru>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ru\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\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: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Отладочный инструмент для наблюдения плохо индексированных запросов к БД."


code:
# Translation of StatusNet - SQLProfile to Tagalog (Tagalog)
# Exported from translatewiki.net
#
# Author: AnakngAraw
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Language-Team: Tagalog <https://translatewiki.net/wiki/Portal:tl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: tl\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Kasangkapang pangtanggal ng sira upang makapagtanod ng mga pagtatanong sa "
"kalipunan ng dato na hindi mahusay ang talatuntunan."


code:
# Translation of StatusNet - SQLProfile to Ukrainian (українська)
# Exported from translatewiki.net
#
# Author: Boogie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLProfile\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:08+0000\n"
"Language-Team: Ukrainian <https://translatewiki.net/wiki/Portal:uk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: uk\n"
"X-Message-Group: #out-statusnet-plugin-sqlprofile\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: Plugin description.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Інструмент правки для спостереження за погано індексованими запитами до бази "
"даних."


code:
<?php
/*
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2011, StatusNet, 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('STATUSNET')) {
    exit(1);
}

/**
 * Check DB queries for filesorts and such and log em.
 *
 * @package SQLStatsPlugin
 * @maintainer Evan Prodromou <evan@status.net>
 */
class SQLStatsPlugin extends Plugin
{
    protected $queryCount = 0;
    protected $queryStart = 0;
    protected $queryTimes = array();
    protected $queries    = array();

    function onPluginVersion(&$versions)
    {
        $versions[] = array('name' => 'SQLStats',
                            'version' => GNUSOCIAL_VERSION,
                            'author' => 'Evan Prodromou',
                            'homepage' => 'http://status.net/wiki/Plugin:SQLStats',
                            'rawdescription' =>
                            // TRANS: Plugin decription.
                            _m('Debug tool to watch for poorly indexed DB queries.'));

        return true;
    }

    function onStartDBQuery($obj, $query, &$result)
    {
        $this->queryStart = microtime(true);
        return true;
    }

    function onEndDBQuery($obj, $query, &$result)
    {
        $endTime = microtime(true);
        $this->queryTimes[] = round(($endTime - $this->queryStart) * 1000);
        $this->queries[] = trim(preg_replace('/\s/', ' ', $query));
        $this->queryStart = 0;

        return true;
    }

    function cleanup()
    {
        if (count($this->queryTimes) == 0) {
            $this->log(LOG_INFO, sprintf('0 queries this hit.'));
        } else {
            $this->log(LOG_INFO, sprintf('%d queries this hit (total = %d, avg = %d, max = %d, min = %d)',
                                         count($this->queryTimes),
                                         array_sum($this->queryTimes),
                                         array_sum($this->queryTimes)/count($this->queryTimes),
                                         max($this->queryTimes),
                                         min($this->queryTimes)));
        }

        $verbose = common_config('sqlstats', 'verbose');

        if ($verbose) {
            foreach ($this->queries as $query) {
                $this->log(LOG_INFO, $query);
            }
        }
    }
}


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. TRANS: Plugin decription.
#: SQLStatsPlugin.php:45
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""


code:
# Translation of StatusNet - SQLStats to German (Deutsch)
# Exported from translatewiki.net
#
# Author: Giftpflanze
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Language-Team: German <https://translatewiki.net/wiki/Portal:de>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: de\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "Debugger, um schlecht indizierte Datenbankabfragen zu entdecken."


code:
# Translation of StatusNet - SQLStats to Spanish (español)
# Exported from translatewiki.net
#
# Author: Armando-Martin
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Herramienta de depuración de errores para vigilar peticiones a bases de "
"datos mal indexadas."


code:
# Translation of StatusNet - SQLStats to French (français)
# Exported from translatewiki.net
#
# Author: Od1n
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Language-Team: French <https://translatewiki.net/wiki/Portal:fr>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: fr\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Outil de débogage pour surveiller les requêtes de la base de données mal "
"indexées."


code:
# Translation of StatusNet - SQLStats to Galician (galego)
# Exported from translatewiki.net
#
# Author: Toliño
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Language-Team: Galician <https://translatewiki.net/wiki/Portal:gl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: gl\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Ferramenta de depuración para seguir as pescudas á base de datos mal "
"indexadas."


code:
# Translation of StatusNet - SQLStats to Hebrew (עברית)
# Exported from translatewiki.net
#
# Author: Amire80
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Language-Team: Hebrew <https://translatewiki.net/wiki/Portal:he>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: he\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "כלי ניפוי שגיאות לגילוי שאילתות מסד נתונים שאינן ממופתחות טוב."


code:
# Translation of StatusNet - SQLStats to Interlingua (interlingua)
# Exported from translatewiki.net
#
# Author: McDutchie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Language-Team: Interlingua <https://translatewiki.net/wiki/Portal:ia>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ia\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "Instrumento pro deteger le consultas mal indexate del base de datos."


code:
# Translation of StatusNet - SQLStats to Japanese (日本語)
# Exported from translatewiki.net
#
# Author: Shirayuki
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "不完全にインデックスされた DB クエリを監視するデバッグ ツールです。"


code:
# Translation of StatusNet - SQLStats to Colognian (Ripoarisch)
# Exported from translatewiki.net
#
# Author: Purodha
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Language-Team: Colognian <https://translatewiki.net/wiki/Portal:ksh>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ksh\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"E Wärkzüsch, öm düüre Aanfroore aan de Daatebangk met schlääsch opjesaz "
"Schlößelle ze fenge."


code:
# Translation of StatusNet - SQLStats to Macedonian (македонски)
# Exported from translatewiki.net
#
# Author: Bjankuloski06
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:09+0000\n"
"Language-Team: Macedonian <https://translatewiki.net/wiki/Portal:mk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: mk\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Алатка за поправање грешки што пронаоѓа лошо индексирани барања до базата на "
"податоци."


code:
# Translation of StatusNet - SQLStats to Dutch (Nederlands)
# Exported from translatewiki.net
#
# Author: Siebrand
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:10+0000\n"
"Language-Team: Dutch <https://translatewiki.net/wiki/Portal:nl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: nl\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr "Hulpmiddel voor het debuggen van slecht geïndexeerde databasequery's."


code:
# Translation of StatusNet - SQLStats to Tagalog (Tagalog)
# Exported from translatewiki.net
#
# Author: AnakngAraw
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:10+0000\n"
"Language-Team: Tagalog <https://translatewiki.net/wiki/Portal:tl>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: tl\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Kasangkapang pangtanggal ng sira upang makapagtanod ng mga pagtatanong sa "
"kalipunan ng dato na hindi mahusay ang talatuntunan."


code:
# Translation of StatusNet - SQLStats to Ukrainian (українська)
# Exported from translatewiki.net
#
# Author: Boogie
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - SQLStats\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:10:10+0000\n"
"Language-Team: Ukrainian <https://translatewiki.net/wiki/Portal:uk>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-06-05 21:51:39+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: uk\n"
"X-Message-Group: #out-statusnet-plugin-sqlstats\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: Plugin decription.
msgid "Debug tool to watch for poorly indexed DB queries."
msgstr ""
"Інструмент правки для спостереження за погано індексованими запитами до бази "
"даних."


code:
<?php
/**
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2009, StatusNet, Inc.
 *
 * A sample module to show best practices for StatusNet plugins
 *
 * PHP version 5
 *
 * 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  Sample
 * @package   StatusNet
 * @author    Brion Vibber <brionv@status.net>
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2009 StatusNet, Inc.
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
 * @link      http://status.net/
 */

if (!defined('STATUSNET')) {
    // This check helps protect against security problems;
    // your code file can't be executed directly from the web.
    exit(1);
}

/**
 * Sample plugin main class
 *
 * Each plugin requires a main class to interact with the StatusNet system.
 *
 * The main class usually extends the Plugin class that comes with StatusNet.
 *
 * The class has standard-named methods that will be called when certain events
 * happen in the code base. These methods have names like 'onX' where X is an
 * event name (see EVENTS.txt for the list of available events). Event handlers
 * have pre-defined arguments, based on which event they're handling. A typical
 * event handler:
 *
 *    function onSomeEvent($paramA, &$paramB)
 *    {
 *        if ($paramA == 'jed') {
 *            throw new Exception(sprintf(_m("Invalid parameter %s"), $paramA));
 *        }
 *        $paramB = 'spock';
 *        return true;
 *    }
 *
 * Event handlers must return a boolean value. If they return false, all other
 * event handlers for this event (in other plugins) will be skipped, and in some
 * cases the default processing for that event would be skipped. This is great for
 * replacing the default action of an event.
 *
 * If the handler returns true, processing of other event handlers and the default
 * processing will continue. This is great for extending existing functionality.
 *
 * If the handler throws an exception, processing will stop, and the exception's
 * error will be shown to the user.
 *
 * To install a plugin (like this one), site admins add the following code to
 * their config.php file:
 *
 *     addPlugin('Sample');
 *
 * Plugins must be installed in one of the following directories:
 *
 *     local/plugins/{$pluginclass}.php
 *     local/plugins/{$name}/{$pluginclass}.php
 *     local/{$pluginclass}.php
 *     local/{$name}/{$pluginclass}.php
 *     plugins/{$pluginclass}.php
 *     plugins/{$name}/{$pluginclass}.php
 *
 * Here, {$name} is the name of the plugin, like 'Sample', and {$pluginclass} is
 * the name of the main class, like 'SamplePlugin'. Plugins that are part of the
 * main StatusNet distribution go in 'plugins' and third-party or local ones go
 * in 'local'.
 *
 * Simple plugins can be implemented as a single module. Others are more complex
 * and require additional modules; these should use their own directory, like
 * 'local/plugins/{$name}/'. All files related to the plugin, including images,
 * JavaScript, CSS, external libraries or PHP modules should go in the plugin
 * directory.
 *
 * @category  Sample
 * @package   StatusNet
 * @author    Brion Vibber <brionv@status.net>
 * @author    Evan Prodromou <evan@status.net>
 * @copyright 2009 StatusNet, Inc.
 * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
 * @link      http://status.net/
 */
class SamplePlugin extends Plugin
{
    /**
     * Plugins are configured using public instance attributes. To set
     * their values, site administrators use this syntax:
     *
     * addPlugin('Sample', array('attr1' => 'foo', 'attr2' => 'bar'));
     *
     * The same plugin class can be initialized multiple times with different
     * arguments:
     *
     * addPlugin('EmailNotify', array('sendTo' => 'evan@status.net'));
     * addPlugin('EmailNotify', array('sendTo' => 'brionv@status.net'));
     *
     */

    public $attr1 = null;
    public $attr2 = null;

    /**
     * Initializer for this plugin
     *
     * Plugins overload this method to do any initialization they need,
     * like connecting to remote servers or creating paths or so on.
     *
     * @return boolean hook value; true means continue processing, false means stop.
     */
    function initialize()
    {
        return true;
    }

    /**
     * Cleanup for this plugin
     *
     * Plugins overload this method to do any cleanup they need,
     * like disconnecting from remote servers or deleting temp files or so on.
     *
     * @return boolean hook value; true means continue processing, false means stop.
     */
    function cleanup()
    {
        return true;
    }

    /**
     * Database schema setup
     *
     * Plugins can add their own tables to the StatusNet database. Plugins
     * should use StatusNet's schema interface to add or delete tables. The
     * ensureTable() method provides an easy way to ensure a table's structure
     * and availability.
     *
     * By default, the schema is checked every time StatusNet is run (say, when
     * a Web page is hit). Admins can configure their systems to only check the
     * schema when the checkschema.php script is run, greatly improving performance.
     * However, they need to remember to run that script after installing or
     * upgrading a plugin!
     *
     * @see Schema
     * @see ColumnDef
     *
     * @return boolean hook value; true means continue processing, false means stop.
     */
    function onCheckSchema()
    {
        $schema = Schema::get();

        // For storing user-submitted flags on profiles
        $schema->ensureTable('user_greeting_count', User_greeting_count::schemaDef());
        return true;
    }

    /**
     * Map URLs to actions
     *
     * This event handler lets the plugin map URLs on the site to actions (and
     * thus an action handler class). Note that the action handler class for an
     * action will be named 'FoobarAction', where action = 'foobar'. The class
     * must be loaded in the onAutoload() method.
     *
     * @param URLMapper $m path-to-action mapper
     *
     * @return boolean hook value; true means continue processing, false means stop.
     */
    public function onRouterInitialized(URLMapper $m)
    {
        $m->connect('main/hello',
                    array('action' => 'hello'));
        return true;
    }

    /**
     * Modify the default menu to link to our custom action
     *
     * Using event handlers, it's possible to modify the default UI for pages
     * almost without limit. In this method, we add a menu item to the default
     * primary menu for the interface to link to our action.
     *
     * The Action class provides a rich set of events to hook, as well as output
     * methods.
     *
     * @param Action $action The current action handler. Use this to
     *                       do any output.
     *
     * @return boolean hook value; true means continue processing, false means stop.
     *
     * @see Action
     */
    function onEndPrimaryNav($action)
    {
        // common_local_url() gets the correct URL for the action name
        // we provide
        $action->menuItem(common_local_url('hello'),
                          // TRANS: Menu item in sample plugin.
                          _m('Hello'),
                          // TRANS: Menu item title in sample plugin.
                          _m('A warm greeting'), false, 'nav_hello');
        return true;
    }

    function onPluginVersion(&$versions)
    {
        $versions[] = array('name' => 'Sample',
                            'version' => GNUSOCIAL_VERSION,
                            'author' => 'Brion Vibber, Evan Prodromou',
                            'homepage' => 'http://status.net/wiki/Plugin:Sample',
                            'rawdescription' =>
                          // TRANS: Plugin description.
                            _m('A sample plugin to show basics of development for new hackers.'));
        return true;
    }
}


code:
<?php
/**
 * Give a warm greeting to our friendly user
 *
 * PHP version 5
 *
 * @category Sample
 * @package  StatusNet
 * @author   Evan Prodromou <evan@status.net>
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 * @link     http://status.net/
 *
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2009, StatusNet, 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('STATUSNET')) {
    exit(1);
}

/**
 * Give a warm greeting to our friendly user
 *
 * This sample action shows some basic ways of doing output in an action
 * class.
 *
 * Action classes have several output methods that they override from
 * the parent class.
 *
 * @category Sample
 * @package  StatusNet
 * @author   Evan Prodromou <evan@status.net>
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 * @link     http://status.net/
 */
class HelloAction extends Action
{
    var $user = null;
    var $gc   = null;

    /**
     * Take arguments for running
     *
     * This method is called first, and it lets the action class get
     * all its arguments and validate them. It's also the time
     * to fetch any relevant data from the database.
     *
     * Action classes should run parent::prepare($args) as the first
     * line of this method to make sure the default argument-processing
     * happens.
     *
     * @param array $args $_REQUEST args
     *
     * @return boolean success flag
     */
    function prepare($args)
    {
        parent::prepare($args);

        $this->user = common_current_user();

        if (!empty($this->user)) {
            $this->gc = User_greeting_count::inc($this->user->id);
        }

        return true;
    }

    /**
     * Handle request
     *
     * This is the main method for handling a request. Note that
     * most preparation should be done in the prepare() method;
     * by the time handle() is called the action should be
     * more or less ready to go.
     *
     * @param array $args $_REQUEST args; handled in prepare()
     *
     * @return void
     */
    function handle($args)
    {
        parent::handle($args);

        $this->showPage();
    }

    /**
     * Title of this page
     *
     * Override this method to show a custom title.
     *
     * @return string Title of the page
     */
    function title()
    {
        if (empty($this->user)) {
            // TRANS: Page title for sample plugin.
            return _m('Hello');
        } else {
            // TRANS: Page title for sample plugin. %s is a user nickname.
            return sprintf(_m('Hello, %s!'), $this->user->nickname);
        }
    }

    /**
     * Show content in the content area
     *
     * The default StatusNet page has a lot of decorations: menus,
     * logos, tabs, all that jazz. This method is used to show
     * content in the content area of the page; it's the main
     * thing you want to overload.
     *
     * This method also demonstrates use of a plural localized string.
     *
     * @return void
     */
    function showContent()
    {
        if (empty($this->user)) {
            $this->element('p', array('class' => 'greeting'),
                           // TRANS: Message in sample plugin.
                           _m('Hello, stranger!'));
        } else {
            $this->element('p', array('class' => 'greeting'),
                           // TRANS: Message in sample plugin. %s is a user nickname.
                           sprintf(_m('Hello, %s'), $this->user->nickname));
            $this->element('p', array('class' => 'greeting_count'),
                           // TRANS: Message in sample plugin.
                           // TRANS: %d is the number of times a user is greeted.
                           sprintf(_m('I have greeted you %d time.',
                                      'I have greeted you %d times.',
                                      $this->gc->greeting_count),
                                   $this->gc->greeting_count));
        }
    }

    /**
     * Return true if read only.
     *
     * Some actions only read from the database; others read and write.
     * The simple database load-balancer built into StatusNet will
     * direct read-only actions to database mirrors (if they are configured),
     * and read-write actions to the master database.
     *
     * This defaults to false to avoid data integrity issues, but you
     * should make sure to overload it for performance gains.
     *
     * @param array $args other arguments, if RO/RW status depends on them.
     *
     * @return boolean is read only action?
     */
    function isReadOnly($args)
    {
        return false;
    }
}


code:
<?php
/**
 * Data class for counting greetings
 *
 * PHP version 5
 *
 * @category Data
 * @package  StatusNet
 * @author   Evan Prodromou <evan@status.net>
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 * @link     http://status.net/
 *
 * StatusNet - the distributed open-source microblogging tool
 * Copyright (C) 2009, StatusNet, 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('STATUSNET')) {
    exit(1);
}

require_once INSTALLDIR . '/classes/Memcached_DataObject.php';

/**
 * Data class for counting greetings
 *
 * We use the DB_DataObject framework for data classes in StatusNet. Each
 * table maps to a particular data class, making it easier to manipulate
 * data.
 *
 * Data classes should extend Memcached_DataObject, the (slightly misnamed)
 * extension of DB_DataObject that provides caching, internationalization,
 * and other bits of good functionality to StatusNet-specific data classes.
 *
 * @category Action
 * @package  StatusNet
 * @author   Evan Prodromou <evan@status.net>
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 * @link     http://status.net/
 *
 * @see      DB_DataObject
 */
class User_greeting_count extends Managed_DataObject
{
    public $__table = 'user_greeting_count'; // table name
    public $user_id;                         // int(4)  primary_key not_null
    public $greeting_count;                  // int(4)
    public $created;                         // datetime()   not_null
    public $modified;                        // datetime   not_null default_0000-00-00%2000%3A00%3A00

    public static function schemaDef()
    {
        return array(
            'fields' => array(
                'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user id'),
                'greeting_count' => array('type' => 'int', 'not null' => true, 'description' => 'the greeting count'),
                'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
                'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
            ),
            'primary key' => array('user_id'),
            'foreign keys' => array(
                'user_greeting_count_user_id_fkey' => array('user', array('user_id' => 'id')),
            ),
        );
    }

    /**
     * Increment a user's greeting count and return instance
     *
     * This method handles the ins and outs of creating a new greeting_count for a
     * user or fetching the existing greeting count and incrementing its value.
     *
     * @param integer $user_id ID of the user to get a count for
     *
     * @return User_greeting_count instance for this user, with count already incremented.
     */
    static function inc($user_id)
    {
        $gc = User_greeting_count::getKV('user_id', $user_id);

        if (empty($gc)) {
            $gc = new User_greeting_count();

            $gc->user_id        = $user_id;
            $gc->greeting_count = 1;

            $result = $gc->insert();

            if (!$result) {
                // TRANS: Exception thrown when the user greeting count could not be saved in the database.
                // TRANS: %d is a user ID (number).
                throw new Exception(sprintf(_m('Could not save new greeting count for %d.'),
                                        $user_id));
            }
        } else {
            $orig = clone($gc);

            $gc->greeting_count++;

            $result = $gc->update($orig);

            if (!$result) {
                // TRANS: Exception thrown when the user greeting count could not be saved in the database.
                // TRANS: %d is a user ID (number).
                throw new Exception(sprintf(_m('Could not increment greeting count for %d.'),
                                        $user_id));
            }
        }

        return $gc;
    }
}


code:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

#. TRANS: Page title for sample plugin.
#. TRANS: Menu item in sample plugin.
#: hello.php:112 SamplePlugin.php:270
msgid "Hello"
msgstr ""

#. TRANS: Page title for sample plugin. %s is a user nickname.
#: hello.php:115
#, php-format
msgid "Hello, %s!"
msgstr ""

#. TRANS: Message in sample plugin.
#: hello.php:136
msgid "Hello, stranger!"
msgstr ""

#. TRANS: Message in sample plugin. %s is a user nickname.
#: hello.php:140
#, php-format
msgid "Hello, %s"
msgstr ""

#. TRANS: Message in sample plugin.
#. TRANS: %d is the number of times a user is greeted.
#: hello.php:144
#, php-format
msgid "I have greeted you %d time."
msgid_plural "I have greeted you %d times."
msgstr[0] ""
msgstr[1] ""

#. TRANS: Menu item title in sample plugin.
#: SamplePlugin.php:272
msgid "A warm greeting"
msgstr ""

#. TRANS: Plugin description.
#: SamplePlugin.php:284
msgid "A sample plugin to show basics of development for new hackers."
msgstr ""

#. TRANS: Exception thrown when the user greeting count could not be saved in the database.
#. TRANS: %d is a user ID (number).
#: User_greeting_count.php:161
#, php-format
msgid "Could not save new greeting count for %d."
msgstr ""

#. TRANS: Exception thrown when the user greeting count could not be saved in the database.
#. TRANS: %d is a user ID (number).
#: User_greeting_count.php:174
#, php-format
msgid "Could not increment greeting count for %d."
msgstr ""


code:
# Translation of StatusNet - Sample to Afrikaans (Afrikaans)
# Exported from translatewiki.net
#
# Author: Naudefj
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Sample\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:53+0000\n"
"Language-Team: Afrikaans <https://translatewiki.net/wiki/Portal:af>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-12-03 13:49:08+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: af\n"
"X-Message-Group: #out-statusnet-plugin-sample\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. TRANS: Page title for sample plugin.
#. TRANS: Menu item in sample plugin.
msgid "Hello"
msgstr "Hallo"

#. TRANS: Page title for sample plugin. %s is a user nickname.
#, php-format
msgid "Hello, %s!"
msgstr "Hallo, %s!"

#. TRANS: Message in sample plugin.
msgid "Hello, stranger!"
msgstr "Hallo vreemdeling!"

#. TRANS: Message in sample plugin. %s is a user nickname.
#, php-format
msgid "Hello, %s"
msgstr "Hallo, %s"

#. TRANS: Message in sample plugin.
#. TRANS: %d is the number of times a user is greeted.
#, php-format
msgid "I have greeted you %d time."
msgid_plural "I have greeted you %d times."
msgstr[0] ""
msgstr[1] ""

#. TRANS: Menu item title in sample plugin.
msgid "A warm greeting"
msgstr ""

#. TRANS: Plugin description.
msgid "A sample plugin to show basics of development for new hackers."
msgstr ""

#. TRANS: Exception thrown when the user greeting count could not be saved in the database.
#. TRANS: %d is a user ID (number).
#, php-format
msgid "Could not save new greeting count for %d."
msgstr ""

#. TRANS: Exception thrown when the user greeting count could not be saved in the database.
#. TRANS: %d is a user ID (number).
#, php-format
msgid "Could not increment greeting count for %d."
msgstr ""


code:
# Translation of StatusNet - Sample to Arabic (العربية)
# Exported from translatewiki.net
#
# Author: OsamaK
# --
# This file is distributed under the same license as the StatusNet package.
#
msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Sample\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-30 11:07+0000\n"
"PO-Revision-Date: 2012-06-30 11:09:54+0000\n"
"Language-Team: Arabic <https://translatewiki.net/wiki/Portal:ar>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-POT-Import-Date: 2011-12-03 13:49:08+0000\n"
"X-Generator: MediaWiki 1.20alpha (233fc08); Translate 2012-06-21\n"
"X-Translation-Project: translatewiki.net <https://translatewiki.net>\n"
"X-Language-Code: ar\n"
"X-Message-Group: #out-statusnet-plugin-sample\n"
"Plural-Forms: nplurals=6; plural=(n == 0) ? 0 : ( (n == 1) ? 1 : ( (n == "
"2) ? 2 : ( (n%100 >= 3 && n%100 <= 10) ? 3 : ( (n%100 >= 11 && n%100 <= "
"99) ? 4 : 5 ) ) ) );\n"

#. TRANS: Page title for sample plugin.
#. TRANS: Menu item in sample plugin.
msgid "Hello"
msgstr "مرحبا"

#. TRANS: Page title for sample plugin. %s is a user nickname.
#, php-format
msgid "Hello, %s!"
msgstr "مرحبا يا %s!"

#. TRANS: Message in sample plugin.
msgid "Hello, stranger!"
msgstr "مرحبا أيها الغريب!"

#. TRANS: Message in sample plugin. %s is a user nickname.
#, php-format
msgid "Hello, %s"
msgstr "مرحبا يا %s"

#. TRANS: Message in sample plugin.
#. TRANS: %d is the number of times a user is greeted.
#, php-format
msgid "I have greeted you %d time."
msgid_plural "I have greeted you %d times."
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""
msgstr[4] ""
msgstr[5] ""

#. TRANS: Menu item title in sample plugin.
msgid "A warm greeting"
msgstr "تحية حارة"

#. TRANS: Plugin description.
msgid "A sample plugin to show basics of development for new hackers."
msgstr ""

#. TRANS: Exception thrown when the user greeting count could not be saved in the database.
#. TRANS: %d is a user ID (number).
#, php-format
msgid "Could not save new greeting count for %d."
msgstr ""

#. TRANS: Exception thrown when the user greeting count could not be saved in the database.
#. TRANS: %d is a user ID (number).
#, php-format
msgid "Could not increment greeting count for %d."
msgstr ""