diff options
Diffstat (limited to 'plugins/Sample')
-rw-r--r-- | plugins/Sample/SamplePlugin.php | 8 | ||||
-rw-r--r-- | plugins/Sample/User_greeting_count.php | 16 | ||||
-rw-r--r-- | plugins/Sample/hello.php | 8 | ||||
-rw-r--r-- | plugins/Sample/locale/Sample.pot | 33 |
4 files changed, 28 insertions, 37 deletions
diff --git a/plugins/Sample/SamplePlugin.php b/plugins/Sample/SamplePlugin.php index 913741226..ef69121a9 100644 --- a/plugins/Sample/SamplePlugin.php +++ b/plugins/Sample/SamplePlugin.php @@ -101,7 +101,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ - class SamplePlugin extends Plugin { /** @@ -129,7 +128,6 @@ class SamplePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function initialize() { return true; @@ -143,7 +141,6 @@ class SamplePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function cleanup() { return true; @@ -168,7 +165,6 @@ class SamplePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function onCheckSchema() { $schema = Schema::get(); @@ -201,7 +197,6 @@ class SamplePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function onAutoload($cls) { $dir = dirname(__FILE__); @@ -231,7 +226,6 @@ class SamplePlugin extends Plugin * * @return boolean hook value; true means continue processing, false means stop. */ - function onRouterInitialized($m) { $m->connect('main/hello', @@ -256,7 +250,6 @@ class SamplePlugin extends Plugin * * @see Action */ - function onEndPrimaryNav($action) { // common_local_url() gets the correct URL for the action name @@ -278,4 +271,3 @@ class SamplePlugin extends Plugin return true; } } - diff --git a/plugins/Sample/User_greeting_count.php b/plugins/Sample/User_greeting_count.php index fc0cbd28f..38d68c91e 100644 --- a/plugins/Sample/User_greeting_count.php +++ b/plugins/Sample/User_greeting_count.php @@ -70,7 +70,6 @@ class User_greeting_count extends Memcached_DataObject * @return User_greeting_count object found, or null for no hits * */ - function staticGet($k, $v=null) { return Memcached_DataObject::staticGet('User_greeting_count', $k, $v); @@ -84,7 +83,6 @@ class User_greeting_count extends Memcached_DataObject * * @return array array of column definitions */ - function table() { return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, @@ -100,7 +98,6 @@ class User_greeting_count extends Memcached_DataObject * * @return array list of key field names */ - function keys() { return array_keys($this->keyTypes()); @@ -118,7 +115,6 @@ class User_greeting_count extends Memcached_DataObject * 'K' for primary key: for compound keys, add an entry for each component; * 'U' for unique keys: compound keys are not well supported here. */ - function keyTypes() { return array('user_id' => 'K'); @@ -134,7 +130,6 @@ class User_greeting_count extends Memcached_DataObject * * @return array magic three-false array that stops auto-incrementing. */ - function sequenceKey() { return array(false, false, false); @@ -150,7 +145,6 @@ class User_greeting_count extends Memcached_DataObject * * @return User_greeting_count instance for this user, with count already incremented. */ - static function inc($user_id) { $gc = User_greeting_count::staticGet('user_id', $user_id); @@ -165,12 +159,12 @@ class User_greeting_count extends Memcached_DataObject $result = $gc->insert(); if (!$result) { - throw Exception(sprintf(_m("Could not save new greeting count for %d"), + // TRANS: Exception thrown when the user greeting count could not be saved in the database. + // TRANS: %d is a user ID (number). + throw Exception(sprintf(_m("Could not save new greeting count for %d."), $user_id)); } - } else { - $orig = clone($gc); $gc->greeting_count++; @@ -178,7 +172,9 @@ class User_greeting_count extends Memcached_DataObject $result = $gc->update($orig); if (!$result) { - throw Exception(sprintf(_m("Could not increment greeting count for %d"), + // TRANS: Exception thrown when the user greeting count could not be saved in the database. + // TRANS: %d is a user ID (number). + throw Exception(sprintf(_m("Could not increment greeting count for %d."), $user_id)); } } diff --git a/plugins/Sample/hello.php b/plugins/Sample/hello.php index dfbd0ad4f..a793ac6de 100644 --- a/plugins/Sample/hello.php +++ b/plugins/Sample/hello.php @@ -46,7 +46,6 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @link http://status.net/ */ - class HelloAction extends Action { var $user = null; @@ -67,7 +66,6 @@ class HelloAction extends Action * * @return boolean success flag */ - function prepare($args) { parent::prepare($args); @@ -93,7 +91,6 @@ class HelloAction extends Action * * @return void */ - function handle($args) { parent::handle($args); @@ -108,13 +105,12 @@ class HelloAction extends Action * * @return string Title of the page */ - function title() { if (empty($this->user)) { return _m('Hello'); } else { - return sprintf(_m('Hello, %s'), $this->user->nickname); + return sprintf(_m('Hello, %s!'), $this->user->nickname); } } @@ -130,7 +126,6 @@ class HelloAction extends Action * * @return void */ - function showContent() { if (empty($this->user)) { @@ -162,7 +157,6 @@ class HelloAction extends Action * * @return boolean is read only action? */ - function isReadOnly($args) { return false; diff --git a/plugins/Sample/locale/Sample.pot b/plugins/Sample/locale/Sample.pot index 66bcb775d..b58819655 100644 --- a/plugins/Sample/locale/Sample.pot +++ b/plugins/Sample/locale/Sample.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-09-14 22:56+0000\n" +"POT-Creation-Date: 2010-09-18 22:06+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" @@ -17,38 +17,47 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: User_greeting_count.php:168 +#. 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:164 #, php-format -msgid "Could not save new greeting count for %d" +msgid "Could not save new greeting count for %d." msgstr "" -#: User_greeting_count.php:181 +#. 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:177 #, php-format -msgid "Could not increment greeting count for %d" +msgid "Could not increment greeting count for %d." msgstr "" -#: SamplePlugin.php:266 hello.php:115 +#: SamplePlugin.php:259 hello.php:111 msgid "Hello" msgstr "" -#: SamplePlugin.php:266 +#: SamplePlugin.php:259 msgid "A warm greeting" msgstr "" -#: SamplePlugin.php:277 +#: SamplePlugin.php:270 msgid "A sample plugin to show basics of development for new hackers." msgstr "" -#: hello.php:117 hello.php:141 +#: hello.php:113 #, php-format -msgid "Hello, %s" +msgid "Hello, %s!" msgstr "" -#: hello.php:138 +#: hello.php:133 msgid "Hello, stranger!" msgstr "" -#: hello.php:143 +#: hello.php:136 +#, php-format +msgid "Hello, %s" +msgstr "" + +#: hello.php:138 #, php-format msgid "I have greeted you %d time." msgid_plural "I have greeted you %d times." |