i18n/L10n updates/fixes.

Translator documentation added/updated.
Whitespace updates.
This commit is contained in:
Siebrand Mazeland
2011-04-06 16:36:35 +02:00
parent 5b660bd3c6
commit 553a0c8b9b
13 changed files with 140 additions and 150 deletions

View File

@@ -42,7 +42,6 @@ if (!defined('STATUSNET')) {
*
* @see DB_DataObject
*/
class Bookmark extends Memcached_DataObject
{
public $__table = 'bookmark'; // table name
@@ -65,7 +64,6 @@ class Bookmark extends Memcached_DataObject
* @return User_greeting_count object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Bookmark', $k, $v);
@@ -83,7 +81,6 @@ class Bookmark extends Memcached_DataObject
* @return Bookmark object found, or null for no hits
*
*/
function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Bookmark', $kv);
@@ -97,7 +94,6 @@ class Bookmark extends Memcached_DataObject
*
* @return array array of column definitions
*/
function table()
{
return array('id' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
@@ -106,7 +102,7 @@ class Bookmark extends Memcached_DataObject
'title' => DB_DATAOBJECT_STR,
'description' => DB_DATAOBJECT_STR,
'uri' => DB_DATAOBJECT_STR,
'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE +
'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE +
DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL);
}
@@ -115,7 +111,6 @@ class Bookmark extends Memcached_DataObject
*
* @return array list of key field names
*/
function keys()
{
return array_keys($this->keyTypes());
@@ -126,7 +121,6 @@ class Bookmark extends Memcached_DataObject
*
* @return array associative array of key definitions
*/
function keyTypes()
{
return array('id' => 'K',
@@ -138,7 +132,6 @@ class Bookmark extends Memcached_DataObject
*
* @return array magic three-false array that stops auto-incrementing.
*/
function sequenceKey()
{
return array(false, false, false);
@@ -146,12 +139,11 @@ class Bookmark extends Memcached_DataObject
/**
* Get a bookmark based on a notice
*
*
* @param Notice $notice Notice to check for
*
* @return Bookmark found bookmark or null
*/
function getByNotice($notice)
{
return self::staticGet('uri', $notice->uri);
@@ -165,11 +157,10 @@ class Bookmark extends Memcached_DataObject
*
* @return Bookmark bookmark found or null
*/
static function getByURL($profile, $url)
{
$nb = new Bookmark();
$nb->profile_id = $profile->id;
$nb->url = $url;
@@ -192,13 +183,13 @@ class Bookmark extends Memcached_DataObject
*
* @return Notice saved notice
*/
static function saveNew($profile, $title, $url, $rawtags, $description,
$options=null)
{
$nb = self::getByURL($profile, $url);
if (!empty($nb)) {
// TRANS: Client exception thrown when trying to save a new bookmark that already exists.
throw new ClientException(_m('Bookmark already exists.'));
}
@@ -209,6 +200,7 @@ class Bookmark extends Memcached_DataObject
if (array_key_exists('uri', $options)) {
$other = Bookmark::staticGet('uri', $options['uri']);
if (!empty($other)) {
// TRANS: Client exception thrown when trying to save a new bookmark that already exists.
throw new ClientException(_m('Bookmark already exists.'));
}
}
@@ -281,15 +273,15 @@ class Bookmark extends Memcached_DataObject
try {
$user = User::staticGet('id', $profile->id);
$shortUrl = File_redirection::makeShort($url,
$shortUrl = File_redirection::makeShort($url,
empty($user) ? null : $user);
} catch (Exception $e) {
// Don't let this stop us.
$shortUrl = $url;
}
// @todo FIXME: i18n documentation.
// TRANS: %1$s is a title, %2$s is a short URL, %3$s is a description,
// TRANS: Bookmark content.
// TRANS: %1$s is a title, %2$s is a short URL, %3$s is the bookmark description,
// TRANS: %4$s is space separated list of hash tags.
$content = sprintf(_m('"%1$s" %2$s %3$s %4$s'),
$title,
@@ -297,6 +289,9 @@ class Bookmark extends Memcached_DataObject
$description,
implode(' ', $hashtags));
// TRANS: Rendered bookmark content.
// TRANS: %1$s is a URL, %2$s the bookmark title, %3$s is the bookmark description,
// TRANS: %4$s is space separated list of hash tags.
$rendered = sprintf(_m('<span class="xfolkentry">'.
'<a class="taggedlink" href="%1$s">%2$s</a> '.
'<span class="description">%3$s</span> '.