summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/DirectionDetector/DirectionDetectorPlugin.php32
-rw-r--r--plugins/DirectionDetector/locale/DirectionDetector.pot6
-rw-r--r--plugins/DirectionDetector/locale/nl/LC_MESSAGES/DirectionDetector.po22
-rw-r--r--plugins/Sample/User_greeting_count.php19
4 files changed, 53 insertions, 26 deletions
diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php
index 34c511e21..b1362b166 100644
--- a/plugins/DirectionDetector/DirectionDetectorPlugin.php
+++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php
@@ -1,5 +1,4 @@
<?php
-
/**
* DirectionDetector plugin, detects notices with RTL content & sets RTL
* style for them.
@@ -29,7 +28,7 @@ if (!defined('STATUSNET')) {
exit(1);
}
-define('DIRECTIONDETECTORPLUGIN_VERSION', '0.1.1');
+define('DIRECTIONDETECTORPLUGIN_VERSION', '0.1.2');
class DirectionDetectorPlugin extends Plugin {
/**
@@ -46,7 +45,7 @@ class DirectionDetectorPlugin extends Plugin {
/**
* SN plugin API, here we will add css needed for modifiyed rendered
*
- * @param
+ * @param
*/
public function onEndShowStatusNetStyles($xml){
$xml->element('style', array('type' => 'text/css'), 'span.rtl {display:block;direction:rtl;text-align:right;float:right;width:490px;} .notice .author {float:left}');
@@ -54,7 +53,7 @@ class DirectionDetectorPlugin extends Plugin {
/**
* checks that passed string is a RTL language or not
*
- * @param string $str string to be checked
+ * @param string $str String to be checked
*/
public static function isRTL($str){
self::getClearText($str);
@@ -62,15 +61,15 @@ class DirectionDetectorPlugin extends Plugin {
$cc = $cc[0];
else
return false;
- if($cc>=1536 && $cc<=1791) // arabic, persian, urdu, kurdish, ...
+ if($cc>=1536 && $cc<=1791) // Arabic, Persian, Urdu, Kurdish, ...
return true;
- if($cc>=65136 && $cc<=65279) // arabic peresent 2
+ if($cc>=65136 && $cc<=65279) // Arabic peresent 2
return true;
- if($cc>=64336 && $cc<=65023) // arabic peresent 1
+ if($cc>=64336 && $cc<=65023) // Arabic peresent 1
return true;
- if($cc>=1424 && $cc<=1535) // hebrew
+ if($cc>=1424 && $cc<=1535) // Hebrew
return true;
- if($cc>=64256 && $cc<=64335) // hebrew peresent
+ if($cc>=64256 && $cc<=64335) // Hebrew peresent
return true;
if($cc>=1792 && $cc<=1871) // Syriac
return true;
@@ -84,7 +83,7 @@ class DirectionDetectorPlugin extends Plugin {
}
/**
- * clears text from replys, tags, groups, reteets & whitespaces
+ * clears text from replies, tags, groups, repeats & whitespaces
*
* @param string &$str string to be cleared
*/
@@ -95,9 +94,9 @@ class DirectionDetectorPlugin extends Plugin {
}
/**
- * Takes an UTF-8 string and returns an array of ints representing the
- * Unicode characters. Astral planes are supported ie. the ints in the
- * output can be > 0xFFFF. O$ccurrances of the BOM are ignored. Surrogates
+ * Takes a UTF-8 string and returns an array of ints representing the
+ * Unicode characters. Astral planes are supported i.e. the ints in the
+ * output can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates
* are not allowed. ### modified ### returns first character code
*
* Returns false if the input string isn't a valid UTF-8 octet sequence.
@@ -200,7 +199,7 @@ class DirectionDetectorPlugin extends Plugin {
}
} else {
/* ((0xC0 & (*in) != 0x80) && (mState != 0))
- *
+ *
* Incomplete multi-octet sequence.
*/
return false;
@@ -217,8 +216,9 @@ class DirectionDetectorPlugin extends Plugin {
$versions[] = array(
'name' => 'Direction detector',
'version' => DIRECTIONDETECTORPLUGIN_VERSION,
- 'author' => 'behrooz shabani',
- 'rawdescription' => _m('shows notices with right-to-left content in correct direction.')
+ 'author' => 'Behrooz Shabani',
+ // TRANS: Direction detector plugin description.
+ 'rawdescription' => _m('Shows notices with right-to-left content in correct direction.')
);
return true;
}
diff --git a/plugins/DirectionDetector/locale/DirectionDetector.pot b/plugins/DirectionDetector/locale/DirectionDetector.pot
index ebeda2dc4..44bbcca4d 100644
--- a/plugins/DirectionDetector/locale/DirectionDetector.pot
+++ b/plugins/DirectionDetector/locale/DirectionDetector.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-04-29 23:39+0000\n"
+"POT-Creation-Date: 2010-05-08 22:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,6 +16,6 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: DirectionDetectorPlugin.php:221
-msgid "shows notices with right-to-left content in correct direction."
+#: DirectionDetectorPlugin.php:222
+msgid "Shows notices with right-to-left content in correct direction."
msgstr ""
diff --git a/plugins/DirectionDetector/locale/nl/LC_MESSAGES/DirectionDetector.po b/plugins/DirectionDetector/locale/nl/LC_MESSAGES/DirectionDetector.po
new file mode 100644
index 000000000..e8dae6ea8
--- /dev/null
+++ b/plugins/DirectionDetector/locale/nl/LC_MESSAGES/DirectionDetector.po
@@ -0,0 +1,22 @@
+# Translation of StatusNet plugin DirectionDetector to Dutch
+#
+# Author@translatewiki.net: Siebrand
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-05-08 22:32+0000\n"
+"PO-Revision-Date: 2010-05-08 23:32+0100\n"
+"Last-Translator: Siebrand Mazeland <s.mazeland@xs4all.nl>\n"
+"Language-Team: Dutch\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: DirectionDetectorPlugin.php:222
+msgid "Geeft mededelingen met rechts-naar-linksinhoud weer in de juiste richting."
+msgstr ""
diff --git a/plugins/Sample/User_greeting_count.php b/plugins/Sample/User_greeting_count.php
index d9a59770d..fc0cbd28f 100644
--- a/plugins/Sample/User_greeting_count.php
+++ b/plugins/Sample/User_greeting_count.php
@@ -94,29 +94,34 @@ class User_greeting_count extends Memcached_DataObject
/**
* return key definitions for DB_DataObject
*
- * DB_DataObject needs to know about keys that the table has; this function
- * defines them.
+ * DB_DataObject needs to know about keys that the table has, since it
+ * won't appear in StatusNet's own keys list. In most cases, this will
+ * simply reference your keyTypes() function.
*
- * @return array key definitions
+ * @return array list of key field names
*/
function keys()
{
- return array('user_id' => 'K');
+ return array_keys($this->keyTypes());
}
/**
* return key definitions for Memcached_DataObject
*
* Our caching system uses the same key definitions, but uses a different
- * method to get them.
+ * method to get them. This key information is used to store and clear
+ * cached data, so be sure to list any key that will be used for static
+ * lookups.
*
- * @return array key definitions
+ * @return array associative array of key definitions, field name to type:
+ * '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 $this->keys();
+ return array('user_id' => 'K');
}
/**