aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.php10
-rw-r--r--lib/cache/file.php16
-rw-r--r--lib/db.php453
-rw-r--r--lib/db/adapter.php72
-rw-r--r--lib/db/adapteroci8.php28
-rw-r--r--lib/db/adapterpgsql.php23
-rw-r--r--lib/db/adaptersqlite.php60
-rw-r--r--lib/db/adaptersqlsrv.php28
-rw-r--r--lib/db/connection.php197
-rw-r--r--lib/db/mdb2schemamanager.php (renamed from lib/db/schema.php)92
-rw-r--r--lib/db/mdb2schemareader.php196
-rw-r--r--lib/db/statementwrapper.php4
-rw-r--r--lib/files/cache/cache.php40
-rw-r--r--lib/files/cache/scanner.php17
-rw-r--r--lib/files/type/detection.php121
-rw-r--r--lib/files/type/templatemanager.php46
-rw-r--r--lib/files/utils/scanner.php13
-rw-r--r--lib/group.php2
-rw-r--r--lib/helper.php442
-rw-r--r--lib/image.php2
-rw-r--r--lib/l10n.php173
-rw-r--r--lib/l10n/af_ZA.php11
-rw-r--r--lib/l10n/ar.php15
-rw-r--r--lib/l10n/be.php8
-rw-r--r--lib/l10n/bg_BG.php15
-rw-r--r--lib/l10n/bn_BD.php13
-rw-r--r--lib/l10n/bs.php8
-rw-r--r--lib/l10n/ca.php19
-rw-r--r--lib/l10n/cs_CZ.php49
-rw-r--r--lib/l10n/cy_GB.php15
-rw-r--r--lib/l10n/da.php19
-rw-r--r--lib/l10n/de.php19
-rw-r--r--lib/l10n/de_AT.php8
-rw-r--r--lib/l10n/de_CH.php56
-rw-r--r--lib/l10n/de_DE.php19
-rw-r--r--lib/l10n/el.php19
-rw-r--r--lib/l10n/en@pirate.php10
-rw-r--r--lib/l10n/eo.php15
-rw-r--r--lib/l10n/es.php19
-rw-r--r--lib/l10n/es_AR.php19
-rw-r--r--lib/l10n/et_EE.php19
-rw-r--r--lib/l10n/eu.php19
-rw-r--r--lib/l10n/fa.php15
-rw-r--r--lib/l10n/fi.php4
-rw-r--r--lib/l10n/fi_FI.php16
-rw-r--r--lib/l10n/fr.php15
-rw-r--r--lib/l10n/gl.php19
-rw-r--r--lib/l10n/he.php15
-rw-r--r--lib/l10n/hi.php9
-rw-r--r--lib/l10n/hr.php9
-rw-r--r--lib/l10n/hu_HU.php19
-rw-r--r--lib/l10n/hy.php8
-rw-r--r--lib/l10n/ia.php11
-rw-r--r--lib/l10n/id.php15
-rw-r--r--lib/l10n/is.php15
-rw-r--r--lib/l10n/it.php19
-rw-r--r--lib/l10n/ja_JP.php19
-rw-r--r--lib/l10n/ka.php12
-rw-r--r--lib/l10n/ka_GE.php15
-rw-r--r--lib/l10n/kn.php8
-rw-r--r--lib/l10n/ko.php15
-rw-r--r--lib/l10n/ku_IQ.php11
-rw-r--r--lib/l10n/lb.php11
-rw-r--r--lib/l10n/lt_LT.php15
-rw-r--r--lib/l10n/lv.php15
-rw-r--r--lib/l10n/mk.php15
-rw-r--r--lib/l10n/ml_IN.php8
-rw-r--r--lib/l10n/ms_MY.php11
-rw-r--r--lib/l10n/my_MM.php15
-rw-r--r--lib/l10n/nb_NO.php15
-rw-r--r--lib/l10n/ne.php8
-rw-r--r--lib/l10n/nl.php19
-rw-r--r--lib/l10n/nn_NO.php11
-rw-r--r--lib/l10n/oc.php12
-rw-r--r--lib/l10n/pl.php19
-rw-r--r--lib/l10n/pl_PL.php4
-rw-r--r--lib/l10n/pt_BR.php19
-rw-r--r--lib/l10n/pt_PT.php19
-rw-r--r--lib/l10n/ro.php17
-rw-r--r--lib/l10n/ru.php19
-rw-r--r--lib/l10n/ru_RU.php4
-rw-r--r--lib/l10n/si_LK.php12
-rw-r--r--lib/l10n/sk.php8
-rw-r--r--lib/l10n/sk_SK.php19
-rw-r--r--lib/l10n/sl.php15
-rw-r--r--lib/l10n/sq.php15
-rw-r--r--lib/l10n/sr.php15
-rw-r--r--lib/l10n/sr@latin.php11
-rw-r--r--lib/l10n/string.php39
-rw-r--r--lib/l10n/sv.php19
-rw-r--r--lib/l10n/sw_KE.php8
-rw-r--r--lib/l10n/ta_LK.php15
-rw-r--r--lib/l10n/te.php10
-rw-r--r--lib/l10n/th_TH.php15
-rw-r--r--lib/l10n/tr.php19
-rw-r--r--lib/l10n/ug.php15
-rw-r--r--lib/l10n/uk.php15
-rw-r--r--lib/l10n/ur_PK.php11
-rw-r--r--lib/l10n/vi.php15
-rw-r--r--lib/l10n/zh_CN.GB2312.php13
-rw-r--r--lib/l10n/zh_CN.php15
-rw-r--r--lib/l10n/zh_HK.php11
-rw-r--r--lib/l10n/zh_TW.php15
-rw-r--r--lib/legacy/config.php4
-rw-r--r--lib/log/owncloud.php10
-rw-r--r--lib/log/syslog.php9
-rw-r--r--lib/memcache/apcu.php28
-rw-r--r--lib/memcache/factory.php4
-rw-r--r--lib/migration/content.php2
-rw-r--r--lib/mimetypes.list.php3
-rw-r--r--lib/public/files.php2
-rw-r--r--lib/public/share.php25
-rw-r--r--lib/template/functions.php10
-rw-r--r--lib/user.php1
-rwxr-xr-xlib/util.php18
115 files changed, 2145 insertions, 1255 deletions
diff --git a/lib/app.php b/lib/app.php
index 2437896157a..5fa650044f3 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -401,15 +401,7 @@ class OC_App{
// if the user is an admin
if(OC_User::isAdminUser(OC_User::getUser())) {
- // admin apps menu
- $settings[] = array(
- "id" => "core_apps",
- "order" => 3,
- "href" => OC_Helper::linkToRoute( "settings_apps" ).'?installed',
- "name" => $l->t("Apps"),
- "icon" => OC_Helper::imagePath( "settings", "apps.svg" )
- );
-
+ // admin settings
$settings[]=array(
"id" => "admin",
"order" => 1000,
diff --git a/lib/cache/file.php b/lib/cache/file.php
index 531e1d50f40..ba3dedaf8f3 100644
--- a/lib/cache/file.php
+++ b/lib/cache/file.php
@@ -29,22 +29,30 @@ class OC_Cache_File{
}
public function get($key) {
+ $result = null;
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
if ($this->hasKey($key)) {
$storage = $this->getStorage();
- return $storage->file_get_contents($key);
+ $result = $storage->file_get_contents($key);
}
- return null;
+ \OC_FileProxy::$enabled = $proxyStatus;
+ return $result;
}
public function set($key, $value, $ttl=0) {
$storage = $this->getStorage();
+ $result = false;
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
if ($storage and $storage->file_put_contents($key, $value)) {
if ($ttl === 0) {
$ttl = 86400; // 60*60*24
}
- return $storage->touch($key, time() + $ttl);
+ $result = $storage->touch($key, time() + $ttl);
}
- return false;
+ \OC_FileProxy::$enabled = $proxyStatus;
+ return $result;
}
public function hasKey($key) {
diff --git a/lib/db.php b/lib/db.php
index e70d66fc2ba..ebd012c72f8 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -41,69 +41,25 @@ class DatabaseException extends Exception {
* Doctrine with some adaptions.
*/
class OC_DB {
- const BACKEND_DOCTRINE=2;
-
- static private $preparedQueries = array();
- static private $cachingEnabled = true;
-
- /**
- * @var \Doctrine\DBAL\Connection
- */
- static private $connection; //the preferred connection to use, only Doctrine
- static private $backend=null;
/**
- * @var \Doctrine\DBAL\Connection
+ * @var \OC\DB\Connection $connection
*/
- static private $DOCTRINE=null;
+ static private $connection; //the prefered connection to use, only Doctrine
- static private $inTransaction=false;
static private $prefix=null;
static private $type=null;
/**
- * check which backend we should use
- * @return int BACKEND_DOCTRINE
- */
- private static function getDBBackend() {
- return self::BACKEND_DOCTRINE;
- }
-
- /**
* @brief connects to the database
- * @param int $backend
* @return bool true if connection can be established or false on error
*
* Connects to the database as specified in config.php
*/
- public static function connect($backend=null) {
+ public static function connect() {
if(self::$connection) {
return true;
}
- if(is_null($backend)) {
- $backend=self::getDBBackend();
- }
- if($backend==self::BACKEND_DOCTRINE) {
- $success = self::connectDoctrine();
- self::$connection=self::$DOCTRINE;
- self::$backend=self::BACKEND_DOCTRINE;
- }
- return $success;
- }
- /**
- * connect to the database using doctrine
- *
- * @return bool
- */
- public static function connectDoctrine() {
- if(self::$connection) {
- if(self::$backend!=self::BACKEND_DOCTRINE) {
- self::disconnect();
- } else {
- return true;
- }
- }
- self::$preparedQueries = array();
// The global data we need
$name = OC_Config::getValue( "dbname", "owncloud" );
$host = OC_Config::getValue( "dbhost", "" );
@@ -117,7 +73,7 @@ class OC_DB {
}
// do nothing if the connection already has been established
- if(!self::$DOCTRINE) {
+ if (!self::$connection) {
$config = new \Doctrine\DBAL\Configuration();
switch($type) {
case 'sqlite':
@@ -129,6 +85,7 @@ class OC_DB {
'path' => $datadir.'/'.$name.'.db',
'driver' => 'pdo_sqlite',
);
+ $connectionParams['adapter'] = '\OC\DB\AdapterSqlite';
break;
case 'mysql':
$connectionParams = array(
@@ -140,6 +97,7 @@ class OC_DB {
'charset' => 'UTF8',
'driver' => 'pdo_mysql',
);
+ $connectionParams['adapter'] = '\OC\DB\Adapter';
break;
case 'pgsql':
$connectionParams = array(
@@ -150,6 +108,7 @@ class OC_DB {
'dbname' => $name,
'driver' => 'pdo_pgsql',
);
+ $connectionParams['adapter'] = '\OC\DB\AdapterPgSql';
break;
case 'oci':
$connectionParams = array(
@@ -163,6 +122,7 @@ class OC_DB {
if (!empty($port)) {
$connectionParams['port'] = $port;
}
+ $connectionParams['adapter'] = '\OC\DB\AdapterOCI8';
break;
case 'mssql':
$connectionParams = array(
@@ -174,12 +134,20 @@ class OC_DB {
'charset' => 'UTF8',
'driver' => 'pdo_sqlsrv',
);
+ $connectionParams['adapter'] = '\OC\DB\AdapterSQLSrv';
break;
default:
return false;
}
+ $connectionParams['wrapperClass'] = 'OC\DB\Connection';
+ $connectionParams['tablePrefix'] = OC_Config::getValue('dbtableprefix', 'oc_' );
try {
- self::$DOCTRINE = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
+ self::$connection = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
+ if ($type === 'sqlite' || $type === 'sqlite3') {
+ // Sqlite doesn't handle query caching and schema changes
+ // TODO: find a better way to handle this
+ self::$connection->disableQueryStatementCaching();
+ }
} catch(\Doctrine\DBAL\DBALException $e) {
OC_Log::write('core', $e->getMessage(), OC_Log::FATAL);
OC_User::setUserId(null);
@@ -195,6 +163,24 @@ class OC_DB {
}
/**
+ * @return \OC\DB\Connection
+ */
+ static public function getConnection() {
+ self::connect();
+ return self::$connection;
+ }
+
+ /**
+ * get MDB2 schema manager
+ *
+ * @return \OC\DB\MDB2SchemaManager
+ */
+ private static function getMDB2SchemaManager()
+ {
+ return new \OC\DB\MDB2SchemaManager(self::getConnection());
+ }
+
+ /**
* @brief Prepare a SQL query
* @param string $query Query string
* @param int $limit
@@ -206,25 +192,6 @@ class OC_DB {
* SQL query via Doctrine prepare(), needs to be execute()'d!
*/
static public function prepare( $query , $limit = null, $offset = null, $isManipulation = null) {
-
- if (!is_null($limit) && $limit != -1) {
- if ($limit === -1) {
- $limit = null;
- }
- $platform = self::$connection->getDatabasePlatform();
- $query = $platform->modifyLimitQuery($query, $limit, $offset);
- } else {
- if (isset(self::$preparedQueries[$query]) and self::$cachingEnabled) {
- return self::$preparedQueries[$query];
- }
- }
- $rawQuery = $query;
-
- // Optimize the query
- $query = self::processQuery( $query );
- if(OC_Config::getValue( "log_query", false)) {
- OC_Log::write('core', 'DB prepare : '.$query, OC_Log::DEBUG);
- }
self::connect();
if ($isManipulation === null) {
@@ -233,45 +200,38 @@ class OC_DB {
}
// return the result
- if (self::$backend == self::BACKEND_DOCTRINE) {
- try {
- $result=self::$connection->prepare($query);
- } catch(\Doctrine\DBAL\DBALException $e) {
- throw new \DatabaseException($e->getMessage(), $query);
- }
- // differentiate between query and manipulation
- $result=new OC_DB_StatementWrapper($result, $isManipulation);
- }
- if ((is_null($limit) || $limit == -1) and self::$cachingEnabled ) {
- $type = OC_Config::getValue( "dbtype", "sqlite" );
- if( $type != 'sqlite' && $type != 'sqlite3' ) {
- self::$preparedQueries[$rawQuery] = $result;
- }
+ try {
+ $result = self::$connection->prepare($query, $limit, $offset);
+ } catch (\Doctrine\DBAL\DBALException $e) {
+ throw new \DatabaseException($e->getMessage(), $query);
}
+ // differentiate between query and manipulation
+ $result = new OC_DB_StatementWrapper($result, $isManipulation);
return $result;
}
-
+
/**
* tries to guess the type of statement based on the first 10 characters
* the current check allows some whitespace but does not work with IF EXISTS or other more complex statements
*
* @param string $sql
+ * @return bool
*/
static public function isManipulation( $sql ) {
- $selectOccurence = stripos ($sql, "SELECT");
- if ($selectOccurence !== false && $selectOccurence < 10) {
+ $selectOccurrence = stripos($sql, 'SELECT');
+ if ($selectOccurrence !== false && $selectOccurrence < 10) {
return false;
}
- $insertOccurence = stripos ($sql, "INSERT");
- if ($insertOccurence !== false && $insertOccurence < 10) {
+ $insertOccurrence = stripos($sql, 'INSERT');
+ if ($insertOccurrence !== false && $insertOccurrence < 10) {
return true;
}
- $updateOccurence = stripos ($sql, "UPDATE");
- if ($updateOccurence !== false && $updateOccurence < 10) {
+ $updateOccurrence = stripos($sql, 'UPDATE');
+ if ($updateOccurrence !== false && $updateOccurrence < 10) {
return true;
}
- $deleteOccurance = stripos ($sql, "DELETE");
- if ($deleteOccurance !== false && $deleteOccurance < 10) {
+ $deleteOccurrence = stripos($sql, 'DELETE');
+ if ($deleteOccurrence !== false && $deleteOccurrence < 10) {
return true;
}
return false;
@@ -289,7 +249,7 @@ class OC_DB {
static public function executeAudited( $stmt, array $parameters = null) {
if (is_string($stmt)) {
// convert to an array with 'sql'
- if (stripos($stmt,'LIMIT') !== false) { //OFFSET requires LIMIT, se we only neet to check for LIMIT
+ if (stripos($stmt, 'LIMIT') !== false) { //OFFSET requires LIMIT, so we only need to check for LIMIT
// TODO try to convert LIMIT OFFSET notation to parameters, see fixLimitClauseForMSSQL
$message = 'LIMIT and OFFSET are forbidden for portability reasons,'
. ' pass an array with \'limit\' and \'offset\' instead';
@@ -297,7 +257,7 @@ class OC_DB {
}
$stmt = array('sql' => $stmt, 'limit' => null, 'offset' => null);
}
- if (is_array($stmt)){
+ if (is_array($stmt)) {
// convert to prepared statement
if ( ! array_key_exists('sql', $stmt) ) {
$message = 'statement array must at least contain key \'sql\'';
@@ -339,65 +299,59 @@ class OC_DB {
*/
public static function insertid($table=null) {
self::connect();
- $type = OC_Config::getValue( "dbtype", "sqlite" );
- if( $type === 'pgsql' ) {
- $result = self::executeAudited('SELECT lastval() AS id');
- $row = $result->fetchRow();
- self::raiseExceptionOnError($row, 'fetching row for insertid failed');
- return $row['id'];
- } else if( $type === 'mssql') {
- if($table !== null) {
- $prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
- $table = str_replace( '*PREFIX*', $prefix, $table );
- }
- return self::$connection->lastInsertId($table);
- }
- if( $type === 'oci' ) {
- if($table !== null) {
- $prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
- $suffix = '_SEQ';
- $table = '"'.str_replace( '*PREFIX*', $prefix, $table ).$suffix.'"';
- }
- return self::$connection->lastInsertId($table);
- } else {
- if($table !== null) {
- $prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
- $suffix = OC_Config::getValue( "dbsequencesuffix", "_id_seq" );
- $table = str_replace( '*PREFIX*', $prefix, $table ).$suffix;
- }
- $result = self::$connection->lastInsertId($table);
- }
- self::raiseExceptionOnError($result, 'insertid failed');
- return $result;
+ return self::$connection->lastInsertId($table);
+ }
+
+ /**
+ * @brief Insert a row if a matching row doesn't exists.
+ * @param string $table. The table to insert into in the form '*PREFIX*tableName'
+ * @param array $input. An array of fieldname/value pairs
+ * @return int number of updated rows
+ */
+ public static function insertIfNotExist($table, $input) {
+ self::connect();
+ return self::$connection->insertIfNotExist($table, $input);
+ }
+
+ /**
+ * Start a transaction
+ */
+ public static function beginTransaction() {
+ self::connect();
+ self::$connection->beginTransaction();
+ }
+
+ /**
+ * Commit the database changes done during a transaction that is in progress
+ */
+ public static function commit() {
+ self::connect();
+ self::$connection->commit();
}
/**
* @brief Disconnect
- * @return bool
*
* This is good bye, good bye, yeah!
*/
public static function disconnect() {
// Cut connection if required
if(self::$connection) {
- self::$connection=false;
- self::$DOCTRINE=false;
+ self::$connection->close();
}
-
- return true;
}
- /** else {
- * @brief saves database scheme to xml file
+ /**
+ * @brief saves database schema to xml file
* @param string $file name of file
* @param int $mode
* @return bool
*
* TODO: write more documentation
*/
- public static function getDbStructure( $file, $mode=MDB2_SCHEMA_DUMP_STRUCTURE) {
- self::connectDoctrine();
- return OC_DB_Schema::getDbStructure(self::$DOCTRINE, $file);
+ public static function getDbStructure( $file, $mode = 0) {
+ $schemaManager = self::getMDB2SchemaManager();
+ return $schemaManager->getDbStructure($file);
}
/**
@@ -408,20 +362,21 @@ class OC_DB {
* TODO: write more documentation
*/
public static function createDbFromStructure( $file ) {
- self::connectDoctrine();
- return OC_DB_Schema::createDbFromStructure(self::$DOCTRINE, $file);
+ $schemaManager = self::getMDB2SchemaManager();
+ $result = $schemaManager->createDbFromStructure($file);
+ return $result;
}
/**
- * @brief update the database scheme
+ * @brief update the database schema
* @param string $file file to read structure from
* @throws Exception
* @return bool
*/
public static function updateDbFromStructure($file) {
- self::connectDoctrine();
+ $schemaManager = self::getMDB2SchemaManager();
try {
- $result = OC_DB_Schema::updateDbFromStructure(self::$DOCTRINE, $file);
+ $result = $schemaManager->updateDbFromStructure($file);
} catch (Exception $e) {
OC_Log::write('core', 'Failed to update database structure ('.$e.')', OC_Log::FATAL);
throw $e;
@@ -430,178 +385,12 @@ class OC_DB {
}
/**
- * @brief Insert a row if a matching row doesn't exists.
- * @param string $table. The table to insert into in the form '*PREFIX*tableName'
- * @param array $input. An array of fieldname/value pairs
- * @returns int number of updated rows
- */
- public static function insertIfNotExist($table, $input) {
- self::connect();
- $prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
- $table = str_replace( '*PREFIX*', $prefix, $table );
-
- if(is_null(self::$type)) {
- self::$type=OC_Config::getValue( "dbtype", "sqlite" );
- }
- $type = self::$type;
-
- $query = '';
- $inserts = array_values($input);
- // differences in escaping of table names ('`' for mysql) and getting the current timestamp
- if( $type == 'sqlite' || $type == 'sqlite3' ) {
- // NOTE: For SQLite we have to use this clumsy approach
- // otherwise all fieldnames used must have a unique key.
- $query = 'SELECT * FROM `' . $table . '` WHERE ';
- foreach($input as $key => $value) {
- $query .= '`' . $key . '` = ? AND ';
- }
- $query = substr($query, 0, strlen($query) - 5);
- try {
- $result = self::executeAudited($query, $inserts);
- } catch(DatabaseException $e) {
- OC_Template::printExceptionErrorPage( $e );
- }
-
- if((int)$result->numRows() === 0) {
- $query = 'INSERT INTO `' . $table . '` (`'
- . implode('`,`', array_keys($input)) . '`) VALUES('
- . str_repeat('?,', count($input)-1).'? ' . ')';
- } else {
- return 0; //no rows updated
- }
- } elseif( $type == 'pgsql' || $type == 'oci' || $type == 'mysql' || $type == 'mssql') {
- $query = 'INSERT INTO `' .$table . '` (`'
- . implode('`,`', array_keys($input)) . '`) SELECT '
- . str_repeat('?,', count($input)-1).'? ' // Is there a prettier alternative?
- . 'FROM `' . $table . '` WHERE ';
-
- foreach($input as $key => $value) {
- $query .= '`' . $key . '` = ? AND ';
- }
- $query = substr($query, 0, strlen($query) - 5);
- $query .= ' HAVING COUNT(*) = 0';
- $inserts = array_merge($inserts, $inserts);
- }
-
- try {
- $result = self::executeAudited($query, $inserts);
- } catch(\Doctrine\DBAL\DBALException $e) {
- OC_Template::printExceptionErrorPage( $e );
- }
-
- return $result;
- }
-
- /**
- * @brief does minor changes to query
- * @param string $query Query string
- * @return string corrected query string
- *
- * This function replaces *PREFIX* with the value of $CONFIG_DBTABLEPREFIX
- * and replaces the ` with ' or " according to the database driver.
- */
- private static function processQuery( $query ) {
- self::connect();
- // We need Database type and table prefix
- if(is_null(self::$type)) {
- self::$type=OC_Config::getValue( "dbtype", "sqlite" );
- }
- $type = self::$type;
- if(is_null(self::$prefix)) {
- self::$prefix=OC_Config::getValue( "dbtableprefix", "oc_" );
- }
- $prefix = self::$prefix;
-
- // differences in escaping of table names ('`' for mysql) and getting the current timestamp
- if( $type == 'sqlite' || $type == 'sqlite3' ) {
- $query = str_replace( '`', '"', $query );
- $query = str_ireplace( 'NOW()', 'datetime(\'now\')', $query );
- $query = str_ireplace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $query );
- } elseif( $type == 'pgsql' ) {
- $query = str_replace( '`', '"', $query );
- $query = str_ireplace( 'UNIX_TIMESTAMP()', 'cast(extract(epoch from current_timestamp) as integer)',
- $query );
- } elseif( $type == 'oci' ) {
- $query = str_replace( '`', '"', $query );
- $query = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $query );
- $query = str_ireplace( 'UNIX_TIMESTAMP()', "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400", $query );
- }elseif( $type == 'mssql' ) {
- $query = preg_replace( "/\`(.*?)`/", "[$1]", $query );
- $query = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $query );
- $query = str_replace( 'LENGTH(', 'LEN(', $query );
- $query = str_replace( 'SUBSTR(', 'SUBSTRING(', $query );
- $query = str_ireplace( 'UNIX_TIMESTAMP()', 'DATEDIFF(second,{d \'1970-01-01\'},GETDATE())', $query );
-
- $query = self::fixLimitClauseForMSSQL($query);
- }
-
- // replace table name prefix
- $query = str_replace( '*PREFIX*', $prefix, $query );
-
- return $query;
- }
-
- private static function fixLimitClauseForMSSQL($query) {
- $limitLocation = stripos ($query, "LIMIT");
-
- if ( $limitLocation === false ) {
- return $query;
- }
-
- // total == 0 means all results - not zero results
- //
- // First number is either total or offset, locate it by first space
- //
- $offset = substr ($query, $limitLocation + 5);
- $offset = substr ($offset, 0, stripos ($offset, ' '));
- $offset = trim ($offset);
-
- // check for another parameter
- if (stripos ($offset, ',') === false) {
- // no more parameters
- $offset = 0;
- $total = intval ($offset);
- } else {
- // found another parameter
- $offset = intval ($offset);
-
- $total = substr ($query, $limitLocation + 5);
- $total = substr ($total, stripos ($total, ','));
-
- $total = substr ($total, 0, stripos ($total, ' '));
- $total = intval ($total);
- }
-
- $query = trim (substr ($query, 0, $limitLocation));
-
- if ($offset == 0 && $total !== 0) {
- if (strpos($query, "SELECT") === false) {
- $query = "TOP {$total} " . $query;
- } else {
- $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP '.$total, $query);
- }
- } else if ($offset > 0) {
- $query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP(10000000) ', $query);
- $query = 'SELECT *
- FROM (SELECT sub2.*, ROW_NUMBER() OVER(ORDER BY sub2.line2) AS line3
- FROM (SELECT 1 AS line2, sub1.* FROM (' . $query . ') AS sub1) as sub2) AS sub3';
-
- if ($total > 0) {
- $query .= ' WHERE line3 BETWEEN ' . ($offset + 1) . ' AND ' . ($offset + $total);
- } else {
- $query .= ' WHERE line3 > ' . $offset;
- }
- }
- return $query;
- }
-
- /**
* @brief drop a table
* @param string $tableName the table to drop
*/
public static function dropTable($tableName) {
- self::connectDoctrine();
- OC_DB_Schema::dropTable(self::$DOCTRINE, $tableName);
+ $schemaManager = self::getMDB2SchemaManager();
+ $schemaManager->dropTable($tableName);
}
/**
@@ -609,8 +398,8 @@ class OC_DB {
* @param string $file the xml file describing the tables
*/
public static function removeDBStructure($file) {
- self::connectDoctrine();
- OC_DB_Schema::removeDBStructure(self::$DOCTRINE, $file);
+ $schemaManager = self::getMDB2SchemaManager();
+ $schemaManager->removeDBStructure($file);
}
/**
@@ -618,33 +407,8 @@ class OC_DB {
* @param $file string path to the MDB2 xml db export file
*/
public static function replaceDB( $file ) {
- self::connectDoctrine();
- OC_DB_Schema::replaceDB(self::$DOCTRINE, $file);
- }
-
- /**
- * Start a transaction
- * @return bool
- */
- public static function beginTransaction() {
- self::connect();
- self::$connection->beginTransaction();
- self::$inTransaction=true;
- return true;
- }
-
- /**
- * Commit the database changes done during a transaction that is in progress
- * @return bool
- */
- public static function commit() {
- self::connect();
- if(!self::$inTransaction) {
- return false;
- }
- self::$connection->commit();
- self::$inTransaction=false;
- return true;
+ $schemaManager = self::getMDB2SchemaManager();
+ $schemaManager->replaceDB($file);
}
/**
@@ -685,17 +449,9 @@ class OC_DB {
* @return string
*/
public static function getErrorMessage($error) {
- if (self::$backend==self::BACKEND_DOCTRINE and self::$DOCTRINE) {
- $msg = self::$DOCTRINE->errorCode() . ': ';
- $errorInfo = self::$DOCTRINE->errorInfo();
- if (is_array($errorInfo)) {
- $msg .= 'SQLSTATE = '.$errorInfo[0] . ', ';
- $msg .= 'Driver Code = '.$errorInfo[1] . ', ';
- $msg .= 'Driver Message = '.$errorInfo[2];
- }
- return $msg;
+ if (self::$connection) {
+ return self::$connection->getError();
}
-
return '';
}
@@ -703,9 +459,10 @@ class OC_DB {
* @param bool $enabled
*/
static public function enableCaching($enabled) {
- if (!$enabled) {
- self::$preparedQueries = array();
+ if ($enabled) {
+ self::$connection->enableQueryStatementCaching();
+ } else {
+ self::$connection->disableQueryStatementCaching();
}
- self::$cachingEnabled = $enabled;
}
}
diff --git a/lib/db/adapter.php b/lib/db/adapter.php
new file mode 100644
index 00000000000..6b31f37dd98
--- /dev/null
+++ b/lib/db/adapter.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\DB;
+
+/**
+ * This handles the way we use to write queries, into something that can be
+ * handled by the database abstraction layer.
+ */
+class Adapter {
+
+ /**
+ * @var \OC\DB\Connection $conn
+ */
+ protected $conn;
+
+ public function __construct($conn) {
+ $this->conn = $conn;
+ }
+
+ /**
+ * @param string $table name
+ * @return int id of last insert statement
+ */
+ public function lastInsertId($table) {
+ return $this->conn->realLastInsertId($table);
+ }
+
+ /**
+ * @param string $statement that needs to be changed so the db can handle it
+ * @return string changed statement
+ */
+ public function fixupStatement($statement) {
+ return $statement;
+ }
+
+ /**
+ * @brief insert the @input values when they do not exist yet
+ * @param string $table name
+ * @param array $input key->value pairs
+ * @return int count of inserted rows
+ */
+ public function insertIfNotExist($table, $input) {
+ $query = 'INSERT INTO `' .$table . '` (`'
+ . implode('`,`', array_keys($input)) . '`) SELECT '
+ . str_repeat('?,', count($input)-1).'? ' // Is there a prettier alternative?
+ . 'FROM `' . $table . '` WHERE ';
+
+ foreach($input as $key => $value) {
+ $query .= '`' . $key . '` = ? AND ';
+ }
+ $query = substr($query, 0, strlen($query) - 5);
+ $query .= ' HAVING COUNT(*) = 0';
+ $inserts = array_values($input);
+ $inserts = array_merge($inserts, $inserts);
+
+ try {
+ return $this->conn->executeUpdate($query, $inserts);
+ } catch(\Doctrine\DBAL\DBALException $e) {
+ $entry = 'DB Error: "'.$e->getMessage() . '"<br />';
+ $entry .= 'Offending command was: ' . $query.'<br />';
+ \OC_Log::write('core', $entry, \OC_Log::FATAL);
+ error_log('DB error: ' . $entry);
+ \OC_Template::printErrorPage( $entry );
+ }
+ }
+}
diff --git a/lib/db/adapteroci8.php b/lib/db/adapteroci8.php
new file mode 100644
index 00000000000..bc226e979ec
--- /dev/null
+++ b/lib/db/adapteroci8.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+
+namespace OC\DB;
+
+class AdapterOCI8 extends Adapter {
+ public function lastInsertId($table) {
+ if($table !== null) {
+ $suffix = '_SEQ';
+ $table = '"'.$table.$suffix.'"';
+ }
+ return $this->conn->realLastInsertId($table);
+ }
+
+ const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400";
+ public function fixupStatement($statement) {
+ $statement = str_replace( '`', '"', $statement );
+ $statement = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $statement );
+ $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
+ return $statement;
+ }
+}
diff --git a/lib/db/adapterpgsql.php b/lib/db/adapterpgsql.php
new file mode 100644
index 00000000000..990d71c9f29
--- /dev/null
+++ b/lib/db/adapterpgsql.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+
+namespace OC\DB;
+
+class AdapterPgSql extends Adapter {
+ public function lastInsertId($table) {
+ return $this->conn->fetchColumn('SELECT lastval()');
+ }
+
+ const UNIX_TIMESTAMP_REPLACEMENT = 'cast(extract(epoch from current_timestamp) as integer)';
+ public function fixupStatement($statement) {
+ $statement = str_replace( '`', '"', $statement );
+ $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
+ return $statement;
+ }
+}
diff --git a/lib/db/adaptersqlite.php b/lib/db/adaptersqlite.php
new file mode 100644
index 00000000000..fa6d308ae32
--- /dev/null
+++ b/lib/db/adaptersqlite.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+
+namespace OC\DB;
+
+class AdapterSqlite extends Adapter {
+ public function fixupStatement($statement) {
+ $statement = str_replace( '`', '"', $statement );
+ $statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement );
+ $statement = str_ireplace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $statement );
+ return $statement;
+ }
+
+ public function insertIfNotExist($table, $input) {
+ // NOTE: For SQLite we have to use this clumsy approach
+ // otherwise all fieldnames used must have a unique key.
+ $query = 'SELECT COUNT(*) FROM `' . $table . '` WHERE ';
+ foreach($input as $key => $value) {
+ $query .= '`' . $key . '` = ? AND ';
+ }
+ $query = substr($query, 0, strlen($query) - 5);
+ try {
+ $stmt = $this->conn->prepare($query);
+ $result = $stmt->execute(array_values($input));
+ } catch(\Doctrine\DBAL\DBALException $e) {
+ $entry = 'DB Error: "'.$e->getMessage() . '"<br />';
+ $entry .= 'Offending command was: ' . $query . '<br />';
+ \OC_Log::write('core', $entry, \OC_Log::FATAL);
+ error_log('DB error: '.$entry);
+ \OC_Template::printErrorPage( $entry );
+ }
+
+ if ($stmt->fetchColumn() === '0') {
+ $query = 'INSERT INTO `' . $table . '` (`'
+ . implode('`,`', array_keys($input)) . '`) VALUES('
+ . str_repeat('?,', count($input)-1).'? ' . ')';
+ } else {
+ return 0; //no rows updated
+ }
+
+ try {
+ $statement = $this->conn->prepare($query);
+ $result = $statement->execute(array_values($input));
+ } catch(\Doctrine\DBAL\DBALException $e) {
+ $entry = 'DB Error: "'.$e->getMessage() . '"<br />';
+ $entry .= 'Offending command was: ' . $query.'<br />';
+ \OC_Log::write('core', $entry, \OC_Log::FATAL);
+ error_log('DB error: ' . $entry);
+ \OC_Template::printErrorPage( $entry );
+ }
+
+ return $result;
+ }
+}
diff --git a/lib/db/adaptersqlsrv.php b/lib/db/adaptersqlsrv.php
new file mode 100644
index 00000000000..d0a67af28a7
--- /dev/null
+++ b/lib/db/adaptersqlsrv.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+
+namespace OC\DB;
+
+class AdapterSQLSrv extends Adapter {
+ public function lastInsertId($table) {
+ if($table !== null) {
+ $table = $this->conn->replaceTablePrefix( $table );
+ }
+ return $this->conn->lastInsertId($table);
+ }
+
+ public function fixupStatement($statement) {
+ $statement = preg_replace( "/\`(.*?)`/", "[$1]", $statement );
+ $statement = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $statement );
+ $statement = str_replace( 'LENGTH(', 'LEN(', $statement );
+ $statement = str_replace( 'SUBSTR(', 'SUBSTRING(', $statement );
+ $statement = str_ireplace( 'UNIX_TIMESTAMP()', 'DATEDIFF(second,{d \'1970-01-01\'},GETDATE())', $statement );
+ return $statement;
+ }
+}
diff --git a/lib/db/connection.php b/lib/db/connection.php
new file mode 100644
index 00000000000..2581969dbd0
--- /dev/null
+++ b/lib/db/connection.php
@@ -0,0 +1,197 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\DB;
+use Doctrine\DBAL\Driver;
+use Doctrine\DBAL\Configuration;
+use Doctrine\DBAL\Cache\QueryCacheProfile;
+use Doctrine\Common\EventManager;
+
+class Connection extends \Doctrine\DBAL\Connection {
+ /**
+ * @var string $tablePrefix
+ */
+ protected $tablePrefix;
+
+ /**
+ * @var \OC\DB\Adapter $adapter
+ */
+ protected $adapter;
+
+ /**
+ * @var \Doctrine\DBAL\Driver\Statement[] $preparedQueries
+ */
+ protected $preparedQueries = array();
+
+ protected $cachingQueryStatementEnabled = true;
+
+ /**
+ * Initializes a new instance of the Connection class.
+ *
+ * @param array $params The connection parameters.
+ * @param \Doctrine\DBAL\Driver $driver
+ * @param \Doctrine\DBAL\Configuration $config
+ * @param \Doctrine\Common\EventManager $eventManager
+ * @throws \Exception
+ */
+ public function __construct(array $params, Driver $driver, Configuration $config = null,
+ EventManager $eventManager = null)
+ {
+ if (!isset($params['adapter'])) {
+ throw new \Exception('adapter not set');
+ }
+ if (!isset($params['tablePrefix'])) {
+ throw new \Exception('tablePrefix not set');
+ }
+ parent::__construct($params, $driver, $config, $eventManager);
+ $this->adapter = new $params['adapter']($this);
+ $this->tablePrefix = $params['tablePrefix'];
+ }
+
+ /**
+ * Prepares an SQL statement.
+ *
+ * @param string $statement The SQL statement to prepare.
+ * @param int $limit
+ * @param int $offset
+ * @return \Doctrine\DBAL\Driver\Statement The prepared statement.
+ */
+ public function prepare( $statement, $limit=null, $offset=null ) {
+ if ($limit === -1) {
+ $limit = null;
+ }
+ if (!is_null($limit)) {
+ $platform = $this->getDatabasePlatform();
+ $statement = $platform->modifyLimitQuery($statement, $limit, $offset);
+ } else {
+ if (isset($this->preparedQueries[$statement]) && $this->cachingQueryStatementEnabled) {
+ return $this->preparedQueries[$statement];
+ }
+ $origStatement = $statement;
+ }
+ $statement = $this->replaceTablePrefix($statement);
+ $statement = $this->adapter->fixupStatement($statement);
+
+ if(\OC_Config::getValue( 'log_query', false)) {
+ \OC_Log::write('core', 'DB prepare : '.$statement, \OC_Log::DEBUG);
+ }
+ $result = parent::prepare($statement);
+ if (is_null($limit) && $this->cachingQueryStatementEnabled) {
+ $this->preparedQueries[$origStatement] = $result;
+ }
+ return $result;
+ }
+
+ /**
+ * Executes an, optionally parameterized, SQL query.
+ *
+ * If the query is parameterized, a prepared statement is used.
+ * If an SQLLogger is configured, the execution is logged.
+ *
+ * @param string $query The SQL query to execute.
+ * @param array $params The parameters to bind to the query, if any.
+ * @param array $types The types the previous parameters are in.
+ * @param QueryCacheProfile $qcp
+ * @return \Doctrine\DBAL\Driver\Statement The executed statement.
+ * @internal PERF: Directly prepares a driver statement, not a wrapper.
+ */
+ public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null)
+ {
+ $query = $this->replaceTablePrefix($query);
+ $query = $this->adapter->fixupStatement($query);
+ return parent::executeQuery($query, $params, $types, $qcp);
+ }
+
+ /**
+ * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
+ * and returns the number of affected rows.
+ *
+ * This method supports PDO binding types as well as DBAL mapping types.
+ *
+ * @param string $query The SQL query.
+ * @param array $params The query parameters.
+ * @param array $types The parameter types.
+ * @return integer The number of affected rows.
+ * @internal PERF: Directly prepares a driver statement, not a wrapper.
+ */
+ public function executeUpdate($query, array $params = array(), array $types = array())
+ {
+ $query = $this->replaceTablePrefix($query);
+ $query = $this->adapter->fixupStatement($query);
+ return parent::executeUpdate($query, $params, $types);
+ }
+
+ /**
+ * Returns the ID of the last inserted row, or the last value from a sequence object,
+ * depending on the underlying driver.
+ *
+ * Note: This method may not return a meaningful or consistent result across different drivers,
+ * because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY
+ * columns or sequences.
+ *
+ * @param string $seqName Name of the sequence object from which the ID should be returned.
+ * @return string A string representation of the last inserted ID.
+ */
+ public function lastInsertId($seqName = null)
+ {
+ if ($seqName) {
+ $seqName = $this->replaceTablePrefix($seqName);
+ }
+ return $this->adapter->lastInsertId($seqName);
+ }
+
+ // internal use
+ public function realLastInsertId($seqName = null)
+ {
+ return parent::lastInsertId($seqName);
+ }
+
+ /**
+ * @brief Insert a row if a matching row doesn't exists.
+ * @param string $table. The table to insert into in the form '*PREFIX*tableName'
+ * @param array $input. An array of fieldname/value pairs
+ * @return bool The return value from execute()
+ */
+ public function insertIfNotExist($table, $input) {
+ return $this->adapter->insertIfNotExist($table, $input);
+ }
+
+ /**
+ * returns the error code and message as a string for logging
+ * works with DoctrineException
+ * @return string
+ */
+ public function getError() {
+ $msg = $this->errorCode() . ': ';
+ $errorInfo = $this->errorInfo();
+ if (is_array($errorInfo)) {
+ $msg .= 'SQLSTATE = '.$errorInfo[0] . ', ';
+ $msg .= 'Driver Code = '.$errorInfo[1] . ', ';
+ $msg .= 'Driver Message = '.$errorInfo[2];
+ }
+ return $msg;
+ }
+
+ // internal use
+ /**
+ * @param string $statement
+ * @return string
+ */
+ protected function replaceTablePrefix($statement) {
+ return str_replace( '*PREFIX*', $this->tablePrefix, $statement );
+ }
+
+ public function enableQueryStatementCaching() {
+ $this->cachingQueryStatementEnabled = true;
+ }
+
+ public function disableQueryStatementCaching() {
+ $this->cachingQueryStatementEnabled = false;
+ $this->preparedQueries = array();
+ }
+}
diff --git a/lib/db/schema.php b/lib/db/mdb2schemamanager.php
index fa053c64ef0..8e76f46c78f 100644
--- a/lib/db/schema.php
+++ b/lib/db/mdb2schemamanager.php
@@ -6,20 +6,33 @@
* See the COPYING-README file.
*/
-class OC_DB_Schema {
+namespace OC\DB;
+
+class MDB2SchemaManager {
+ /**
+ * @var \OC\DB\Connection $conn
+ */
+ protected $conn;
+
+ /**
+ * @param \OC\DB\Connection $conn
+ */
+ public function __construct($conn) {
+ $this->conn = $conn;
+ }
+
/**
* @brief saves database scheme to xml file
- * @param \Doctrine\DBAL\Connection $conn
* @param string $file name of file
* @param int|string $mode
* @return bool
*
* TODO: write more documentation
*/
- public static function getDbStructure( $conn, $file, $mode=MDB2_SCHEMA_DUMP_STRUCTURE) {
- $sm = $conn->getSchemaManager();
+ public function getDbStructure( $file, $mode = MDB2_SCHEMA_DUMP_STRUCTURE) {
+ $sm = $this->conn->getSchemaManager();
- return OC_DB_MDB2SchemaWriter::saveSchemaToFile($file, $sm);
+ return \OC_DB_MDB2SchemaWriter::saveSchemaToFile($file, $sm);
}
/**
@@ -29,9 +42,10 @@ class OC_DB_Schema {
*
* TODO: write more documentation
*/
- public static function createDbFromStructure( $conn, $file ) {
- $toSchema = OC_DB_MDB2SchemaReader::loadSchemaFromFile($file, $conn->getDatabasePlatform());
- return self::executeSchemaChange($conn, $toSchema);
+ public function createDbFromStructure( $file ) {
+ $schemaReader = new MDB2SchemaReader(\OC_Config::getObject(), $this->conn->getDatabasePlatform());
+ $toSchema = $schemaReader->loadSchemaFromFile($file);
+ return $this->executeSchemaChange($toSchema);
}
/**
@@ -39,11 +53,12 @@ class OC_DB_Schema {
* @param string $file file to read structure from
* @return bool
*/
- public static function updateDbFromStructure($conn, $file) {
- $sm = $conn->getSchemaManager();
+ public function updateDbFromStructure($file) {
+ $sm = $this->conn->getSchemaManager();
$fromSchema = $sm->createSchema();
- $toSchema = OC_DB_MDB2SchemaReader::loadSchemaFromFile($file, $conn->getDatabasePlatform());
+ $schemaReader = new MDB2SchemaReader(\OC_Config::getObject(), $this->conn->getDatabasePlatform());
+ $toSchema = $schemaReader->loadSchemaFromFile($file);
// remove tables we don't know about
foreach($fromSchema->getTables() as $table) {
@@ -61,76 +76,75 @@ class OC_DB_Schema {
$comparator = new \Doctrine\DBAL\Schema\Comparator();
$schemaDiff = $comparator->compare($fromSchema, $toSchema);
- $platform = $conn->getDatabasePlatform();
+ $platform = $this->conn->getDatabasePlatform();
$tables = $schemaDiff->newTables + $schemaDiff->changedTables + $schemaDiff->removedTables;
foreach($tables as $tableDiff) {
$tableDiff->name = $platform->quoteIdentifier($tableDiff->name);
}
-
- //$from = $fromSchema->toSql($conn->getDatabasePlatform());
- //$to = $toSchema->toSql($conn->getDatabasePlatform());
- //echo($from[9]);
- //echo '<br>';
- //echo($to[9]);
- //var_dump($from, $to);
- return self::executeSchemaChange($conn, $schemaDiff);
+ return $this->executeSchemaChange($schemaDiff);
}
/**
* @brief drop a table
* @param string $tableName the table to drop
*/
- public static function dropTable($conn, $tableName) {
- $sm = $conn->getSchemaManager();
+ public function dropTable($tableName) {
+ $sm = $this->conn->getSchemaManager();
$fromSchema = $sm->createSchema();
$toSchema = clone $fromSchema;
$toSchema->dropTable($tableName);
- $sql = $fromSchema->getMigrateToSql($toSchema, $conn->getDatabasePlatform());
- $conn->execute($sql);
+ $sql = $fromSchema->getMigrateToSql($toSchema, $this->conn->getDatabasePlatform());
+ $this->conn->executeQuery($sql);
}
/**
* remove all tables defined in a database structure xml file
* @param string $file the xml file describing the tables
*/
- public static function removeDBStructure($conn, $file) {
- $fromSchema = OC_DB_MDB2SchemaReader::loadSchemaFromFile($file, $conn->getDatabasePlatform());
+ public function removeDBStructure($file) {
+ $schemaReader = new MDB2SchemaReader(\OC_Config::getObject(), $this->conn->getDatabasePlatform());
+ $fromSchema = $schemaReader->loadSchemaFromFile($file);
$toSchema = clone $fromSchema;
foreach($toSchema->getTables() as $table) {
$toSchema->dropTable($table->getName());
}
$comparator = new \Doctrine\DBAL\Schema\Comparator();
$schemaDiff = $comparator->compare($fromSchema, $toSchema);
- self::executeSchemaChange($conn, $schemaDiff);
+ $this->executeSchemaChange($schemaDiff);
}
/**
* @brief replaces the ownCloud tables with a new set
* @param $file string path to the MDB2 xml db export file
*/
- public static function replaceDB( $conn, $file ) {
- $apps = OC_App::getAllApps();
- self::beginTransaction();
+ public function replaceDB( $file ) {
+ $apps = \OC_App::getAllApps();
+ $this->conn->beginTransaction();
// Delete the old tables
- self::removeDBStructure( $conn, OC::$SERVERROOT . '/db_structure.xml' );
+ $this->removeDBStructure( \OC::$SERVERROOT . '/db_structure.xml' );
foreach($apps as $app) {
- $path = OC_App::getAppPath($app).'/appinfo/database.xml';
+ $path = \OC_App::getAppPath($app).'/appinfo/database.xml';
if(file_exists($path)) {
- self::removeDBStructure( $conn, $path );
+ $this->removeDBStructure( $path );
}
}
// Create new tables
- self::commit();
+ $this->conn->commit();
}
- private static function executeSchemaChange($conn, $schema) {
- $conn->beginTransaction();
- foreach($schema->toSql($conn->getDatabasePlatform()) as $sql) {
- $conn->query($sql);
+ /**
+ * @param \Doctrine\DBAL\Schema\Schema $schema
+ * @return bool
+ */
+ private function executeSchemaChange($schema) {
+ $this->conn->beginTransaction();
+ foreach($schema->toSql($this->conn->getDatabasePlatform()) as $sql) {
+ $this->conn->query($sql);
}
- $conn->commit();
+ $this->conn->commit();
+ return true;
}
}
diff --git a/lib/db/mdb2schemareader.php b/lib/db/mdb2schemareader.php
index 0ead9528c93..b7128a2f176 100644
--- a/lib/db/mdb2schemareader.php
+++ b/lib/db/mdb2schemareader.php
@@ -6,35 +6,57 @@
* See the COPYING-README file.
*/
-class OC_DB_MDB2SchemaReader {
- static protected $DBNAME;
- static protected $DBTABLEPREFIX;
- static protected $platform;
+namespace OC\DB;
+class MDB2SchemaReader {
/**
- * @param $file
- * @param $platform
+ * @var string $DBNAME
+ */
+ protected $DBNAME;
+
+ /**
+ * @var string $DBTABLEPREFIX
+ */
+ protected $DBTABLEPREFIX;
+
+ /**
+ * @var \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ */
+ protected $platform;
+
+ /**
+ * @param \OC\Config $config
+ * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
+ */
+ public function __construct($config, $platform) {
+ $this->platform = $platform;
+ $this->DBNAME = $config->getValue('dbname', 'owncloud');
+ $this->DBTABLEPREFIX = $config->getValue('dbtableprefix', 'oc_');
+ }
+
+ /**
+ * @param string $file
* @return \Doctrine\DBAL\Schema\Schema
- * @throws DomainException
+ * @throws \DomainException
*/
- public static function loadSchemaFromFile($file, $platform) {
- self::$DBNAME = OC_Config::getValue( "dbname", "owncloud" );
- self::$DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" );
- self::$platform = $platform;
+ public function loadSchemaFromFile($file) {
$schema = new \Doctrine\DBAL\Schema\Schema();
$xml = simplexml_load_file($file);
- foreach($xml->children() as $child) {
- switch($child->getName()) {
+ foreach ($xml->children() as $child) {
+ /**
+ * @var \SimpleXMLElement $child
+ */
+ switch ($child->getName()) {
case 'name':
case 'create':
case 'overwrite':
case 'charset':
break;
case 'table':
- self::loadTable($schema, $child);
+ $this->loadTable($schema, $child);
break;
default:
- throw new DomainException('Unknown element: '.$child->getName());
+ throw new \DomainException('Unknown element: ' . $child->getName());
}
}
@@ -43,16 +65,20 @@ class OC_DB_MDB2SchemaReader {
/**
* @param\Doctrine\DBAL\Schema\Schema $schema
- * @param $xml
- * @throws DomainException
+ * @param \SimpleXMLElement $xml
+ * @throws \DomainException
*/
- private static function loadTable($schema, $xml) {
- foreach($xml->children() as $child) {
- switch($child->getName()) {
+ private function loadTable($schema, $xml) {
+ $table = null;
+ foreach ($xml->children() as $child) {
+ /**
+ * @var \SimpleXMLElement $child
+ */
+ switch ($child->getName()) {
case 'name':
$name = (string)$child;
- $name = str_replace( '*dbprefix*', self::$DBTABLEPREFIX, $name );
- $name = self::$platform->quoteIdentifier($name);
+ $name = str_replace('*dbprefix*', $this->DBTABLEPREFIX, $name);
+ $name = $this->platform->quoteIdentifier($name);
$table = $schema->createTable($name);
break;
case 'create':
@@ -60,10 +86,13 @@ class OC_DB_MDB2SchemaReader {
case 'charset':
break;
case 'declaration':
- self::loadDeclaration($table, $child);
+ if (is_null($table)) {
+ throw new \DomainException('Table declaration before table name');
+ }
+ $this->loadDeclaration($table, $child);
break;
default:
- throw new DomainException('Unknown element: '.$child->getName());
+ throw new \DomainException('Unknown element: ' . $child->getName());
}
}
@@ -71,36 +100,47 @@ class OC_DB_MDB2SchemaReader {
/**
* @param \Doctrine\DBAL\Schema\Table $table
- * @param $xml
- * @throws DomainException
+ * @param \SimpleXMLElement $xml
+ * @throws \DomainException
*/
- private static function loadDeclaration($table, $xml) {
- foreach($xml->children() as $child) {
- switch($child->getName()) {
+ private function loadDeclaration($table, $xml) {
+ foreach ($xml->children() as $child) {
+ /**
+ * @var \SimpleXMLElement $child
+ */
+ switch ($child->getName()) {
case 'field':
- self::loadField($table, $child);
+ $this->loadField($table, $child);
break;
case 'index':
- self::loadIndex($table, $child);
+ $this->loadIndex($table, $child);
break;
default:
- throw new DomainException('Unknown element: '.$child->getName());
+ throw new \DomainException('Unknown element: ' . $child->getName());
}
}
}
- private static function loadField($table, $xml) {
+ /**
+ * @param \Doctrine\DBAL\Schema\Table $table
+ * @param \SimpleXMLElement $xml
+ * @throws \DomainException
+ */
+ private function loadField($table, $xml) {
$options = array();
- foreach($xml->children() as $child) {
- switch($child->getName()) {
+ foreach ($xml->children() as $child) {
+ /**
+ * @var \SimpleXMLElement $child
+ */
+ switch ($child->getName()) {
case 'name':
$name = (string)$child;
- $name = self::$platform->quoteIdentifier($name);
+ $name = $this->platform->quoteIdentifier($name);
break;
case 'type':
$type = (string)$child;
- switch($type) {
+ switch ($type) {
case 'text':
$type = 'string';
break;
@@ -110,8 +150,6 @@ class OC_DB_MDB2SchemaReader {
case 'timestamp':
$type = 'datetime';
break;
- // TODO
- return;
}
break;
case 'length':
@@ -119,15 +157,15 @@ class OC_DB_MDB2SchemaReader {
$options['length'] = $length;
break;
case 'unsigned':
- $unsigned = self::asBool($child);
+ $unsigned = $this->asBool($child);
$options['unsigned'] = $unsigned;
break;
case 'notnull':
- $notnull = self::asBool($child);
+ $notnull = $this->asBool($child);
$options['notnull'] = $notnull;
break;
case 'autoincrement':
- $autoincrement = self::asBool($child);
+ $autoincrement = $this->asBool($child);
$options['autoincrement'] = $autoincrement;
break;
case 'default':
@@ -138,8 +176,12 @@ class OC_DB_MDB2SchemaReader {
$comment = (string)$child;
$options['comment'] = $comment;
break;
+ case 'primary':
+ $primary = $this->asBool($child);
+ $options['primary'] = $primary;
+ break;
default:
- throw new DomainException('Unknown element: '.$child->getName());
+ throw new \DomainException('Unknown element: ' . $child->getName());
}
}
@@ -153,22 +195,30 @@ class OC_DB_MDB2SchemaReader {
}
if ($type == 'integer') {
$options['default'] = 0;
+ } elseif ($type == 'boolean') {
+ $options['default'] = false;
}
if (!empty($options['autoincrement']) && $options['autoincrement']) {
unset($options['default']);
}
}
- if ($type == 'integer' && isset($options['length'])) {
+ if ($type === 'integer' && isset($options['default'])) {
+ $options['default'] = (int)$options['default'];
+ }
+ if ($type === 'integer' && isset($options['length'])) {
$length = $options['length'];
if ($length < 4) {
$type = 'smallint';
- }
- else if ($length > 4) {
+ } else if ($length > 4) {
$type = 'bigint';
}
}
+ if ($type === 'boolean' && isset($options['default'])) {
+ $options['default'] = $this->asBool($options['default']);
+ }
if (!empty($options['autoincrement'])
- && !empty($options['notnull'])) {
+ && !empty($options['notnull'])
+ ) {
$options['primary'] = true;
}
$table->addColumn($name, $type, $options);
@@ -178,38 +228,49 @@ class OC_DB_MDB2SchemaReader {
}
}
- private static function loadIndex($table, $xml) {
+ /**
+ * @param \Doctrine\DBAL\Schema\Table $table
+ * @param \SimpleXMLElement $xml
+ * @throws \DomainException
+ */
+ private function loadIndex($table, $xml) {
$name = null;
$fields = array();
- foreach($xml->children() as $child) {
- switch($child->getName()) {
+ foreach ($xml->children() as $child) {
+ /**
+ * @var \SimpleXMLElement $child
+ */
+ switch ($child->getName()) {
case 'name':
$name = (string)$child;
break;
case 'primary':
- $primary = self::asBool($child);
+ $primary = $this->asBool($child);
break;
case 'unique':
- $unique = self::asBool($child);
+ $unique = $this->asBool($child);
break;
case 'field':
- foreach($child->children() as $field) {
- switch($field->getName()) {
+ foreach ($child->children() as $field) {
+ /**
+ * @var \SimpleXMLElement $field
+ */
+ switch ($field->getName()) {
case 'name':
$field_name = (string)$field;
- $field_name = self::$platform->quoteIdentifier($field_name);
+ $field_name = $this->platform->quoteIdentifier($field_name);
$fields[] = $field_name;
break;
case 'sorting':
break;
default:
- throw new DomainException('Unknown element: '.$field->getName());
+ throw new \DomainException('Unknown element: ' . $field->getName());
}
}
break;
default:
- throw new DomainException('Unknown element: '.$child->getName());
+ throw new \DomainException('Unknown element: ' . $child->getName());
}
}
@@ -217,22 +278,25 @@ class OC_DB_MDB2SchemaReader {
if (isset($primary) && $primary) {
$table->setPrimaryKey($fields, $name);
} else
- if (isset($unique) && $unique) {
- $table->addUniqueIndex($fields, $name);
- } else {
- $table->addIndex($fields, $name);
- }
+ if (isset($unique) && $unique) {
+ $table->addUniqueIndex($fields, $name);
+ } else {
+ $table->addIndex($fields, $name);
+ }
} else {
- throw new DomainException('Empty index definition: '.$name.' options:'. print_r($fields, true));
+ throw new \DomainException('Empty index definition: ' . $name . ' options:' . print_r($fields, true));
}
}
- private static function asBool($xml) {
+ /**
+ * @param \SimpleXMLElement | string $xml
+ * @return bool
+ */
+ private function asBool($xml) {
$result = (string)$xml;
if ($result == 'true') {
$result = true;
- } else
- if ($result == 'false') {
+ } elseif ($result == 'false') {
$result = false;
}
return (bool)$result;
diff --git a/lib/db/statementwrapper.php b/lib/db/statementwrapper.php
index f7bc45e068f..b8da1afc0e5 100644
--- a/lib/db/statementwrapper.php
+++ b/lib/db/statementwrapper.php
@@ -53,7 +53,7 @@ class OC_DB_StatementWrapper {
*/
public function execute($input=array()) {
if(OC_Config::getValue( "log_query", false)) {
- $params_str = str_replace("\n"," ",var_export($input,true));
+ $params_str = str_replace("\n", " ", var_export($input, true));
OC_Log::write('core', 'DB execute with arguments : '.$params_str, OC_Log::DEBUG);
}
$this->lastArguments = $input;
@@ -134,7 +134,7 @@ class OC_DB_StatementWrapper {
$host = OC_Config::getValue( "dbhost", "" );
$user = OC_Config::getValue( "dbuser", "" );
$pass = OC_Config::getValue( "dbpassword", "" );
- if (strpos($host,':')) {
+ if (strpos($host, ':')) {
list($host, $port) = explode(':', $host, 2);
} else {
$port = false;
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 3818fdbd840..39e36684b7b 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -200,7 +200,7 @@ class Cache {
$data['path'] = $file;
$data['parent'] = $this->getParentId($file);
- $data['name'] = basename($file);
+ $data['name'] = \OC_Util::basename($file);
$data['encrypted'] = isset($data['encrypted']) ? ((int)$data['encrypted']) : 0;
list($queryParts, $params) = $this->buildParts($data);
@@ -485,28 +485,28 @@ class Cache {
* @return int
*/
public function calculateFolderSize($path) {
- $id = $this->getId($path);
- if ($id === -1) {
- return 0;
- }
- $sql = 'SELECT `size` FROM `*PREFIX*filecache` WHERE `parent` = ? AND `storage` = ?';
- $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
$totalSize = 0;
- $hasChilds = 0;
- while ($row = $result->fetchRow()) {
- $hasChilds = true;
- $size = (int)$row['size'];
- if ($size === -1) {
- $totalSize = -1;
- break;
- } else {
- $totalSize += $size;
+ $entry = $this->get($path);
+ if ($entry && $entry['mimetype'] === 'httpd/unix-directory') {
+ $id = $entry['fileid'];
+ $sql = 'SELECT SUM(`size`), MIN(`size`) FROM `*PREFIX*filecache` '.
+ 'WHERE `parent` = ? AND `storage` = ?';
+ $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
+ if ($row = $result->fetchRow()) {
+ list($sum, $min) = array_values($row);
+ $sum = (int)$sum;
+ $min = (int)$min;
+ if ($min === -1) {
+ $totalSize = $min;
+ } else {
+ $totalSize = $sum;
+ }
+ if ($entry['size'] !== $totalSize) {
+ $this->update($id, array('size' => $totalSize));
+ }
+
}
}
-
- if ($hasChilds) {
- $this->update($id, array('size' => $totalSize));
- }
return $totalSize;
}
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index bcd6032fcac..597eabecf54 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -75,9 +75,10 @@ class Scanner extends BasicEmitter {
*
* @param string $file
* @param int $reuseExisting
+ * @param bool $parentExistsInCache
* @return array with metadata of the scanned file
*/
- public function scanFile($file, $reuseExisting = 0) {
+ public function scanFile($file, $reuseExisting = 0, $parentExistsInCache = false) {
if (!self::isPartialFile($file)
and !Filesystem::isFileBlacklisted($file)
) {
@@ -85,7 +86,7 @@ class Scanner extends BasicEmitter {
\OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId));
$data = $this->getData($file);
if ($data) {
- if ($file) {
+ if ($file and !$parentExistsInCache) {
$parent = dirname($file);
if ($parent === '.' or $parent === '/') {
$parent = '';
@@ -97,7 +98,7 @@ class Scanner extends BasicEmitter {
$newData = $data;
if ($reuseExisting and $cacheData = $this->cache->get($file)) {
// only reuse data if the file hasn't explicitly changed
- if ($data['mtime'] === $cacheData['mtime']) {
+ if (isset($data['mtime']) && isset($cacheData['mtime']) && $data['mtime'] === $cacheData['mtime']) {
if (($reuseExisting & self::REUSE_SIZE) && ($data['size'] === -1)) {
$data['size'] = $cacheData['size'];
}
@@ -108,9 +109,9 @@ class Scanner extends BasicEmitter {
// Only update metadata that has changed
$newData = array_diff($data, $cacheData);
}
- }
- if (!empty($newData)) {
- $this->cache->put($file, $newData);
+ if (!empty($newData)) {
+ $this->cache->put($file, $newData);
+ }
}
return $data;
}
@@ -162,7 +163,7 @@ class Scanner extends BasicEmitter {
$child = ($path) ? $path . '/' . $file : $file;
if (!Filesystem::isIgnoredDir($file)) {
$newChildren[] = $file;
- $data = $this->scanFile($child, $reuse);
+ $data = $this->scanFile($child, $reuse, true);
if ($data) {
if ($data['size'] === -1) {
if ($recursive === self::SCAN_RECURSIVE) {
@@ -183,7 +184,7 @@ class Scanner extends BasicEmitter {
}
\OC_DB::commit();
foreach ($childQueue as $child) {
- $childSize = $this->scanChildren($child, self::SCAN_RECURSIVE);
+ $childSize = $this->scanChildren($child, self::SCAN_RECURSIVE, $reuse);
if ($childSize === -1) {
$size = -1;
} else {
diff --git a/lib/files/type/detection.php b/lib/files/type/detection.php
new file mode 100644
index 00000000000..242a81cb5a4
--- /dev/null
+++ b/lib/files/type/detection.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Files\Type;
+
+/**
+ * Class Detection
+ *
+ * Mimetype detection
+ *
+ * @package OC\Files\Type
+ */
+class Detection {
+ protected $mimetypes = array();
+
+ /**
+ * add an extension -> mimetype mapping
+ *
+ * @param string $extension
+ * @param string $mimetype
+ */
+ public function registerType($extension, $mimetype) {
+ $this->mimetypes[$extension] = $mimetype;
+ }
+
+ /**
+ * add an array of extension -> mimetype mappings
+ *
+ * @param array $types
+ */
+ public function registerTypeArray($types) {
+ $this->mimetypes = array_merge($this->mimetypes, $types);
+ }
+
+ /**
+ * detect mimetype only based on filename, content of file is not used
+ *
+ * @param string $path
+ * @return string
+ */
+ public function detectPath($path) {
+ if (strpos($path, '.')) {
+ //try to guess the type by the file extension
+ $extension = strtolower(strrchr(basename($path), "."));
+ $extension = substr($extension, 1); //remove leading .
+ return (isset($this->mimetypes[$extension])) ? $this->mimetypes[$extension] : 'application/octet-stream';
+ } else {
+ return 'application/octet-stream';
+ }
+ }
+
+ /**
+ * detect mimetype based on both filename and content
+ *
+ * @param string $path
+ * @return string
+ */
+ public function detect($path) {
+ $isWrapped = (strpos($path, '://') !== false) and (substr($path, 0, 7) === 'file://');
+
+ if (@is_dir($path)) {
+ // directories are easy
+ return "httpd/unix-directory";
+ }
+
+ $mimeType = $this->detectPath($path);
+
+ if ($mimeType === 'application/octet-stream' and function_exists('finfo_open')
+ and function_exists('finfo_file') and $finfo = finfo_open(FILEINFO_MIME)
+ ) {
+ $info = @strtolower(finfo_file($finfo, $path));
+ if ($info) {
+ $mimeType = substr($info, 0, strpos($info, ';'));
+ }
+ finfo_close($finfo);
+ }
+ if (!$isWrapped and $mimeType === 'application/octet-stream' && function_exists("mime_content_type")) {
+ // use mime magic extension if available
+ $mimeType = mime_content_type($path);
+ }
+ if (!$isWrapped and $mimeType === 'application/octet-stream' && \OC_Helper::canExecute("file")) {
+ // it looks like we have a 'file' command,
+ // lets see if it does have mime support
+ $path = escapeshellarg($path);
+ $fp = popen("file -b --mime-type $path 2>/dev/null", "r");
+ $reply = fgets($fp);
+ pclose($fp);
+
+ //trim the newline
+ $mimeType = trim($reply);
+
+ }
+ return $mimeType;
+ }
+
+ /**
+ * detect mimetype based on the content of a string
+ *
+ * @param string $data
+ * @return string
+ */
+ public function detectString($data) {
+ if (function_exists('finfo_open') and function_exists('finfo_file')) {
+ $finfo = finfo_open(FILEINFO_MIME);
+ return finfo_buffer($finfo, $data);
+ } else {
+ $tmpFile = \OC_Helper::tmpFile();
+ $fh = fopen($tmpFile, 'wb');
+ fwrite($fh, $data, 8024);
+ fclose($fh);
+ $mime = $this->detect($tmpFile);
+ unset($tmpFile);
+ return $mime;
+ }
+ }
+}
diff --git a/lib/files/type/templatemanager.php b/lib/files/type/templatemanager.php
new file mode 100644
index 00000000000..cd1536d2732
--- /dev/null
+++ b/lib/files/type/templatemanager.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Files\Type;
+
+class TemplateManager {
+ protected $templates = array();
+
+ public function registerTemplate($mimetype, $path) {
+ $this->templates[$mimetype] = $path;
+ }
+
+ /**
+ * get the path of the template for a mimetype
+ *
+ * @param string $mimetype
+ * @return string | null
+ */
+ public function getTemplatePath($mimetype) {
+ if (isset($this->templates[$mimetype])) {
+ return $this->templates[$mimetype];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * get the template content for a mimetype
+ *
+ * @param string $mimetype
+ * @return string
+ */
+ public function getTemplate($mimetype) {
+ $path = $this->getTemplatePath($mimetype);
+ if ($path) {
+ return file_get_contents($path);
+ } else {
+ return '';
+ }
+ }
+}
diff --git a/lib/files/utils/scanner.php b/lib/files/utils/scanner.php
index 800bb649934..f0dc41ffad3 100644
--- a/lib/files/utils/scanner.php
+++ b/lib/files/utils/scanner.php
@@ -8,8 +8,8 @@
namespace OC\Files\Utils;
-use OC\Hooks\BasicEmitter;
use OC\Files\Filesystem;
+use OC\Hooks\PublicEmitter;
/**
* Class Scanner
@@ -20,7 +20,7 @@ use OC\Files\Filesystem;
*
* @package OC\Files\Utils
*/
-class Scanner extends BasicEmitter {
+class Scanner extends PublicEmitter {
/**
* @var string $user
*/
@@ -60,11 +60,12 @@ class Scanner extends BasicEmitter {
*/
protected function attachListener($mount) {
$scanner = $mount->getStorage()->getScanner();
- $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount) {
- $this->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path));
+ $emitter = $this;
+ $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount, $emitter) {
+ $emitter->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path));
});
- $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount) {
- $this->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path));
+ $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount, $emitter) {
+ $emitter->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path));
});
}
diff --git a/lib/group.php b/lib/group.php
index 8fbf5f86418..ba93dc129a1 100644
--- a/lib/group.php
+++ b/lib/group.php
@@ -230,7 +230,7 @@ class OC_Group {
public static function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$group = self::getManager()->get($gid);
if ($group) {
- $users = $group->searchUsers($search . $limit, $offset);
+ $users = $group->searchUsers($search, $limit, $offset);
$userIds = array();
foreach ($users as $user) {
$userIds[] = $user->getUID();
diff --git a/lib/helper.php b/lib/helper.php
index 0d55682bdb0..1024a570e36 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -25,9 +25,10 @@
* Collection of useful functions
*/
class OC_Helper {
- private static $mimetypes=array();
- private static $tmpFiles=array();
+ private static $tmpFiles = array();
private static $mimetypeIcons = array();
+ private static $mimetypeDetector;
+ private static $templateManager;
/**
* @brief Creates an url using a defined route
@@ -39,7 +40,7 @@ class OC_Helper {
*
* Returns a url to the given app and file.
*/
- public static function linkToRoute( $route, $parameters = array() ) {
+ public static function linkToRoute($route, $parameters = array()) {
$urlLinkTo = OC::getRouter()->generate($route, $parameters);
return $urlLinkTo;
}
@@ -49,7 +50,7 @@ class OC_Helper {
* @param string $app app
* @param string $file file
* @param array $args array with param=>value, will be appended to the returned url
- * The value of $args will be urlencoded
+ * The value of $args will be urlencoded
* @return string the url
*
* Returns a url to the given app and file.
@@ -58,29 +59,26 @@ class OC_Helper {
if( $app != '' ) {
$app_path = OC_App::getAppPath($app);
// Check if the app is in the app folder
- if( $app_path && file_exists( $app_path.'/'.$file )) {
- if(substr($file, -3) == 'php' || substr($file, -3) == 'css') {
- $urlLinkTo = OC::$WEBROOT . '/index.php/apps/' . $app;
- $urlLinkTo .= ($file!='index.php') ? '/' . $file : '';
- }else{
- $urlLinkTo = OC_App::getAppWebPath($app) . '/' . $file;
+ if ($app_path && file_exists($app_path . '/' . $file)) {
+ if (substr($file, -3) == 'php' || substr($file, -3) == 'css') {
+ $urlLinkTo = OC::$WEBROOT . '/index.php/apps/' . $app;
+ $urlLinkTo .= ($file != 'index.php') ? '/' . $file : '';
+ } else {
+ $urlLinkTo = OC_App::getAppWebPath($app) . '/' . $file;
}
+ } else {
+ $urlLinkTo = OC::$WEBROOT . '/' . $app . '/' . $file;
}
- else{
- $urlLinkTo = OC::$WEBROOT . '/' . $app . '/' . $file;
- }
- }
- else{
- if( file_exists( OC::$SERVERROOT . '/core/'. $file )) {
- $urlLinkTo = OC::$WEBROOT . '/core/'.$file;
- }
- else{
- $urlLinkTo = OC::$WEBROOT . '/'.$file;
+ } else {
+ if (file_exists(OC::$SERVERROOT . '/core/' . $file)) {
+ $urlLinkTo = OC::$WEBROOT . '/core/' . $file;
+ } else {
+ $urlLinkTo = OC::$WEBROOT . '/' . $file;
}
}
if ($args && $query = http_build_query($args, '', '&')) {
- $urlLinkTo .= '?'.$query;
+ $urlLinkTo .= '?' . $query;
}
return $urlLinkTo;
@@ -91,13 +89,13 @@ class OC_Helper {
* @param string $app app
* @param string $file file
* @param array $args array with param=>value, will be appended to the returned url
- * The value of $args will be urlencoded
+ * The value of $args will be urlencoded
* @return string the url
*
* Returns a absolute url to the given app and file.
*/
- public static function linkToAbsolute( $app, $file, $args = array() ) {
- $urlLinkTo = self::linkTo( $app, $file, $args );
+ public static function linkToAbsolute($app, $file, $args = array()) {
+ $urlLinkTo = self::linkTo($app, $file, $args);
return self::makeURLAbsolute($urlLinkTo);
}
@@ -108,9 +106,8 @@ class OC_Helper {
*
* Returns a absolute url to the given app and file.
*/
- public static function makeURLAbsolute( $url )
- {
- return OC_Request::serverProtocol(). '://' . OC_Request::serverHost() . $url;
+ public static function makeURLAbsolute($url) {
+ return OC_Request::serverProtocol() . '://' . OC_Request::serverHost() . $url;
}
/**
@@ -120,8 +117,8 @@ class OC_Helper {
*
* Returns a url to the given service.
*/
- public static function linkToRemoteBase( $service ) {
- return self::linkTo( '', 'remote.php') . '/' . $service;
+ public static function linkToRemoteBase($service) {
+ return self::linkTo('', 'remote.php') . '/' . $service;
}
/**
@@ -132,9 +129,9 @@ class OC_Helper {
*
* Returns a absolute url to the given service.
*/
- public static function linkToRemote( $service, $add_slash = true ) {
+ public static function linkToRemote($service, $add_slash = true) {
return self::makeURLAbsolute(self::linkToRemoteBase($service))
- . (($add_slash && $service[strlen($service)-1]!='/')?'/':'');
+ . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
}
/**
@@ -146,8 +143,8 @@ class OC_Helper {
* Returns a absolute url to the given service.
*/
public static function linkToPublic($service, $add_slash = false) {
- return self::linkToAbsolute( '', 'public.php') . '?service=' . $service
- . (($add_slash && $service[strlen($service)-1]!='/')?'/':'');
+ return self::linkToAbsolute('', 'public.php') . '?service=' . $service
+ . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
}
/**
@@ -158,25 +155,25 @@ class OC_Helper {
*
* Returns the path to the image.
*/
- public static function imagePath( $app, $image ) {
+ public static function imagePath($app, $image) {
// Read the selected theme from the config file
$theme = OC_Util::getTheme();
// Check if the app is in the app folder
- if( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/img/$image" )) {
- return OC::$WEBROOT."/themes/$theme/apps/$app/img/$image";
- }elseif( file_exists(OC_App::getAppPath($app)."/img/$image" )) {
- return OC_App::getAppWebPath($app)."/img/$image";
- }elseif( !empty( $app ) and file_exists( OC::$SERVERROOT."/themes/$theme/$app/img/$image" )) {
- return OC::$WEBROOT."/themes/$theme/$app/img/$image";
- }elseif( !empty( $app ) and file_exists( OC::$SERVERROOT."/$app/img/$image" )) {
- return OC::$WEBROOT."/$app/img/$image";
- }elseif( file_exists( OC::$SERVERROOT."/themes/$theme/core/img/$image" )) {
- return OC::$WEBROOT."/themes/$theme/core/img/$image";
- }elseif( file_exists( OC::$SERVERROOT."/core/img/$image" )) {
- return OC::$WEBROOT."/core/img/$image";
- }else{
- throw new RuntimeException('image not found: image:'.$image.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
+ if (file_exists(OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) {
+ return OC::$WEBROOT . "/themes/$theme/apps/$app/img/$image";
+ } elseif (file_exists(OC_App::getAppPath($app) . "/img/$image")) {
+ return OC_App::getAppWebPath($app) . "/img/$image";
+ } elseif (!empty($app) and file_exists(OC::$SERVERROOT . "/themes/$theme/$app/img/$image")) {
+ return OC::$WEBROOT . "/themes/$theme/$app/img/$image";
+ } elseif (!empty($app) and file_exists(OC::$SERVERROOT . "/$app/img/$image")) {
+ return OC::$WEBROOT . "/$app/img/$image";
+ } elseif (file_exists(OC::$SERVERROOT . "/themes/$theme/core/img/$image")) {
+ return OC::$WEBROOT . "/themes/$theme/core/img/$image";
+ } elseif (file_exists(OC::$SERVERROOT . "/core/img/$image")) {
+ return OC::$WEBROOT . "/core/img/$image";
+ } else {
+ throw new RuntimeException('image not found: image:' . $image . ' webroot:' . OC::$WEBROOT . ' serverroot:' . OC::$SERVERROOT);
}
}
@@ -197,28 +194,28 @@ class OC_Helper {
}
// Replace slash and backslash with a minus
$icon = str_replace('/', '-', $mimetype);
- $icon = str_replace( '\\', '-', $icon);
+ $icon = str_replace('\\', '-', $icon);
// Is it a dir?
if ($mimetype === 'dir') {
- self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/folder.png';
- return OC::$WEBROOT.'/core/img/filetypes/folder.png';
+ self::$mimetypeIcons[$mimetype] = OC::$WEBROOT . '/core/img/filetypes/folder.png';
+ return OC::$WEBROOT . '/core/img/filetypes/folder.png';
}
// Icon exists?
- if (file_exists(OC::$SERVERROOT.'/core/img/filetypes/'.$icon.'.png')) {
- self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/'.$icon.'.png';
- return OC::$WEBROOT.'/core/img/filetypes/'.$icon.'.png';
+ if (file_exists(OC::$SERVERROOT . '/core/img/filetypes/' . $icon . '.png')) {
+ self::$mimetypeIcons[$mimetype] = OC::$WEBROOT . '/core/img/filetypes/' . $icon . '.png';
+ return OC::$WEBROOT . '/core/img/filetypes/' . $icon . '.png';
}
// Try only the first part of the filetype
$mimePart = substr($icon, 0, strpos($icon, '-'));
- if (file_exists(OC::$SERVERROOT.'/core/img/filetypes/'.$mimePart.'.png')) {
- self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/'.$mimePart.'.png';
- return OC::$WEBROOT.'/core/img/filetypes/'.$mimePart.'.png';
+ if (file_exists(OC::$SERVERROOT . '/core/img/filetypes/' . $mimePart . '.png')) {
+ self::$mimetypeIcons[$mimetype] = OC::$WEBROOT . '/core/img/filetypes/' . $mimePart . '.png';
+ return OC::$WEBROOT . '/core/img/filetypes/' . $mimePart . '.png';
} else {
- self::$mimetypeIcons[$mimetype] = OC::$WEBROOT.'/core/img/filetypes/file.png';
- return OC::$WEBROOT.'/core/img/filetypes/file.png';
+ self::$mimetypeIcons[$mimetype] = OC::$WEBROOT . '/core/img/filetypes/file.png';
+ return OC::$WEBROOT . '/core/img/filetypes/file.png';
}
}
@@ -229,25 +226,25 @@ class OC_Helper {
*
* Makes 2048 to 2 kB.
*/
- public static function humanFileSize( $bytes ) {
- if( $bytes < 0 ) {
+ public static function humanFileSize($bytes) {
+ if ($bytes < 0) {
$l = OC_L10N::get('lib');
- return $l->t("couldn't be determined");
+ return "?";
}
- if( $bytes < 1024 ) {
+ if ($bytes < 1024) {
return "$bytes B";
}
- $bytes = round( $bytes / 1024, 1 );
- if( $bytes < 1024 ) {
+ $bytes = round($bytes / 1024, 1);
+ if ($bytes < 1024) {
return "$bytes kB";
}
- $bytes = round( $bytes / 1024, 1 );
- if( $bytes < 1024 ) {
+ $bytes = round($bytes / 1024, 1);
+ if ($bytes < 1024) {
return "$bytes MB";
}
// Wow, heavy duty for owncloud
- $bytes = round( $bytes / 1024, 1 );
+ $bytes = round($bytes / 1024, 1);
return "$bytes GB";
}
@@ -260,21 +257,21 @@ class OC_Helper {
*
* Inspired by: http://www.php.net/manual/en/function.filesize.php#92418
*/
- public static function computerFileSize( $str ) {
- $str=strtolower($str);
+ public static function computerFileSize($str) {
+ $str = strtolower($str);
$bytes_array = array(
'b' => 1,
'k' => 1024,
'kb' => 1024,
'mb' => 1024 * 1024,
- 'm' => 1024 * 1024,
+ 'm' => 1024 * 1024,
'gb' => 1024 * 1024 * 1024,
- 'g' => 1024 * 1024 * 1024,
+ 'g' => 1024 * 1024 * 1024,
'tb' => 1024 * 1024 * 1024 * 1024,
- 't' => 1024 * 1024 * 1024 * 1024,
+ 't' => 1024 * 1024 * 1024 * 1024,
'pb' => 1024 * 1024 * 1024 * 1024 * 1024,
- 'p' => 1024 * 1024 * 1024 * 1024 * 1024,
+ 'p' => 1024 * 1024 * 1024 * 1024 * 1024,
);
$bytes = floatval($str);
@@ -299,18 +296,17 @@ class OC_Helper {
return chmod($path, $filemode);
$dh = opendir($path);
while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..') {
- $fullpath = $path.'/'.$file;
- if(is_link($fullpath))
+ if ($file != '.' && $file != '..') {
+ $fullpath = $path . '/' . $file;
+ if (is_link($fullpath))
return false;
- elseif(!is_dir($fullpath) && !@chmod($fullpath, $filemode))
- return false;
- elseif(!self::chmodr($fullpath, $filemode))
+ elseif (!is_dir($fullpath) && !@chmod($fullpath, $filemode))
+ return false; elseif (!self::chmodr($fullpath, $filemode))
return false;
}
}
closedir($dh);
- if(@chmod($path, $filemode))
+ if (@chmod($path, $filemode))
return true;
else
return false;
@@ -323,8 +319,8 @@ class OC_Helper {
*
*/
static function copyr($src, $dest) {
- if(is_dir($src)) {
- if(!is_dir($dest)) {
+ if (is_dir($src)) {
+ if (!is_dir($dest)) {
mkdir($dest);
}
$files = scandir($src);
@@ -333,7 +329,7 @@ class OC_Helper {
self::copyr("$src/$file", "$dest/$file");
}
}
- }elseif(file_exists($src) && !\OC\Files\Filesystem::isFileBlacklisted($src)) {
+ } elseif (file_exists($src) && !\OC\Files\Filesystem::isFileBlacklisted($src)) {
copy($src, $dest);
}
}
@@ -344,105 +340,74 @@ class OC_Helper {
* @return bool
*/
static function rmdirr($dir) {
- if(is_dir($dir)) {
- $files=scandir($dir);
- foreach($files as $file) {
+ if (is_dir($dir)) {
+ $files = scandir($dir);
+ foreach ($files as $file) {
if ($file != "." && $file != "..") {
self::rmdirr("$dir/$file");
}
}
rmdir($dir);
- }elseif(file_exists($dir)) {
+ } elseif (file_exists($dir)) {
unlink($dir);
}
- if(file_exists($dir)) {
+ if (file_exists($dir)) {
return false;
- }else{
+ } else {
return true;
}
}
/**
+ * @return \OC\Files\Type\Detection
+ */
+ static public function getMimetypeDetector() {
+ if (!self::$mimetypeDetector) {
+ self::$mimetypeDetector = new \OC\Files\Type\Detection();
+ self::$mimetypeDetector->registerTypeArray(include 'mimetypes.list.php');
+ }
+ return self::$mimetypeDetector;
+ }
+
+ /**
+ * @return \OC\Files\Type\TemplateManager
+ */
+ static public function getFileTemplateManager() {
+ if (!self::$templateManager) {
+ self::$templateManager = new \OC\Files\Type\TemplateManager();
+ }
+ return self::$templateManager;
+ }
+
+ /**
* Try to guess the mimetype based on filename
*
* @param string $path
* @return string
*/
- static public function getFileNameMimeType($path){
- if(strpos($path, '.')) {
- //try to guess the type by the file extension
- if(!self::$mimetypes || self::$mimetypes != include 'mimetypes.list.php') {
- self::$mimetypes=include 'mimetypes.list.php';
- }
- $extension=strtolower(strrchr(basename($path), "."));
- $extension=substr($extension, 1);//remove leading .
- return (isset(self::$mimetypes[$extension]))?self::$mimetypes[$extension]:'application/octet-stream';
- }else{
- return 'application/octet-stream';
- }
+ static public function getFileNameMimeType($path) {
+ return self::getMimetypeDetector()->detectPath($path);
}
/**
* get the mimetype form a local file
+ *
* @param string $path
* @return string
* does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
*/
static function getMimeType($path) {
- $isWrapped=(strpos($path, '://')!==false) and (substr($path, 0, 7)=='file://');
-
- if (@is_dir($path)) {
- // directories are easy
- return "httpd/unix-directory";
- }
-
- $mimeType = self::getFileNameMimeType($path);
-
- if($mimeType=='application/octet-stream' and function_exists('finfo_open')
- and function_exists('finfo_file') and $finfo=finfo_open(FILEINFO_MIME)) {
- $info = @strtolower(finfo_file($finfo, $path));
- if($info) {
- $mimeType=substr($info, 0, strpos($info, ';'));
- }
- finfo_close($finfo);
- }
- if (!$isWrapped and $mimeType=='application/octet-stream' && function_exists("mime_content_type")) {
- // use mime magic extension if available
- $mimeType = mime_content_type($path);
- }
- if (!$isWrapped and $mimeType=='application/octet-stream' && OC_Helper::canExecute("file")) {
- // it looks like we have a 'file' command,
- // lets see if it does have mime support
- $path=escapeshellarg($path);
- $fp = popen("file -b --mime-type $path 2>/dev/null", "r");
- $reply = fgets($fp);
- pclose($fp);
-
- //trim the newline
- $mimeType = trim($reply);
-
- }
- return $mimeType;
+ return self::getMimetypeDetector()->detect($path);
}
/**
* get the mimetype form a data string
+ *
* @param string $data
* @return string
*/
static function getStringMimeType($data) {
- if(function_exists('finfo_open') and function_exists('finfo_file')) {
- $finfo=finfo_open(FILEINFO_MIME);
- return finfo_buffer($finfo, $data);
- }else{
- $tmpFile=OC_Helper::tmpFile();
- $fh=fopen($tmpFile, 'wb');
- fwrite($fh, $data, 8024);
- fclose($fh);
- $mime=self::getMimeType($tmpFile);
- unset($tmpFile);
- return $mime;
- }
+ return self::getMimetypeDetector()->detectString($data);
}
/**
@@ -454,9 +419,9 @@ class OC_Helper {
*/
//FIXME: should also check for value validation (i.e. the email is an email).
- public static function init_var($s, $d="") {
+ public static function init_var($s, $d = "") {
$r = $d;
- if(isset($_REQUEST[$s]) && !empty($_REQUEST[$s])) {
+ if (isset($_REQUEST[$s]) && !empty($_REQUEST[$s])) {
$r = OC_Util::sanitizeHTML($_REQUEST[$s]);
}
@@ -466,12 +431,13 @@ class OC_Helper {
/**
* returns "checked"-attribute if request contains selected radio element
* OR if radio element is the default one -- maybe?
+ *
* @param string $s Name of radio-button element name
* @param string $v Value of current radio-button element
* @param string $d Value of default radio-button element
*/
public static function init_radio($s, $v, $d) {
- if((isset($_REQUEST[$s]) && $_REQUEST[$s]==$v) || (!isset($_REQUEST[$s]) && $v == $d))
+ if ((isset($_REQUEST[$s]) && $_REQUEST[$s] == $v) || (!isset($_REQUEST[$s]) && $v == $d))
print "checked=\"checked\" ";
}
@@ -503,17 +469,17 @@ class OC_Helper {
$dirs = explode(PATH_SEPARATOR, $path);
// WARNING : We have to check if open_basedir is enabled :
$obd = ini_get('open_basedir');
- if($obd != "none") {
+ if ($obd != "none") {
$obd_values = explode(PATH_SEPARATOR, $obd);
- if(count($obd_values) > 0 and $obd_values[0]) {
+ if (count($obd_values) > 0 and $obd_values[0]) {
// open_basedir is in effect !
// We need to check if the program is in one of these dirs :
$dirs = $obd_values;
}
}
- foreach($dirs as $dir) {
- foreach($exts as $ext) {
- if($check_fn("$dir/$name".$ext))
+ foreach ($dirs as $dir) {
+ foreach ($exts as $ext) {
+ if ($check_fn("$dir/$name" . $ext))
return true;
}
}
@@ -522,18 +488,19 @@ class OC_Helper {
/**
* copy the contents of one stream to another
+ *
* @param resource $source
* @param resource $target
* @return int the number of bytes copied
*/
public static function streamCopy($source, $target) {
- if(!$source or !$target) {
+ if (!$source or !$target) {
return false;
}
$result = true;
$count = 0;
- while(!feof($source)) {
- if ( ( $c = fwrite($target, fread($source, 8192)) ) === false) {
+ while (!feof($source)) {
+ if (($c = fwrite($target, fread($source, 8192))) === false) {
$result = false;
} else {
$count += $c;
@@ -544,37 +511,39 @@ class OC_Helper {
/**
* create a temporary file with an unique filename
+ *
* @param string $postfix
* @return string
*
* temporary files are automatically cleaned up after the script is finished
*/
- public static function tmpFile($postfix='') {
- $file=get_temp_dir().'/'.md5(time().rand()).$postfix;
- $fh=fopen($file, 'w');
+ public static function tmpFile($postfix = '') {
+ $file = get_temp_dir() . '/' . md5(time() . rand()) . $postfix;
+ $fh = fopen($file, 'w');
fclose($fh);
- self::$tmpFiles[]=$file;
+ self::$tmpFiles[] = $file;
return $file;
}
/**
* move a file to oc-noclean temp dir
+ *
* @param string $filename
* @return mixed
*
*/
- public static function moveToNoClean($filename='') {
+ public static function moveToNoClean($filename = '') {
if ($filename == '') {
return false;
}
- $tmpDirNoClean=get_temp_dir().'/oc-noclean/';
+ $tmpDirNoClean = get_temp_dir() . '/oc-noclean/';
if (!file_exists($tmpDirNoClean) || !is_dir($tmpDirNoClean)) {
if (file_exists($tmpDirNoClean)) {
unlink($tmpDirNoClean);
}
mkdir($tmpDirNoClean);
}
- $newname=$tmpDirNoClean.basename($filename);
+ $newname = $tmpDirNoClean . basename($filename);
if (rename($filename, $newname)) {
return $newname;
} else {
@@ -584,34 +553,35 @@ class OC_Helper {
/**
* create a temporary folder with an unique filename
+ *
* @return string
*
* temporary files are automatically cleaned up after the script is finished
*/
public static function tmpFolder() {
- $path=get_temp_dir().'/'.md5(time().rand());
+ $path = get_temp_dir() . '/' . md5(time() . rand());
mkdir($path);
- self::$tmpFiles[]=$path;
- return $path.'/';
+ self::$tmpFiles[] = $path;
+ return $path . '/';
}
/**
* remove all files created by self::tmpFile
*/
public static function cleanTmp() {
- $leftoversFile=get_temp_dir().'/oc-not-deleted';
- if(file_exists($leftoversFile)) {
- $leftovers=file($leftoversFile);
- foreach($leftovers as $file) {
+ $leftoversFile = get_temp_dir() . '/oc-not-deleted';
+ if (file_exists($leftoversFile)) {
+ $leftovers = file($leftoversFile);
+ foreach ($leftovers as $file) {
self::rmdirr($file);
}
unlink($leftoversFile);
}
- foreach(self::$tmpFiles as $file) {
- if(file_exists($file)) {
- if(!self::rmdirr($file)) {
- file_put_contents($leftoversFile, $file."\n", FILE_APPEND);
+ foreach (self::$tmpFiles as $file) {
+ if (file_exists($file)) {
+ if (!self::rmdirr($file)) {
+ file_put_contents($leftoversFile, $file . "\n", FILE_APPEND);
}
}
}
@@ -621,34 +591,34 @@ class OC_Helper {
* remove all files in PHP /oc-noclean temp dir
*/
public static function cleanTmpNoClean() {
- $tmpDirNoCleanFile=get_temp_dir().'/oc-noclean/';
- if(file_exists($tmpDirNoCleanFile)) {
+ $tmpDirNoCleanFile = get_temp_dir() . '/oc-noclean/';
+ if (file_exists($tmpDirNoCleanFile)) {
self::rmdirr($tmpDirNoCleanFile);
}
}
/**
- * Adds a suffix to the name in case the file exists
- *
- * @param $path
- * @param $filename
- * @return string
- */
+ * Adds a suffix to the name in case the file exists
+ *
+ * @param $path
+ * @param $filename
+ * @return string
+ */
public static function buildNotExistingFileName($path, $filename) {
$view = \OC\Files\Filesystem::getView();
return self::buildNotExistingFileNameForView($path, $filename, $view);
}
/**
- * Adds a suffix to the name in case the file exists
- *
- * @param $path
- * @param $filename
- * @return string
- */
+ * Adds a suffix to the name in case the file exists
+ *
+ * @param $path
+ * @param $filename
+ * @return string
+ */
public static function buildNotExistingFileNameForView($path, $filename, \OC\Files\View $view) {
- if($path==='/') {
- $path='';
+ if ($path === '/') {
+ $path = '';
}
if ($pos = strrpos($filename, '.')) {
$name = substr($filename, 0, $pos);
@@ -660,10 +630,10 @@ class OC_Helper {
$newpath = $path . '/' . $filename;
if ($view->file_exists($newpath)) {
- if(preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) {
+ if (preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) {
//Replace the last "(number)" with "(number+1)"
- $last_match = count($matches[0])-1;
- $counter = $matches[1][$last_match][0]+1;
+ $last_match = count($matches[0]) - 1;
+ $counter = $matches[1][$last_match][0] + 1;
$offset = $matches[0][$last_match][1];
$match_length = strlen($matches[0][$last_match][0]);
} else {
@@ -671,9 +641,9 @@ class OC_Helper {
$offset = false;
}
do {
- if($offset) {
+ if ($offset) {
//Replace the last "(number)" with "(number+1)"
- $newname = substr_replace($name, '('.$counter.')', $offset, $match_length);
+ $newname = substr_replace($name, '(' . $counter . ')', $offset, $match_length);
} else {
$newname = $name . ' (' . $counter . ')';
}
@@ -700,17 +670,17 @@ class OC_Helper {
}
/**
- * @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
- *
- * @param array $input The array to work on
- * @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
- * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
- * @return array
- *
- * Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
- * based on http://www.php.net/manual/en/function.array-change-key-case.php#107715
- *
- */
+ * @brief Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
+ *
+ * @param array $input The array to work on
+ * @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
+ * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
+ * @return array
+ *
+ * Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
+ * based on http://www.php.net/manual/en/function.array-change-key-case.php#107715
+ *
+ */
public static function mb_array_change_key_case($input, $case = MB_CASE_LOWER, $encoding = 'UTF-8') {
$case = ($case != MB_CASE_UPPER) ? MB_CASE_LOWER : MB_CASE_UPPER;
$ret = array();
@@ -736,26 +706,26 @@ class OC_Helper {
$length = intval($length);
$string = mb_substr($string, 0, $start, $encoding) .
$replacement .
- mb_substr($string, $start+$length, mb_strlen($string, 'UTF-8')-$start, $encoding);
+ mb_substr($string, $start + $length, mb_strlen($string, 'UTF-8') - $start, $encoding);
return $string;
}
/**
- * @brief Replace all occurrences of the search string with the replacement string
- *
- * @param string $search The value being searched for, otherwise known as the needle.
- * @param string $replace The replacement
- * @param string $subject The string or array being searched and replaced on, otherwise known as the haystack.
- * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
- * @param int $count If passed, this will be set to the number of replacements performed.
- * @return string
- *
- */
+ * @brief Replace all occurrences of the search string with the replacement string
+ *
+ * @param string $search The value being searched for, otherwise known as the needle.
+ * @param string $replace The replacement
+ * @param string $subject The string or array being searched and replaced on, otherwise known as the haystack.
+ * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
+ * @param int $count If passed, this will be set to the number of replacements performed.
+ * @return string
+ *
+ */
public static function mb_str_replace($search, $replace, $subject, $encoding = 'UTF-8', &$count = null) {
$offset = -1;
$length = mb_strlen($search, $encoding);
- while(($i = mb_strrpos($subject, $search, $offset, $encoding)) !== false ) {
+ while (($i = mb_strrpos($subject, $search, $offset, $encoding)) !== false) {
$subject = OC_Helper::mb_substr_replace($subject, $replace, $i, $length);
$offset = $i - mb_strlen($subject, $encoding);
$count++;
@@ -764,21 +734,21 @@ class OC_Helper {
}
/**
- * @brief performs a search in a nested array
- * @param array $haystack the array to be searched
- * @param string $needle the search string
- * @param string $index optional, only search this key name
- * @return mixed the key of the matching field, otherwise false
- *
- * performs a search in a nested array
- *
- * taken from http://www.php.net/manual/en/function.array-search.php#97645
- */
+ * @brief performs a search in a nested array
+ * @param array $haystack the array to be searched
+ * @param string $needle the search string
+ * @param string $index optional, only search this key name
+ * @return mixed the key of the matching field, otherwise false
+ *
+ * performs a search in a nested array
+ *
+ * taken from http://www.php.net/manual/en/function.array-search.php#97645
+ */
public static function recursiveArraySearch($haystack, $needle, $index = null) {
$aIt = new RecursiveArrayIterator($haystack);
$it = new RecursiveIteratorIterator($aIt);
- while($it->valid()) {
+ while ($it->valid()) {
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) {
return $aIt->key();
}
@@ -792,6 +762,7 @@ class OC_Helper {
/**
* Shortens str to maxlen by replacing characters in the middle with '...', eg.
* ellipsis('a very long string with lots of useless info to make a better example', 14) becomes 'a very ...example'
+ *
* @param string $str the string
* @param string $maxlen the maximum length of the result
* @return string with at most maxlen characters
@@ -822,7 +793,7 @@ class OC_Helper {
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
}
- if($freeSpace !== \OC\Files\SPACE_UNKNOWN){
+ if ($freeSpace !== \OC\Files\SPACE_UNKNOWN) {
$freeSpace = max($freeSpace, 0);
return min($maxUploadFilesize, $freeSpace);
@@ -833,6 +804,7 @@ class OC_Helper {
/**
* Checks if a function is available
+ *
* @param string $function_name
* @return bool
*/
@@ -861,7 +833,7 @@ class OC_Helper {
$used = 0;
}
$free = \OC\Files\Filesystem::free_space();
- if ($free >= 0){
+ if ($free >= 0) {
$total = $free + $used;
} else {
$total = $free; //either unknown or unlimited
@@ -869,7 +841,7 @@ class OC_Helper {
if ($total == 0) {
$total = 1; // prevent division by zero
}
- if ($total >= 0){
+ if ($total >= 0) {
$relative = round(($used / $total) * 10000) / 100;
} else {
$relative = 0;
diff --git a/lib/image.php b/lib/image.php
index c1b187608a6..4bc38e20e56 100644
--- a/lib/image.php
+++ b/lib/image.php
@@ -392,7 +392,7 @@ class OC_Image {
*/
public function loadFromFile($imagepath=false) {
// exif_imagetype throws "read error!" if file is less than 12 byte
- if(!is_file($imagepath) || !file_exists($imagepath) || filesize($imagepath) < 12 || !is_readable($imagepath)) {
+ if(!@is_file($imagepath) || !file_exists($imagepath) || filesize($imagepath) < 12 || !is_readable($imagepath)) {
// Debug output disabled because this method is tried before loadFromBase64?
OC_Log::write('core', 'OC_Image->loadFromFile, couldn\'t load: '.$imagepath, OC_Log::DEBUG);
return false;
diff --git a/lib/l10n.php b/lib/l10n.php
index d35ce5fed14..f93443b886a 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -2,8 +2,10 @@
/**
* ownCloud
*
+ * @author Frank Karlitschek
* @author Jakob Sack
* @copyright 2012 Frank Karlitschek frank@owncloud.org
+ * @copyright 2013 Jakob Sack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -23,7 +25,7 @@
/**
* This class is for i18n and l10n
*/
-class OC_L10N{
+class OC_L10N {
/**
* cached instances
*/
@@ -55,6 +57,16 @@ class OC_L10N{
private $translations = array();
/**
+ * Plural forms (string)
+ */
+ private $plural_form_string = 'nplurals=2; plural=(n != 1);';
+
+ /**
+ * Plural forms (function)
+ */
+ private $plural_form_function = null;
+
+ /**
* Localization
*/
private $localizations = array(
@@ -66,6 +78,8 @@ class OC_L10N{
/**
* get an L10N instance
+ * @param $app string
+ * @param $lang string|null
* @return OC_L10N
*/
public static function get($app, $lang=null) {
@@ -81,8 +95,8 @@ class OC_L10N{
/**
* @brief The constructor
- * @param $app the app requesting l10n
- * @param $lang default: null Language
+ * @param $app string app requesting l10n
+ * @param $lang string default: null Language
* @returns OC_L10N-Object
*
* If language is not set, the constructor tries to find the right
@@ -93,6 +107,17 @@ class OC_L10N{
$this->lang = $lang;
}
+ public function load($transFile) {
+ $this->app = true;
+ include $transFile;
+ if(isset($TRANSLATIONS) && is_array($TRANSLATIONS)) {
+ $this->translations = $TRANSLATIONS;
+ }
+ if(isset($PLURAL_FORMS)) {
+ $this->plural_form_string = $PLURAL_FORMS;
+ }
+ }
+
protected function init() {
if ($this->app === true) {
return;
@@ -138,6 +163,9 @@ class OC_L10N{
}
}
}
+ if(isset($PLURAL_FORMS)) {
+ $this->plural_form_string = $PLURAL_FORMS;
+ }
}
if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')) {
@@ -154,6 +182,65 @@ class OC_L10N{
}
/**
+ * @brief Creates a function that The constructor
+ *
+ * If language is not set, the constructor tries to find the right
+ * language.
+ *
+ * Parts of the code is copied from Habari:
+ * https://github.com/habari/system/blob/master/classes/locale.php
+ * @param $string string
+ * @return string
+ */
+ protected function createPluralFormFunction($string){
+ if(preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s*plural=(.*)$/u', $string, $matches)) {
+ // sanitize
+ $nplurals = preg_replace( '/[^0-9]/', '', $matches[1] );
+ $plural = preg_replace( '#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2] );
+
+ $body = str_replace(
+ array( 'plural', 'n', '$n$plurals', ),
+ array( '$plural', '$n', '$nplurals', ),
+ 'nplurals='. $nplurals . '; plural=' . $plural
+ );
+
+ // add parents
+ // important since PHP's ternary evaluates from left to right
+ $body .= ';';
+ $res = '';
+ $p = 0;
+ for($i = 0; $i < strlen($body); $i++) {
+ $ch = $body[$i];
+ switch ( $ch ) {
+ case '?':
+ $res .= ' ? (';
+ $p++;
+ break;
+ case ':':
+ $res .= ') : (';
+ break;
+ case ';':
+ $res .= str_repeat( ')', $p ) . ';';
+ $p = 0;
+ break;
+ default:
+ $res .= $ch;
+ }
+ }
+
+ $body = $res . 'return ($plural>=$nplurals?$nplurals-1:$plural);';
+ return create_function('$n', $body);
+ }
+ else {
+ // default: one plural form for all cases but n==1 (english)
+ return create_function(
+ '$n',
+ '$nplurals=2;$plural=($n==1?0:1);return ($plural>=$nplurals?$nplurals-1:$plural);'
+ );
+ }
+ }
+
+ /**
* @brief Translating
* @param $text String The text we need a translation for
* @param array $parameters default:array() Parameters for sprintf
@@ -168,6 +255,37 @@ class OC_L10N{
/**
* @brief Translating
+ * @param $text_singular String the string to translate for exactly one object
+ * @param $text_plural String the string to translate for n objects
+ * @param $count Integer Number of objects
+ * @param array $parameters default:array() Parameters for sprintf
+ * @return \OC_L10N_String Translation or the same text
+ *
+ * Returns the translation. If no translation is found, $text will be
+ * returned. %n will be replaced with the number of objects.
+ *
+ * The correct plural is determined by the plural_forms-function
+ * provided by the po file.
+ *
+ */
+ public function n($text_singular, $text_plural, $count, $parameters = array()) {
+ $this->init();
+ $identifier = "_${text_singular}__${text_plural}_";
+ if( array_key_exists($identifier, $this->translations)) {
+ return new OC_L10N_String( $this, $identifier, $parameters, $count );
+ }
+ else{
+ if($count === 1) {
+ return new OC_L10N_String($this, $text_singular, $parameters, $count);
+ }
+ else{
+ return new OC_L10N_String($this, $text_plural, $parameters, $count);
+ }
+ }
+ }
+
+ /**
+ * @brief Translating
* @param $textArray The text array we need a translation for
* @returns Translation or the same text
*
@@ -201,6 +319,42 @@ class OC_L10N{
}
/**
+ * @brief getPluralFormString
+ * @returns string containing the gettext "Plural-Forms"-string
+ *
+ * Returns a string like "nplurals=2; plural=(n != 1);"
+ */
+ public function getPluralFormString() {
+ $this->init();
+ return $this->plural_form_string;
+ }
+
+ /**
+ * @brief getPluralFormFunction
+ * @returns string the plural form function
+ *
+ * returned function accepts the argument $n
+ */
+ public function getPluralFormFunction() {
+ $this->init();
+ if(is_null($this->plural_form_function)) {
+ $this->plural_form_function = $this->createPluralFormFunction($this->plural_form_string);
+ }
+ return $this->plural_form_function;
+ }
+
+ /**
+ * @brief get localizations
+ * @returns Fetch all localizations
+ *
+ * Returns an associative array with all localizations
+ */
+ public function getLocalizations() {
+ $this->init();
+ return $this->localizations;
+ }
+
+ /**
* @brief Localization
* @param $type Type of localization
* @param $params parameters for this localization
@@ -230,8 +384,11 @@ class OC_L10N{
case 'date':
case 'datetime':
case 'time':
- if($data instanceof DateTime) return $data->format($this->localizations[$type]);
- elseif(is_string($data)) $data = strtotime($data);
+ if($data instanceof DateTime) {
+ return $data->format($this->localizations[$type]);
+ } elseif(is_string($data) && !is_numeric($data)) {
+ $data = strtotime($data);
+ }
$locales = array(self::findLanguage());
if (strlen($locales[0]) == 2) {
$locales[] = $locales[0].'_'.strtoupper($locales[0]);
@@ -298,6 +455,12 @@ class OC_L10N{
}
}
+ $default_language = OC_Config::getValue('default_language', false);
+
+ if($default_language !== false) {
+ return $default_language;
+ }
+
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$accepted_languages = preg_split('/,\s*/', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
if(is_array($app)) {
diff --git a/lib/l10n/af_ZA.php b/lib/l10n/af_ZA.php
index de32778026f..d6bf5771e8d 100644
--- a/lib/l10n/af_ZA.php
+++ b/lib/l10n/af_ZA.php
@@ -1,9 +1,14 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hulp",
"Personal" => "Persoonlik",
"Settings" => "Instellings",
"Users" => "Gebruikers",
-"Apps" => "Toepassings",
"Admin" => "Admin",
-"web services under your control" => "webdienste onder jou beheer"
+"web services under your control" => "webdienste onder jou beheer",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/ar.php b/lib/l10n/ar.php
index 107b27a1fc8..2e95f28841e 100644
--- a/lib/l10n/ar.php
+++ b/lib/l10n/ar.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "المساعدة",
"Personal" => "شخصي",
"Settings" => "إعدادات",
"Users" => "المستخدمين",
-"Apps" => "التطبيقات",
"Admin" => "المدير",
"web services under your control" => "خدمات الشبكة تحت سيطرتك",
"ZIP download is turned off." => "تحميل ملفات ZIP متوقف",
@@ -37,16 +37,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "اعدادات خادمك غير صحيحة بشكل تسمح لك بمزامنة ملفاتك وذلك بسبب أن واجهة WebDAV تبدو معطلة",
"Please double check the <a href='%s'>installation guides</a>." => "الرجاء التحقق من <a href='%s'>دليل التنصيب</a>.",
"seconds ago" => "منذ ثواني",
-"1 minute ago" => "منذ دقيقة",
-"%d minutes ago" => "%d دقيقة مضت",
-"1 hour ago" => "قبل ساعة مضت",
-"%d hours ago" => "%d ساعة مضت",
+"_%n minute ago_::_%n minutes ago_" => array("","","","","",""),
+"_%n hour ago_::_%n hours ago_" => array("","","","","",""),
"today" => "اليوم",
"yesterday" => "يوم أمس",
-"%d days ago" => "%d يوم مضى",
+"_%n day go_::_%n days ago_" => array("","","","","",""),
"last month" => "الشهر الماضي",
-"%d months ago" => "%d شهر مضت",
+"_%n month ago_::_%n months ago_" => array("","","","","",""),
"last year" => "السنةالماضية",
"years ago" => "سنة مضت",
"Could not find category \"%s\"" => "تعذر العثور على المجلد \"%s\""
);
+$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;";
diff --git a/lib/l10n/be.php b/lib/l10n/be.php
new file mode 100644
index 00000000000..1570411eb86
--- /dev/null
+++ b/lib/l10n/be.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("","","",""),
+"_%n hour ago_::_%n hours ago_" => array("","","",""),
+"_%n day go_::_%n days ago_" => array("","","",""),
+"_%n month ago_::_%n months ago_" => array("","","","")
+);
+$PLURAL_FORMS = "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/lib/l10n/bg_BG.php b/lib/l10n/bg_BG.php
index e23112c8302..10d3bb610af 100644
--- a/lib/l10n/bg_BG.php
+++ b/lib/l10n/bg_BG.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Помощ",
"Personal" => "Лични",
"Settings" => "Настройки",
"Users" => "Потребители",
-"Apps" => "Приложения",
"Admin" => "Админ",
"web services under your control" => "уеб услуги под Ваш контрол",
"ZIP download is turned off." => "Изтеглянето като ZIP е изключено.",
@@ -38,16 +38,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Вашият web сървър все още не е удачно настроен да позволява синхронизация на файлове, защото WebDAV интерфейсът изглежда не работи.",
"Please double check the <a href='%s'>installation guides</a>." => "Моля направете повторна справка с <a href='%s'>ръководството за инсталиране</a>.",
"seconds ago" => "преди секунди",
-"1 minute ago" => "преди 1 минута",
-"%d minutes ago" => "преди %d минути",
-"1 hour ago" => "преди 1 час",
-"%d hours ago" => "преди %d часа",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "днес",
"yesterday" => "вчера",
-"%d days ago" => "преди %d дни",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "последният месец",
-"%d months ago" => "преди %d месеца",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "последната година",
"years ago" => "последните години",
"Could not find category \"%s\"" => "Невъзможно откриване на категорията \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/bn_BD.php b/lib/l10n/bn_BD.php
index ab1d9b94d0d..a42435a2a47 100644
--- a/lib/l10n/bn_BD.php
+++ b/lib/l10n/bn_BD.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "সহায়িকা",
"Personal" => "ব্যক্তিগত",
"Settings" => "নিয়ামকসমূহ",
"Users" => "ব্যবহারকারী",
-"Apps" => "অ্যাপ",
"Admin" => "প্রশাসন",
"web services under your control" => "ওয়েব সার্ভিস আপনার হাতের মুঠোয়",
"ZIP download is turned off." => "ZIP ডাউনলোড বন্ধ করা আছে।",
@@ -16,13 +16,14 @@
"Files" => "ফাইল",
"Text" => "টেক্সট",
"seconds ago" => "সেকেন্ড পূর্বে",
-"1 minute ago" => "১ মিনিট পূর্বে",
-"%d minutes ago" => "%d মিনিট পূর্বে",
-"1 hour ago" => "1 ঘন্টা পূর্বে",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "আজ",
"yesterday" => "গতকাল",
-"%d days ago" => "%d দিন পূর্বে",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "গত মাস",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "গত বছর",
"years ago" => "বছর পূর্বে"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/bs.php b/lib/l10n/bs.php
new file mode 100644
index 00000000000..3cb98906e62
--- /dev/null
+++ b/lib/l10n/bs.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
+"_%n day go_::_%n days ago_" => array("","",""),
+"_%n month ago_::_%n months ago_" => array("","","")
+);
+$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);";
diff --git a/lib/l10n/ca.php b/lib/l10n/ca.php
index 93f7fa5f7bc..95faed498cd 100644
--- a/lib/l10n/ca.php
+++ b/lib/l10n/ca.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ajuda",
"Personal" => "Personal",
"Settings" => "Configuració",
"Users" => "Usuaris",
-"Apps" => "Aplicacions",
"Admin" => "Administració",
+"Failed to upgrade \"%s\"." => "Ha fallat l'actualització \"%s\".",
"web services under your control" => "controleu els vostres serveis web",
+"cannot open \"%s\"" => "no es pot obrir \"%s\"",
"ZIP download is turned off." => "La baixada en ZIP està desactivada.",
"Files need to be downloaded one by one." => "Els fitxers s'han de baixar d'un en un.",
"Back to Files" => "Torna a Fitxers",
"Selected files too large to generate zip file." => "Els fitxers seleccionats son massa grans per generar un fitxer zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Baixeu els fitxers en trossos petits, de forma separada, o pregunteu a l'administrador.",
"couldn't be determined" => "no s'ha pogut determinar",
"Application is not enabled" => "L'aplicació no està habilitada",
"Authentication error" => "Error d'autenticació",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "El servidor web no està configurat correctament per permetre la sincronització de fitxers perquè la interfície WebDAV sembla no funcionar correctament.",
"Please double check the <a href='%s'>installation guides</a>." => "Comproveu les <a href='%s'>guies d'instal·lació</a>.",
"seconds ago" => "segons enrere",
-"1 minute ago" => "fa 1 minut",
-"%d minutes ago" => "fa %d minuts",
-"1 hour ago" => "fa 1 hora",
-"%d hours ago" => "fa %d hores",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "avui",
"yesterday" => "ahir",
-"%d days ago" => "fa %d dies",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "el mes passat",
-"%d months ago" => "fa %d mesos",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "l'any passat",
"years ago" => "anys enrere",
+"Caused by:" => "Provocat per:",
"Could not find category \"%s\"" => "No s'ha trobat la categoria \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php
index 917f383bb89..ec54376024d 100644
--- a/lib/l10n/cs_CZ.php
+++ b/lib/l10n/cs_CZ.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Nápověda",
"Personal" => "Osobní",
"Settings" => "Nastavení",
"Users" => "Uživatelé",
-"Apps" => "Aplikace",
"Admin" => "Administrace",
-"web services under your control" => "služby webu pod Vaší kontrolou",
-"ZIP download is turned off." => "Stahování ZIPu je vypnuto.",
+"Failed to upgrade \"%s\"." => "Selhala aktualizace verze \"%s\".",
+"web services under your control" => "webové služby pod Vaší kontrolou",
+"cannot open \"%s\"" => "nelze otevřít \"%s\"",
+"ZIP download is turned off." => "Stahování v ZIPu je vypnuto.",
"Files need to be downloaded one by one." => "Soubory musí být stahovány jednotlivě.",
"Back to Files" => "Zpět k souborům",
-"Selected files too large to generate zip file." => "Vybrané soubory jsou příliš velké pro vytvoření zip souboru.",
+"Selected files too large to generate zip file." => "Vybrané soubory jsou příliš velké pro vytvoření ZIP souboru.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Stáhněte soubory po menších částech, samostatně, nebo se obraťte na správce.",
"couldn't be determined" => "nelze zjistit",
"Application is not enabled" => "Aplikace není povolena",
"Authentication error" => "Chyba ověření",
@@ -20,34 +23,34 @@
"%s enter the database username." => "Zadejte uživatelské jméno %s databáze.",
"%s enter the database name." => "Zadejte název databáze pro %s databáze.",
"%s you may not use dots in the database name" => "V názvu databáze %s nesmíte používat tečky.",
-"MS SQL username and/or password not valid: %s" => "Uživatelské jméno, či heslo MSSQL není platné: %s",
-"You need to enter either an existing account or the administrator." => "Musíte zadat existující účet, či správce.",
-"MySQL username and/or password not valid" => "Uživatelské jméno, či heslo MySQL není platné",
-"DB Error: \"%s\"" => "Chyba DB: \"%s\"",
-"Offending command was: \"%s\"" => "Podezřelý příkaz byl: \"%s\"",
+"MS SQL username and/or password not valid: %s" => "Uživatelské jméno či heslo MSSQL není platné: %s",
+"You need to enter either an existing account or the administrator." => "Musíte zadat existující účet či správce.",
+"MySQL username and/or password not valid" => "Uživatelské jméno či heslo MySQL není platné",
+"DB Error: \"%s\"" => "Chyba databáze: \"%s\"",
+"Offending command was: \"%s\"" => "Příslušný příkaz byl: \"%s\"",
"MySQL user '%s'@'localhost' exists already." => "Uživatel '%s'@'localhost' již v MySQL existuje.",
-"Drop this user from MySQL" => "Zahodit uživatele z MySQL",
+"Drop this user from MySQL" => "Zrušte tohoto uživatele z MySQL",
"MySQL user '%s'@'%%' already exists" => "Uživatel '%s'@'%%' již v MySQL existuje",
-"Drop this user from MySQL." => "Zahodit uživatele z MySQL.",
+"Drop this user from MySQL." => "Zrušte tohoto uživatele z MySQL",
"Oracle connection could not be established" => "Spojení s Oracle nemohlo být navázáno",
-"Oracle username and/or password not valid" => "Uživatelské jméno, či heslo Oracle není platné",
-"Offending command was: \"%s\", name: %s, password: %s" => "Podezřelý příkaz byl: \"%s\", jméno: %s, heslo: %s",
-"PostgreSQL username and/or password not valid" => "Uživatelské jméno, či heslo PostgreSQL není platné",
+"Oracle username and/or password not valid" => "Uživatelské jméno či heslo Oracle není platné",
+"Offending command was: \"%s\", name: %s, password: %s" => "Příslušný příkaz byl: \"%s\", jméno: %s, heslo: %s",
+"PostgreSQL username and/or password not valid" => "Uživatelské jméno či heslo PostgreSQL není platné",
"Set an admin username." => "Zadejte uživatelské jméno správce.",
"Set an admin password." => "Zadejte heslo správce.",
-"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server není správně nastaven pro umožnění synchronizace, protože rozhraní WebDAV je rozbité.",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server není správně nastaven pro umožnění synchronizace, rozhraní WebDAV se zdá být rozbité.",
"Please double check the <a href='%s'>installation guides</a>." => "Zkonzultujte, prosím, <a href='%s'>průvodce instalací</a>.",
-"seconds ago" => "před pár vteřinami",
-"1 minute ago" => "před minutou",
-"%d minutes ago" => "před %d minutami",
-"1 hour ago" => "před hodinou",
-"%d hours ago" => "před %d hodinami",
+"seconds ago" => "před pár sekundami",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "dnes",
"yesterday" => "včera",
-"%d days ago" => "před %d dny",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "minulý měsíc",
-"%d months ago" => "Před %d měsíci",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "minulý rok",
"years ago" => "před lety",
+"Caused by:" => "Příčina:",
"Could not find category \"%s\"" => "Nelze nalézt kategorii \"%s\""
);
+$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;";
diff --git a/lib/l10n/cy_GB.php b/lib/l10n/cy_GB.php
index 27140ba6dbb..649a1ebffac 100644
--- a/lib/l10n/cy_GB.php
+++ b/lib/l10n/cy_GB.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Cymorth",
"Personal" => "Personol",
"Settings" => "Gosodiadau",
"Users" => "Defnyddwyr",
-"Apps" => "Pecynnau",
"Admin" => "Gweinyddu",
"web services under your control" => "gwasanaethau gwe a reolir gennych",
"ZIP download is turned off." => "Mae llwytho ZIP wedi ei ddiffodd.",
@@ -37,16 +37,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Nid yw eich gweinydd wedi'i gyflunio eto i ganiatáu cydweddu ffeiliau oherwydd bod y rhyngwyneb WebDAV wedi torri.",
"Please double check the <a href='%s'>installation guides</a>." => "Gwiriwch y <a href='%s'>canllawiau gosod</a> eto.",
"seconds ago" => "eiliad yn ôl",
-"1 minute ago" => "1 munud yn ôl",
-"%d minutes ago" => "%d munud yn ôl",
-"1 hour ago" => "1 awr yn ôl",
-"%d hours ago" => "%d awr yn ôl",
+"_%n minute ago_::_%n minutes ago_" => array("","","",""),
+"_%n hour ago_::_%n hours ago_" => array("","","",""),
"today" => "heddiw",
"yesterday" => "ddoe",
-"%d days ago" => "%d diwrnod yn ôl",
+"_%n day go_::_%n days ago_" => array("","","",""),
"last month" => "mis diwethaf",
-"%d months ago" => "%d mis yn ôl",
+"_%n month ago_::_%n months ago_" => array("","","",""),
"last year" => "y llynedd",
"years ago" => "blwyddyn yn ôl",
"Could not find category \"%s\"" => "Methu canfod categori \"%s\""
);
+$PLURAL_FORMS = "nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;";
diff --git a/lib/l10n/da.php b/lib/l10n/da.php
index 5f11453bcdd..cbf6b16debb 100644
--- a/lib/l10n/da.php
+++ b/lib/l10n/da.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hjælp",
"Personal" => "Personligt",
"Settings" => "Indstillinger",
"Users" => "Brugere",
-"Apps" => "Apps",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "Upgradering af \"%s\" fejlede",
"web services under your control" => "Webtjenester under din kontrol",
+"cannot open \"%s\"" => "Kan ikke åbne \"%s\"",
"ZIP download is turned off." => "ZIP-download er slået fra.",
"Files need to be downloaded one by one." => "Filer skal downloades en for en.",
"Back to Files" => "Tilbage til Filer",
"Selected files too large to generate zip file." => "De markerede filer er for store til at generere en ZIP-fil.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Download filerne i små bider, seperat, eller kontakt venligst din administrator.",
"couldn't be determined" => "kunne ikke fastslås",
"Application is not enabled" => "Programmet er ikke aktiveret",
"Authentication error" => "Adgangsfejl",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din webserver er endnu ikke sat op til at tillade fil synkronisering fordi WebDAV grænsefladen virker ødelagt.",
"Please double check the <a href='%s'>installation guides</a>." => "Dobbelttjek venligst <a href='%s'>installations vejledningerne</a>.",
"seconds ago" => "sekunder siden",
-"1 minute ago" => "1 minut siden",
-"%d minutes ago" => "%d minutter siden",
-"1 hour ago" => "1 time siden",
-"%d hours ago" => "%d timer siden",
+"_%n minute ago_::_%n minutes ago_" => array("%n minut siden","%n minutter siden"),
+"_%n hour ago_::_%n hours ago_" => array("%n time siden","%n timer siden"),
"today" => "i dag",
"yesterday" => "i går",
-"%d days ago" => "%d dage siden",
+"_%n day go_::_%n days ago_" => array("%n dag siden","%n dage siden"),
"last month" => "sidste måned",
-"%d months ago" => "%d måneder siden",
+"_%n month ago_::_%n months ago_" => array("%n måned siden","%n måneder siden"),
"last year" => "sidste år",
"years ago" => "år siden",
+"Caused by:" => "Forårsaget af:",
"Could not find category \"%s\"" => "Kunne ikke finde kategorien \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/de.php b/lib/l10n/de.php
index 4ef02402b9b..798322fdb47 100644
--- a/lib/l10n/de.php
+++ b/lib/l10n/de.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hilfe",
"Personal" => "Persönlich",
"Settings" => "Einstellungen",
"Users" => "Benutzer",
-"Apps" => "Apps",
"Admin" => "Administration",
+"Failed to upgrade \"%s\"." => "Konnte \"%s\" nicht aktualisieren.",
"web services under your control" => "Web-Services unter Deiner Kontrolle",
+"cannot open \"%s\"" => "Öffnen von \"%s\" fehlgeschlagen",
"ZIP download is turned off." => "Der ZIP-Download ist deaktiviert.",
"Files need to be downloaded one by one." => "Die Dateien müssen einzeln heruntergeladen werden.",
"Back to Files" => "Zurück zu \"Dateien\"",
"Selected files too large to generate zip file." => "Die gewählten Dateien sind zu groß, um eine ZIP-Datei zu erstellen.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Lade die Dateien in kleineren, separaten, Stücken herunter oder bitte deinen Administrator.",
"couldn't be determined" => "konnte nicht festgestellt werden",
"Application is not enabled" => "Die Anwendung ist nicht aktiviert",
"Authentication error" => "Fehler bei der Anmeldung",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Dein Web-Server ist noch nicht für Datei-Synchronisation bereit, weil die WebDAV-Schnittstelle vermutlich defekt ist.",
"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfe die <a href='%s'>Installationsanleitungen</a>.",
"seconds ago" => "Gerade eben",
-"1 minute ago" => "vor einer Minute",
-"%d minutes ago" => "Vor %d Minuten",
-"1 hour ago" => "Vor einer Stunde",
-"%d hours ago" => "Vor %d Stunden",
+"_%n minute ago_::_%n minutes ago_" => array("","Vor %n Minuten"),
+"_%n hour ago_::_%n hours ago_" => array("","Vor %n Stunden"),
"today" => "Heute",
"yesterday" => "Gestern",
-"%d days ago" => "Vor %d Tag(en)",
+"_%n day go_::_%n days ago_" => array("","Vor %n Tagen"),
"last month" => "Letzten Monat",
-"%d months ago" => "Vor %d Monaten",
+"_%n month ago_::_%n months ago_" => array("","Vor %n Monaten"),
"last year" => "Letztes Jahr",
"years ago" => "Vor Jahren",
+"Caused by:" => "Verursacht durch:",
"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden."
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/de_AT.php b/lib/l10n/de_AT.php
new file mode 100644
index 00000000000..15f78e0bce6
--- /dev/null
+++ b/lib/l10n/de_AT.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/de_CH.php b/lib/l10n/de_CH.php
new file mode 100644
index 00000000000..d99c144f185
--- /dev/null
+++ b/lib/l10n/de_CH.php
@@ -0,0 +1,56 @@
+<?php
+$TRANSLATIONS = array(
+"Help" => "Hilfe",
+"Personal" => "Persönlich",
+"Settings" => "Einstellungen",
+"Users" => "Benutzer",
+"Admin" => "Administrator",
+"Failed to upgrade \"%s\"." => "Konnte \"%s\" nicht aktualisieren.",
+"web services under your control" => "Web-Services unter Ihrer Kontrolle",
+"cannot open \"%s\"" => "Öffnen von \"%s\" fehlgeschlagen",
+"ZIP download is turned off." => "Der ZIP-Download ist deaktiviert.",
+"Files need to be downloaded one by one." => "Die Dateien müssen einzeln heruntergeladen werden.",
+"Back to Files" => "Zurück zu \"Dateien\"",
+"Selected files too large to generate zip file." => "Die gewählten Dateien sind zu gross, um eine ZIP-Datei zu erstellen.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Laden Sie die Dateien in kleineren, separaten, Stücken herunter oder bitten Sie Ihren Administrator.",
+"couldn't be determined" => "konnte nicht ermittelt werden",
+"Application is not enabled" => "Die Anwendung ist nicht aktiviert",
+"Authentication error" => "Authentifizierungs-Fehler",
+"Token expired. Please reload page." => "Token abgelaufen. Bitte laden Sie die Seite neu.",
+"Files" => "Dateien",
+"Text" => "Text",
+"Images" => "Bilder",
+"%s enter the database username." => "%s geben Sie den Datenbank-Benutzernamen an.",
+"%s enter the database name." => "%s geben Sie den Datenbank-Namen an.",
+"%s you may not use dots in the database name" => "%s Der Datenbank-Name darf keine Punkte enthalten",
+"MS SQL username and/or password not valid: %s" => "MS SQL Benutzername und/oder Passwort ungültig: %s",
+"You need to enter either an existing account or the administrator." => "Sie müssen entweder ein existierendes Benutzerkonto oder das Administratoren-Konto angeben.",
+"MySQL username and/or password not valid" => "MySQL Benutzername und/oder Passwort ungültig",
+"DB Error: \"%s\"" => "DB Fehler: \"%s\"",
+"Offending command was: \"%s\"" => "Fehlerhafter Befehl war: \"%s\"",
+"MySQL user '%s'@'localhost' exists already." => "MySQL Benutzer '%s'@'localhost' existiert bereits.",
+"Drop this user from MySQL" => "Lösche diesen Benutzer aus MySQL",
+"MySQL user '%s'@'%%' already exists" => "MySQL Benutzer '%s'@'%%' existiert bereits",
+"Drop this user from MySQL." => "Lösche diesen Benutzer aus MySQL.",
+"Oracle connection could not be established" => "Die Oracle-Verbindung konnte nicht aufgebaut werden.",
+"Oracle username and/or password not valid" => "Oracle Benutzername und/oder Passwort ungültig",
+"Offending command was: \"%s\", name: %s, password: %s" => "Fehlerhafter Befehl war: \"%s\", Name: %s, Passwort: %s",
+"PostgreSQL username and/or password not valid" => "PostgreSQL Benutzername und/oder Passwort ungültig",
+"Set an admin username." => "Setze Administrator Benutzername.",
+"Set an admin password." => "Setze Administrator Passwort",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für eine Datei-Synchronisation konfiguriert, weil die WebDAV-Schnittstelle vermutlich defekt ist.",
+"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.",
+"seconds ago" => "Gerade eben",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"today" => "Heute",
+"yesterday" => "Gestern",
+"_%n day go_::_%n days ago_" => array("",""),
+"last month" => "Letzten Monat",
+"_%n month ago_::_%n months ago_" => array("",""),
+"last year" => "Letztes Jahr",
+"years ago" => "Vor Jahren",
+"Caused by:" => "Verursacht durch:",
+"Could not find category \"%s\"" => "Die Kategorie «%s» konnte nicht gefunden werden."
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php
index 823d423abcd..698a36bd780 100644
--- a/lib/l10n/de_DE.php
+++ b/lib/l10n/de_DE.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hilfe",
"Personal" => "Persönlich",
"Settings" => "Einstellungen",
"Users" => "Benutzer",
-"Apps" => "Apps",
"Admin" => "Administrator",
+"Failed to upgrade \"%s\"." => "Konnte \"%s\" nicht aktualisieren.",
"web services under your control" => "Web-Services unter Ihrer Kontrolle",
+"cannot open \"%s\"" => "Öffnen von \"%s\" fehlgeschlagen",
"ZIP download is turned off." => "Der ZIP-Download ist deaktiviert.",
"Files need to be downloaded one by one." => "Die Dateien müssen einzeln heruntergeladen werden.",
"Back to Files" => "Zurück zu \"Dateien\"",
"Selected files too large to generate zip file." => "Die gewählten Dateien sind zu groß, um eine ZIP-Datei zu erstellen.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Laden Sie die Dateien in kleineren, separaten, Stücken herunter oder bitten Sie Ihren Administrator.",
"couldn't be determined" => "konnte nicht ermittelt werden",
"Application is not enabled" => "Die Anwendung ist nicht aktiviert",
"Authentication error" => "Authentifizierungs-Fehler",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für eine Datei-Synchronisation konfiguriert, weil die WebDAV-Schnittstelle vermutlich defekt ist.",
"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.",
"seconds ago" => "Gerade eben",
-"1 minute ago" => "Vor 1 Minute",
-"%d minutes ago" => "Vor %d Minuten",
-"1 hour ago" => "Vor einer Stunde",
-"%d hours ago" => "Vor %d Stunden",
+"_%n minute ago_::_%n minutes ago_" => array("Vor %n Minute","Vor %n Minuten"),
+"_%n hour ago_::_%n hours ago_" => array("Vor %n Stunde","Vor %n Stunden"),
"today" => "Heute",
"yesterday" => "Gestern",
-"%d days ago" => "Vor %d Tag(en)",
+"_%n day go_::_%n days ago_" => array("Vor %n Tag","Vor %n Tagen"),
"last month" => "Letzten Monat",
-"%d months ago" => "Vor %d Monaten",
+"_%n month ago_::_%n months ago_" => array("Vor %n Monat","Vor %n Monaten"),
"last year" => "Letztes Jahr",
"years ago" => "Vor Jahren",
+"Caused by:" => "Verursacht durch:",
"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden."
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/el.php b/lib/l10n/el.php
index 3e876aefdfe..0fbd134ae92 100644
--- a/lib/l10n/el.php
+++ b/lib/l10n/el.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Βοήθεια",
"Personal" => "Προσωπικά",
"Settings" => "Ρυθμίσεις",
"Users" => "Χρήστες",
-"Apps" => "Εφαρμογές",
"Admin" => "Διαχειριστής",
+"Failed to upgrade \"%s\"." => "Αποτυχία αναβάθμισης του \"%s\".",
"web services under your control" => "υπηρεσίες δικτύου υπό τον έλεγχό σας",
+"cannot open \"%s\"" => "αδυναμία ανοίγματος \"%s\"",
"ZIP download is turned off." => "Η λήψη ZIP απενεργοποιήθηκε.",
"Files need to be downloaded one by one." => "Τα αρχεία πρέπει να ληφθούν ένα-ένα.",
"Back to Files" => "Πίσω στα Αρχεία",
"Selected files too large to generate zip file." => "Τα επιλεγμένα αρχεία είναι μεγάλα ώστε να δημιουργηθεί αρχείο zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Λήψη των αρχείων σε μικρότερα κομμάτια, χωριστά ή ρωτήστε τον διαχειριστή σας.",
"couldn't be determined" => "δεν μπορούσε να προσδιορισθεί",
"Application is not enabled" => "Δεν ενεργοποιήθηκε η εφαρμογή",
"Authentication error" => "Σφάλμα πιστοποίησης",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ο διακομιστής σας δεν έχει ρυθμιστεί κατάλληλα ώστε να επιτρέπει τον συγχρονισμό αρχείων γιατί η διεπαφή WebDAV πιθανόν να είναι κατεστραμμένη.",
"Please double check the <a href='%s'>installation guides</a>." => "Ελέγξτε ξανά τις <a href='%s'>οδηγίες εγκατάστασης</a>.",
"seconds ago" => "δευτερόλεπτα πριν",
-"1 minute ago" => "1 λεπτό πριν",
-"%d minutes ago" => "%d λεπτά πριν",
-"1 hour ago" => "1 ώρα πριν",
-"%d hours ago" => "%d ώρες πριν",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "σήμερα",
"yesterday" => "χτες",
-"%d days ago" => "%d ημέρες πριν",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "τελευταίο μήνα",
-"%d months ago" => "%d μήνες πριν",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "τελευταίο χρόνο",
"years ago" => "χρόνια πριν",
+"Caused by:" => "Προκλήθηκε από:",
"Could not find category \"%s\"" => "Αδυναμία εύρεσης κατηγορίας \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/en@pirate.php b/lib/l10n/en@pirate.php
index 02ff0331e05..a8175b1400f 100644
--- a/lib/l10n/en@pirate.php
+++ b/lib/l10n/en@pirate.php
@@ -1,3 +1,9 @@
-<?php $TRANSLATIONS = array(
-"web services under your control" => "web services under your control"
+<?php
+$TRANSLATIONS = array(
+"web services under your control" => "web services under your control",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/eo.php b/lib/l10n/eo.php
index fd45f30c69b..5311dd6eb15 100644
--- a/lib/l10n/eo.php
+++ b/lib/l10n/eo.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Helpo",
"Personal" => "Persona",
"Settings" => "Agordo",
"Users" => "Uzantoj",
-"Apps" => "Aplikaĵoj",
"Admin" => "Administranto",
"web services under your control" => "TTT-servoj regataj de vi",
"ZIP download is turned off." => "ZIP-elŝuto estas malkapabligita.",
@@ -34,16 +34,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Via TTT-servilo ankoraŭ ne ĝuste agordiĝis por permesi sinkronigi dosierojn ĉar la WebDAV-interfaco ŝajnas rompita.",
"Please double check the <a href='%s'>installation guides</a>." => "Bonvolu duoble kontroli la <a href='%s'>gvidilon por instalo</a>.",
"seconds ago" => "sekundoj antaŭe",
-"1 minute ago" => "antaŭ 1 minuto",
-"%d minutes ago" => "antaŭ %d minutoj",
-"1 hour ago" => "antaŭ 1 horo",
-"%d hours ago" => "antaŭ %d horoj",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "hodiaŭ",
"yesterday" => "hieraŭ",
-"%d days ago" => "antaŭ %d tagoj",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "lastamonate",
-"%d months ago" => "antaŭ %d monatoj",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "lastajare",
"years ago" => "jaroj antaŭe",
"Could not find category \"%s\"" => "Ne troviĝis kategorio “%s”"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/es.php b/lib/l10n/es.php
index 1f243a224e4..2029c9b17fe 100644
--- a/lib/l10n/es.php
+++ b/lib/l10n/es.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ayuda",
"Personal" => "Personal",
"Settings" => "Ajustes",
"Users" => "Usuarios",
-"Apps" => "Aplicaciones",
"Admin" => "Administración",
+"Failed to upgrade \"%s\"." => "Falló la actualización \"%s\".",
"web services under your control" => "Servicios web bajo su control",
+"cannot open \"%s\"" => "No se puede abrir \"%s\"",
"ZIP download is turned off." => "La descarga en ZIP está desactivada.",
"Files need to be downloaded one by one." => "Los archivos deben ser descargados uno por uno.",
"Back to Files" => "Volver a Archivos",
"Selected files too large to generate zip file." => "Los archivos seleccionados son demasiado grandes para generar el archivo zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Descargue los archivos en trozos más pequeños, por separado o solicítelos amablemente su administrador.",
"couldn't be determined" => "no pudo ser determinado",
"Application is not enabled" => "La aplicación no está habilitada",
"Authentication error" => "Error de autenticación",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Su servidor web aún no está configurado adecuadamente para permitir sincronización de archivos ya que la interfaz WebDAV parece no estar funcionando.",
"Please double check the <a href='%s'>installation guides</a>." => "Por favor, vuelva a comprobar las <a href='%s'>guías de instalación</a>.",
"seconds ago" => "hace segundos",
-"1 minute ago" => "hace 1 minuto",
-"%d minutes ago" => "hace %d minutos",
-"1 hour ago" => "Hace 1 hora",
-"%d hours ago" => "Hace %d horas",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "hoy",
"yesterday" => "ayer",
-"%d days ago" => "hace %d días",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "mes pasado",
-"%d months ago" => "Hace %d meses",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "año pasado",
"years ago" => "hace años",
+"Caused by:" => "Causado por:",
"Could not find category \"%s\"" => "No puede encontrar la categoria \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/es_AR.php b/lib/l10n/es_AR.php
index cd1a0fbb530..0632c754052 100644
--- a/lib/l10n/es_AR.php
+++ b/lib/l10n/es_AR.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ayuda",
"Personal" => "Personal",
"Settings" => "Configuración",
"Users" => "Usuarios",
-"Apps" => "Apps",
"Admin" => "Administración",
+"Failed to upgrade \"%s\"." => "No se pudo actualizar \"%s\".",
"web services under your control" => "servicios web sobre los que tenés control",
+"cannot open \"%s\"" => "no se puede abrir \"%s\"",
"ZIP download is turned off." => "La descarga en ZIP está desactivada.",
"Files need to be downloaded one by one." => "Los archivos deben ser descargados de a uno.",
"Back to Files" => "Volver a Archivos",
"Selected files too large to generate zip file." => "Los archivos seleccionados son demasiado grandes para generar el archivo zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Descargá los archivos en partes más chicas, de forma separada, o pedíselos al administrador",
"couldn't be determined" => "no se pudo determinar",
"Application is not enabled" => "La aplicación no está habilitada",
"Authentication error" => "Error al autenticar",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Tu servidor web no está configurado todavía para permitir sincronización de archivos porque la interfaz WebDAV parece no funcionar.",
"Please double check the <a href='%s'>installation guides</a>." => "Por favor, comprobá nuevamente la <a href='%s'>guía de instalación</a>.",
"seconds ago" => "segundos atrás",
-"1 minute ago" => "hace 1 minuto",
-"%d minutes ago" => "hace %d minutos",
-"1 hour ago" => "hace 1 hora",
-"%d hours ago" => "hace %d horas",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "hoy",
"yesterday" => "ayer",
-"%d days ago" => "hace %d días",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "el mes pasado",
-"%d months ago" => "hace %d meses",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "el año pasado",
"years ago" => "años atrás",
+"Caused by:" => "Provocado por:",
"Could not find category \"%s\"" => "No fue posible encontrar la categoría \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php
index 4da2c36d6ac..a7d823a62c1 100644
--- a/lib/l10n/et_EE.php
+++ b/lib/l10n/et_EE.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Abiinfo",
"Personal" => "Isiklik",
"Settings" => "Seaded",
"Users" => "Kasutajad",
-"Apps" => "Rakendused",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "Ebaõnnestunud uuendus \"%s\".",
"web services under your control" => "veebitenused sinu kontrolli all",
+"cannot open \"%s\"" => "ei suuda avada \"%s\"",
"ZIP download is turned off." => "ZIP-ina allalaadimine on välja lülitatud.",
"Files need to be downloaded one by one." => "Failid tuleb alla laadida ükshaaval.",
"Back to Files" => "Tagasi failide juurde",
"Selected files too large to generate zip file." => "Valitud failid on ZIP-faili loomiseks liiga suured.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Laadi failid alla eraldi väiksemate osadena või küsi nõu oma süsteemiadminstraatorilt.",
"couldn't be determined" => "ei suudetud tuvastada",
"Application is not enabled" => "Rakendus pole sisse lülitatud",
"Authentication error" => "Autentimise viga",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Veebiserveri ei ole veel korralikult seadistatud võimaldamaks failide sünkroniseerimist, kuna WebDAV liides näib olevat mittetoimiv.",
"Please double check the <a href='%s'>installation guides</a>." => "Palun tutvu veelkord <a href='%s'>paigalduse juhenditega</a>.",
"seconds ago" => "sekundit tagasi",
-"1 minute ago" => "1 minut tagasi",
-"%d minutes ago" => "%d minutit tagasi",
-"1 hour ago" => "1 tund tagasi",
-"%d hours ago" => "%d tundi tagasi",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "täna",
"yesterday" => "eile",
-"%d days ago" => "%d päeva tagasi",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "viimasel kuul",
-"%d months ago" => "%d kuud tagasi",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "viimasel aastal",
"years ago" => "aastat tagasi",
+"Caused by:" => "Põhjustaja:",
"Could not find category \"%s\"" => "Ei leia kategooriat \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/eu.php b/lib/l10n/eu.php
index 131ac6d7daa..c5ce243f2fa 100644
--- a/lib/l10n/eu.php
+++ b/lib/l10n/eu.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Laguntza",
"Personal" => "Pertsonala",
"Settings" => "Ezarpenak",
"Users" => "Erabiltzaileak",
-"Apps" => "Aplikazioak",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "Ezin izan da \"%s\" eguneratu.",
"web services under your control" => "web zerbitzuak zure kontrolpean",
+"cannot open \"%s\"" => "ezin da \"%s\" ireki",
"ZIP download is turned off." => "ZIP deskarga ez dago gaituta.",
"Files need to be downloaded one by one." => "Fitxategiak banan-banan deskargatu behar dira.",
"Back to Files" => "Itzuli fitxategietara",
"Selected files too large to generate zip file." => "Hautatuko fitxategiak oso handiak dira zip fitxategia sortzeko.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Deskargatu fitzategiak zati txikiagoetan, banan-banan edo eskatu mesedez zure administradoreari",
"couldn't be determined" => "ezin izan da zehaztu",
"Application is not enabled" => "Aplikazioa ez dago gaituta",
"Authentication error" => "Autentifikazio errorea",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Zure web zerbitzaria ez dago oraindik ongi konfiguratuta fitxategien sinkronizazioa egiteko, WebDAV interfazea ongi ez dagoela dirudi.",
"Please double check the <a href='%s'>installation guides</a>." => "Mesedez begiratu <a href='%s'>instalazio gidak</a>.",
"seconds ago" => "segundu",
-"1 minute ago" => "orain dela minutu 1",
-"%d minutes ago" => "orain dela %d minutu",
-"1 hour ago" => "orain dela ordu bat",
-"%d hours ago" => "orain dela %d ordu",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "gaur",
"yesterday" => "atzo",
-"%d days ago" => "orain dela %d egun",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "joan den hilabetean",
-"%d months ago" => "orain dela %d hilabete",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "joan den urtean",
"years ago" => "urte",
+"Caused by:" => "Honek eraginda:",
"Could not find category \"%s\"" => "Ezin da \"%s\" kategoria aurkitu"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/fa.php b/lib/l10n/fa.php
index 40a778e2126..e2d8ed50aa3 100644
--- a/lib/l10n/fa.php
+++ b/lib/l10n/fa.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "راه‌نما",
"Personal" => "شخصی",
"Settings" => "تنظیمات",
"Users" => "کاربران",
-"Apps" => " برنامه ها",
"Admin" => "مدیر",
"web services under your control" => "سرویس های تحت وب در کنترل شما",
"ZIP download is turned off." => "دانلود به صورت فشرده غیر فعال است",
@@ -38,16 +38,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "احتمالاً وب سرور شما طوری تنظیم نشده است که اجازه ی همگام سازی فایلها را بدهد زیرا به نظر میرسد رابط WebDAV از کار افتاده است.",
"Please double check the <a href='%s'>installation guides</a>." => "لطفاً دوباره <a href='%s'>راهنمای نصب</a>را بررسی کنید.",
"seconds ago" => "ثانیه‌ها پیش",
-"1 minute ago" => "1 دقیقه پیش",
-"%d minutes ago" => "%d دقیقه پیش",
-"1 hour ago" => "1 ساعت پیش",
-"%d hours ago" => "%d ساعت پیش",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "امروز",
"yesterday" => "دیروز",
-"%d days ago" => "%d روز پیش",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "ماه قبل",
-"%d months ago" => "%dماه پیش",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "سال قبل",
"years ago" => "سال‌های قبل",
"Could not find category \"%s\"" => "دسته بندی %s یافت نشد"
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/fi.php b/lib/l10n/fi.php
index daaddb25e48..ac1f80a8f73 100644
--- a/lib/l10n/fi.php
+++ b/lib/l10n/fi.php
@@ -1,3 +1,5 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Settings" => "asetukset"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php
index 75576c3034d..dccb1753042 100644
--- a/lib/l10n/fi_FI.php
+++ b/lib/l10n/fi_FI.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ohje",
"Personal" => "Henkilökohtainen",
"Settings" => "Asetukset",
"Users" => "Käyttäjät",
-"Apps" => "Sovellukset",
"Admin" => "Ylläpitäjä",
"web services under your control" => "verkkopalvelut hallinnassasi",
"ZIP download is turned off." => "ZIP-lataus on poistettu käytöstä.",
@@ -34,16 +34,16 @@
"Set an admin password." => "Aseta ylläpitäjän salasana.",
"Please double check the <a href='%s'>installation guides</a>." => "Lue tarkasti <a href='%s'>asennusohjeet</a>.",
"seconds ago" => "sekuntia sitten",
-"1 minute ago" => "1 minuutti sitten",
-"%d minutes ago" => "%d minuuttia sitten",
-"1 hour ago" => "1 tunti sitten",
-"%d hours ago" => "%d tuntia sitten",
+"_%n minute ago_::_%n minutes ago_" => array("%n minuutti sitten","%n minuuttia sitten"),
+"_%n hour ago_::_%n hours ago_" => array("%n tunti sitten","%n tuntia sitten"),
"today" => "tänään",
"yesterday" => "eilen",
-"%d days ago" => "%d päivää sitten",
+"_%n day go_::_%n days ago_" => array("%n päivä sitten","%n päivää sitten"),
"last month" => "viime kuussa",
-"%d months ago" => "%d kuukautta sitten",
+"_%n month ago_::_%n months ago_" => array("%n kuukausi sitten","%n kuukautta sitten"),
"last year" => "viime vuonna",
"years ago" => "vuotta sitten",
+"Caused by:" => "Aiheuttaja:",
"Could not find category \"%s\"" => "Luokkaa \"%s\" ei löytynyt"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php
index 9f30b602696..0a040bb9e8e 100644
--- a/lib/l10n/fr.php
+++ b/lib/l10n/fr.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Aide",
"Personal" => "Personnel",
"Settings" => "Paramètres",
"Users" => "Utilisateurs",
-"Apps" => "Applications",
"Admin" => "Administration",
"web services under your control" => "services web sous votre contrôle",
"ZIP download is turned off." => "Téléchargement ZIP désactivé.",
@@ -38,16 +38,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Votre serveur web, n'est pas correctement configuré pour permettre la synchronisation des fichiers, car l'interface WebDav ne fonctionne pas comme il faut.",
"Please double check the <a href='%s'>installation guides</a>." => "Veuillez vous référer au <a href='%s'>guide d'installation</a>.",
"seconds ago" => "il y a quelques secondes",
-"1 minute ago" => "il y a une minute",
-"%d minutes ago" => "il y a %d minutes",
-"1 hour ago" => "Il y a une heure",
-"%d hours ago" => "Il y a %d heures",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "aujourd'hui",
"yesterday" => "hier",
-"%d days ago" => "il y a %d jours",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "le mois dernier",
-"%d months ago" => "Il y a %d mois",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "l'année dernière",
"years ago" => "il y a plusieurs années",
"Could not find category \"%s\"" => "Impossible de trouver la catégorie \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n > 1);";
diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php
index 351f18c7155..f105578ace2 100644
--- a/lib/l10n/gl.php
+++ b/lib/l10n/gl.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Axuda",
"Personal" => "Persoal",
"Settings" => "Axustes",
"Users" => "Usuarios",
-"Apps" => "Aplicativos",
"Admin" => "Administración",
+"Failed to upgrade \"%s\"." => "Non foi posíbel anovar «%s».",
"web services under your control" => "servizos web baixo o seu control",
+"cannot open \"%s\"" => "non foi posíbel abrir «%s»",
"ZIP download is turned off." => "As descargas ZIP están desactivadas.",
"Files need to be downloaded one by one." => "Os ficheiros necesitan seren descargados dun en un.",
"Back to Files" => "Volver aos ficheiros",
"Selected files too large to generate zip file." => "Os ficheiros seleccionados son demasiado grandes como para xerar un ficheiro zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Descargue os ficheiros en cachos máis pequenos e por separado, ou pídallos amabelmente ao seu administrador.",
"couldn't be determined" => "non foi posíbel determinalo",
"Application is not enabled" => "O aplicativo non está activado",
"Authentication error" => "Produciuse un erro de autenticación",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web non está aínda configurado adecuadamente para permitir a sincronización de ficheiros xa que semella que a interface WebDAV non está a funcionar.",
"Please double check the <a href='%s'>installation guides</a>." => "Volva comprobar as <a href='%s'>guías de instalación</a>",
"seconds ago" => "segundos atrás",
-"1 minute ago" => "hai 1 minuto",
-"%d minutes ago" => "hai %d minutos",
-"1 hour ago" => "Vai 1 hora",
-"%d hours ago" => "Vai %d horas",
+"_%n minute ago_::_%n minutes ago_" => array("hai %n minuto","hai %n minutos"),
+"_%n hour ago_::_%n hours ago_" => array("hai %n hora","hai %n horas"),
"today" => "hoxe",
"yesterday" => "onte",
-"%d days ago" => "hai %d días",
+"_%n day go_::_%n days ago_" => array("hai %n día","hai %n días"),
"last month" => "último mes",
-"%d months ago" => "Vai %d meses",
+"_%n month ago_::_%n months ago_" => array("hai %n mes","hai %n meses"),
"last year" => "último ano",
"years ago" => "anos atrás",
+"Caused by:" => "Causado por:",
"Could not find category \"%s\"" => "Non foi posíbel atopar a categoría «%s»"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/he.php b/lib/l10n/he.php
index 2e011e342a0..bab1a6ff424 100644
--- a/lib/l10n/he.php
+++ b/lib/l10n/he.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "עזרה",
"Personal" => "אישי",
"Settings" => "הגדרות",
"Users" => "משתמשים",
-"Apps" => "יישומים",
"Admin" => "מנהל",
"web services under your control" => "שירותי רשת תחת השליטה שלך",
"ZIP download is turned off." => "הורדת ZIP כבויה",
@@ -19,16 +19,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "שרת האינטרנט שלך אינו מוגדר לצורכי סנכרון קבצים עדיין כיוון שמנשק ה־WebDAV כנראה אינו תקין.",
"Please double check the <a href='%s'>installation guides</a>." => "נא לעיין שוב ב<a href='%s'>מדריכי ההתקנה</a>.",
"seconds ago" => "שניות",
-"1 minute ago" => "לפני דקה אחת",
-"%d minutes ago" => "לפני %d דקות",
-"1 hour ago" => "לפני שעה",
-"%d hours ago" => "לפני %d שעות",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "היום",
"yesterday" => "אתמול",
-"%d days ago" => "לפני %d ימים",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "חודש שעבר",
-"%d months ago" => "לפני %d חודשים",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "שנה שעברה",
"years ago" => "שנים",
"Could not find category \"%s\"" => "לא ניתן למצוא את הקטגוריה „%s“"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/hi.php b/lib/l10n/hi.php
index f507993f494..039dfa4465d 100644
--- a/lib/l10n/hi.php
+++ b/lib/l10n/hi.php
@@ -1,7 +1,12 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "सहयोग",
"Personal" => "यक्तिगत",
"Settings" => "सेटिंग्स",
"Users" => "उपयोगकर्ता",
-"Apps" => "Apps"
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/hr.php b/lib/l10n/hr.php
index 41c34d3108c..d217f924099 100644
--- a/lib/l10n/hr.php
+++ b/lib/l10n/hr.php
@@ -1,18 +1,23 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Pomoć",
"Personal" => "Osobno",
"Settings" => "Postavke",
"Users" => "Korisnici",
-"Apps" => "Aplikacije",
"Admin" => "Administrator",
"web services under your control" => "web usluge pod vašom kontrolom",
"Authentication error" => "Greška kod autorizacije",
"Files" => "Datoteke",
"Text" => "Tekst",
"seconds ago" => "sekundi prije",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "danas",
"yesterday" => "jučer",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "prošli mjesec",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "prošlu godinu",
"years ago" => "godina"
);
+$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;";
diff --git a/lib/l10n/hu_HU.php b/lib/l10n/hu_HU.php
index 3aa04274fa3..c8aff3add72 100644
--- a/lib/l10n/hu_HU.php
+++ b/lib/l10n/hu_HU.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Súgó",
"Personal" => "Személyes",
"Settings" => "Beállítások",
"Users" => "Felhasználók",
-"Apps" => "Alkalmazások",
"Admin" => "Adminsztráció",
+"Failed to upgrade \"%s\"." => "Sikertelen Frissítés \"%s\".",
"web services under your control" => "webszolgáltatások saját kézben",
+"cannot open \"%s\"" => "nem sikerült megnyitni \"%s\"",
"ZIP download is turned off." => "A ZIP-letöltés nincs engedélyezve.",
"Files need to be downloaded one by one." => "A fájlokat egyenként kell letölteni.",
"Back to Files" => "Vissza a Fájlokhoz",
"Selected files too large to generate zip file." => "A kiválasztott fájlok túl nagyok a zip tömörítéshez.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Tölts le a fileokat kisebb chunkokban, kölün vagy kérj segitséget a rendszergazdádtól.",
"couldn't be determined" => "nem határozható meg",
"Application is not enabled" => "Az alkalmazás nincs engedélyezve",
"Authentication error" => "Azonosítási hiba",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Az Ön webkiszolgálója nincs megfelelően beállítva az állományok szinkronizálásához, mert a WebDAV-elérés úgy tűnik, nem működik.",
"Please double check the <a href='%s'>installation guides</a>." => "Kérjük tüzetesen tanulmányozza át a <a href='%s'>telepítési útmutatót</a>.",
"seconds ago" => "pár másodperce",
-"1 minute ago" => "1 perce",
-"%d minutes ago" => "%d perce",
-"1 hour ago" => "1 órája",
-"%d hours ago" => "%d órája",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "ma",
"yesterday" => "tegnap",
-"%d days ago" => "%d napja",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "múlt hónapban",
-"%d months ago" => "%d hónapja",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "tavaly",
"years ago" => "több éve",
+"Caused by:" => "Okozta:",
"Could not find category \"%s\"" => "Ez a kategória nem található: \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/hy.php b/lib/l10n/hy.php
new file mode 100644
index 00000000000..15f78e0bce6
--- /dev/null
+++ b/lib/l10n/hy.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/ia.php b/lib/l10n/ia.php
index e5f6e3ddf58..34f43bc424a 100644
--- a/lib/l10n/ia.php
+++ b/lib/l10n/ia.php
@@ -1,11 +1,16 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Adjuta",
"Personal" => "Personal",
"Settings" => "Configurationes",
"Users" => "Usatores",
-"Apps" => "Applicationes",
"Admin" => "Administration",
"web services under your control" => "servicios web sub tu controlo",
"Files" => "Files",
-"Text" => "Texto"
+"Text" => "Texto",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/id.php b/lib/l10n/id.php
index c247651f0c9..eaec65516b8 100644
--- a/lib/l10n/id.php
+++ b/lib/l10n/id.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Bantuan",
"Personal" => "Pribadi",
"Settings" => "Setelan",
"Users" => "Pengguna",
-"Apps" => "Aplikasi",
"Admin" => "Admin",
"web services under your control" => "layanan web dalam kontrol Anda",
"ZIP download is turned off." => "Pengunduhan ZIP dimatikan.",
@@ -37,16 +37,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web server Anda belum dikonfigurasikan dengan baik untuk mengizinkan sinkronisasi berkas karena tampaknya antarmuka WebDAV rusak.",
"Please double check the <a href='%s'>installation guides</a>." => "Silakan periksa ulang <a href='%s'>panduan instalasi</a>.",
"seconds ago" => "beberapa detik yang lalu",
-"1 minute ago" => "1 menit yang lalu",
-"%d minutes ago" => "%d menit yang lalu",
-"1 hour ago" => "1 jam yang lalu",
-"%d hours ago" => "%d jam yang lalu",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "hari ini",
"yesterday" => "kemarin",
-"%d days ago" => "%d hari yang lalu",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "bulan kemarin",
-"%d months ago" => "%d bulan yang lalu",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "tahun kemarin",
"years ago" => "beberapa tahun lalu",
"Could not find category \"%s\"" => "Tidak dapat menemukan kategori \"%s\""
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/is.php b/lib/l10n/is.php
index 0f7a22fd13e..7512d278fb8 100644
--- a/lib/l10n/is.php
+++ b/lib/l10n/is.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hjálp",
"Personal" => "Um mig",
"Settings" => "Stillingar",
"Users" => "Notendur",
-"Apps" => "Forrit",
"Admin" => "Stjórnun",
"web services under your control" => "vefþjónusta undir þinni stjórn",
"ZIP download is turned off." => "Slökkt á ZIP niðurhali.",
@@ -17,16 +17,15 @@
"Text" => "Texti",
"Images" => "Myndir",
"seconds ago" => "sek.",
-"1 minute ago" => "Fyrir 1 mínútu",
-"%d minutes ago" => "fyrir %d mínútum",
-"1 hour ago" => "Fyrir 1 klst.",
-"%d hours ago" => "fyrir %d klst.",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "í dag",
"yesterday" => "í gær",
-"%d days ago" => "fyrir %d dögum",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "síðasta mánuði",
-"%d months ago" => "fyrir %d mánuðum",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "síðasta ári",
"years ago" => "einhverjum árum",
"Could not find category \"%s\"" => "Fann ekki flokkinn \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/it.php b/lib/l10n/it.php
index 74483315ca0..c29ab4833e3 100644
--- a/lib/l10n/it.php
+++ b/lib/l10n/it.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Aiuto",
"Personal" => "Personale",
"Settings" => "Impostazioni",
"Users" => "Utenti",
-"Apps" => "Applicazioni",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "Aggiornamento non riuscito \"%s\".",
"web services under your control" => "servizi web nelle tue mani",
+"cannot open \"%s\"" => "impossibile aprire \"%s\"",
"ZIP download is turned off." => "Lo scaricamento in formato ZIP è stato disabilitato.",
"Files need to be downloaded one by one." => "I file devono essere scaricati uno alla volta.",
"Back to Files" => "Torna ai file",
"Selected files too large to generate zip file." => "I file selezionati sono troppo grandi per generare un file zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Scarica i file in blocchi più piccoli, separatamente o chiedi al tuo amministratore.",
"couldn't be determined" => "non può essere determinato",
"Application is not enabled" => "L'applicazione non è abilitata",
"Authentication error" => "Errore di autenticazione",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Il tuo server web non è configurato correttamente per consentire la sincronizzazione dei file poiché l'interfaccia WebDAV sembra essere danneggiata.",
"Please double check the <a href='%s'>installation guides</a>." => "Leggi attentamente le <a href='%s'>guide d'installazione</a>.",
"seconds ago" => "secondi fa",
-"1 minute ago" => "Un minuto fa",
-"%d minutes ago" => "%d minuti fa",
-"1 hour ago" => "1 ora fa",
-"%d hours ago" => "%d ore fa",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "oggi",
"yesterday" => "ieri",
-"%d days ago" => "%d giorni fa",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "mese scorso",
-"%d months ago" => "%d mesi fa",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "anno scorso",
"years ago" => "anni fa",
+"Caused by:" => "Causato da:",
"Could not find category \"%s\"" => "Impossibile trovare la categoria \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/ja_JP.php b/lib/l10n/ja_JP.php
index 36d06d360b9..482806d4946 100644
--- a/lib/l10n/ja_JP.php
+++ b/lib/l10n/ja_JP.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "ヘルプ",
"Personal" => "個人",
"Settings" => "設定",
"Users" => "ユーザ",
-"Apps" => "アプリ",
"Admin" => "管理",
+"Failed to upgrade \"%s\"." => "\"%s\" へのアップグレードに失敗しました。",
"web services under your control" => "管理下のウェブサービス",
+"cannot open \"%s\"" => "\"%s\" が開けません",
"ZIP download is turned off." => "ZIPダウンロードは無効です。",
"Files need to be downloaded one by one." => "ファイルは1つずつダウンロードする必要があります。",
"Back to Files" => "ファイルに戻る",
"Selected files too large to generate zip file." => "選択したファイルはZIPファイルの生成には大きすぎます。",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "ファイルは、小さいファイルに分割されてダウンロードされます。もしくは、管理者にお尋ねください。",
"couldn't be determined" => "測定できませんでした",
"Application is not enabled" => "アプリケーションは無効です",
"Authentication error" => "認証エラー",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "WebDAVインタフェースが動作していないと考えられるため、あなたのWEBサーバはまだファイルの同期を許可するように適切な設定がされていません。",
"Please double check the <a href='%s'>installation guides</a>." => "<a href='%s'>インストールガイド</a>をよく確認してください。",
"seconds ago" => "数秒前",
-"1 minute ago" => "1 分前",
-"%d minutes ago" => "%d 分前",
-"1 hour ago" => "1 時間前",
-"%d hours ago" => "%d 時間前",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "今日",
"yesterday" => "昨日",
-"%d days ago" => "%d 日前",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "一月前",
-"%d months ago" => "%d 分前",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "一年前",
"years ago" => "年前",
+"Caused by:" => "原因は以下:",
"Could not find category \"%s\"" => "カテゴリ \"%s\" が見つかりませんでした"
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/ka.php b/lib/l10n/ka.php
index e5a3e659668..04fefe8bdf1 100644
--- a/lib/l10n/ka.php
+++ b/lib/l10n/ka.php
@@ -1,4 +1,5 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "შველა",
"Personal" => "პერსონა",
"Users" => "მომხმარებლები",
@@ -6,10 +7,11 @@
"ZIP download is turned off." => "ZIP გადმოწერა გამორთულია",
"Files" => "ფაილები",
"seconds ago" => "წამის წინ",
-"1 minute ago" => "1 წუთის წინ",
-"%d minutes ago" => "%d წუთის წინ",
-"1 hour ago" => "1 საათის წინ",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "დღეს",
"yesterday" => "გუშინ",
-"%d days ago" => "%d დღის წინ"
+"_%n day go_::_%n days ago_" => array(""),
+"_%n month ago_::_%n months ago_" => array("")
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/ka_GE.php b/lib/l10n/ka_GE.php
index c6e77da2dac..3cb55277d6c 100644
--- a/lib/l10n/ka_GE.php
+++ b/lib/l10n/ka_GE.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "დახმარება",
"Personal" => "პირადი",
"Settings" => "პარამეტრები",
"Users" => "მომხმარებელი",
-"Apps" => "აპლიკაციები",
"Admin" => "ადმინისტრატორი",
"web services under your control" => "web services under your control",
"ZIP download is turned off." => "ZIP download–ი გათიშულია",
@@ -37,16 +37,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "თქვენი web სერვერი არ არის კონფიგურირებული ფაილ სინქრონიზაციისთვის, რადგან WebDAV ინტერფეისი შეიძლება იყოს გატეხილი.",
"Please double check the <a href='%s'>installation guides</a>." => "გთხოვთ გადაათვალიეროთ <a href='%s'>ინსტალაციის გზამკვლევი</a>.",
"seconds ago" => "წამის წინ",
-"1 minute ago" => "1 წუთის წინ",
-"%d minutes ago" => "%d წუთის წინ",
-"1 hour ago" => "1 საათის წინ",
-"%d hours ago" => "%d საათის წინ",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "დღეს",
"yesterday" => "გუშინ",
-"%d days ago" => "%d დღის წინ",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "გასულ თვეში",
-"%d months ago" => "%d თვის წინ",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "ბოლო წელს",
"years ago" => "წლის წინ",
"Could not find category \"%s\"" => "\"%s\" კატეგორიის მოძებნა ვერ მოხერხდა"
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/kn.php b/lib/l10n/kn.php
new file mode 100644
index 00000000000..e7b09649a24
--- /dev/null
+++ b/lib/l10n/kn.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
+"_%n day go_::_%n days ago_" => array(""),
+"_%n month ago_::_%n months ago_" => array("")
+);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/ko.php b/lib/l10n/ko.php
index 1f32ebe402a..824882c984d 100644
--- a/lib/l10n/ko.php
+++ b/lib/l10n/ko.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "도움말",
"Personal" => "개인",
"Settings" => "설정",
"Users" => "사용자",
-"Apps" => "앱",
"Admin" => "관리자",
"web services under your control" => "내가 관리하는 웹 서비스",
"ZIP download is turned off." => "ZIP 다운로드가 비활성화되었습니다.",
@@ -27,16 +27,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "WebDAV 인터페이스가 제대로 작동하지 않습니다. 웹 서버에서 파일 동기화를 사용할 수 있도록 설정이 제대로 되지 않은 것 같습니다.",
"Please double check the <a href='%s'>installation guides</a>." => "<a href='%s'>설치 가이드</a>를 다시 한 번 확인하십시오.",
"seconds ago" => "초 전",
-"1 minute ago" => "1분 전",
-"%d minutes ago" => "%d분 전",
-"1 hour ago" => "1시간 전",
-"%d hours ago" => "%d시간 전",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "오늘",
"yesterday" => "어제",
-"%d days ago" => "%d일 전",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "지난 달",
-"%d months ago" => "%d개월 전",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "작년",
"years ago" => "년 전",
"Could not find category \"%s\"" => "분류 \"%s\"을(를) 찾을 수 없습니다."
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/ku_IQ.php b/lib/l10n/ku_IQ.php
index 6d7461a1685..c99f9dd2a12 100644
--- a/lib/l10n/ku_IQ.php
+++ b/lib/l10n/ku_IQ.php
@@ -1,8 +1,13 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "یارمەتی",
"Settings" => "ده‌ستكاری",
"Users" => "به‌كارهێنه‌ر",
-"Apps" => "به‌رنامه‌كان",
"Admin" => "به‌ڕێوه‌به‌ری سه‌ره‌كی",
-"web services under your control" => "ڕاژه‌ی وێب له‌ژێر چاودێریت دایه"
+"web services under your control" => "ڕاژه‌ی وێب له‌ژێر چاودێریت دایه",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/lb.php b/lib/l10n/lb.php
index 867b0a37409..c25f5b55bd5 100644
--- a/lib/l10n/lb.php
+++ b/lib/l10n/lb.php
@@ -1,20 +1,23 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hëllef",
"Personal" => "Perséinlech",
"Settings" => "Astellungen",
"Users" => "Benotzer",
-"Apps" => "Applikatiounen",
"Admin" => "Admin",
"web services under your control" => "Web-Servicer ënnert denger Kontroll",
"Authentication error" => "Authentifikatioun's Fehler",
"Files" => "Dateien",
"Text" => "SMS",
"seconds ago" => "Sekonnen hir",
-"1 minute ago" => "1 Minutt hir",
-"1 hour ago" => "vrun 1 Stonn",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "haut",
"yesterday" => "gëschter",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "Läschte Mount",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "Läscht Joer",
"years ago" => "Joren hier"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/lt_LT.php b/lib/l10n/lt_LT.php
index 5e3a0482033..fb109b86339 100644
--- a/lib/l10n/lt_LT.php
+++ b/lib/l10n/lt_LT.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Pagalba",
"Personal" => "Asmeniniai",
"Settings" => "Nustatymai",
"Users" => "Vartotojai",
-"Apps" => "Programos",
"Admin" => "Administravimas",
"web services under your control" => "jūsų valdomos web paslaugos",
"ZIP download is turned off." => "ZIP atsisiuntimo galimybė yra išjungta.",
@@ -17,15 +17,14 @@
"Text" => "Žinučių",
"Images" => "Paveikslėliai",
"seconds ago" => "prieš sekundę",
-"1 minute ago" => "Prieš 1 minutę",
-"%d minutes ago" => "prieš %d minučių",
-"1 hour ago" => "prieš 1 valandą",
-"%d hours ago" => "prieš %d valandų",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "šiandien",
"yesterday" => "vakar",
-"%d days ago" => "prieš %d dienų",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "praeitą mėnesį",
-"%d months ago" => "prieš %d mėnesių",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "praeitais metais",
"years ago" => "prieš metus"
);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/lib/l10n/lv.php b/lib/l10n/lv.php
index 662f4d5b245..2a2daee8d89 100644
--- a/lib/l10n/lv.php
+++ b/lib/l10n/lv.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Palīdzība",
"Personal" => "Personīgi",
"Settings" => "Iestatījumi",
"Users" => "Lietotāji",
-"Apps" => "Lietotnes",
"Admin" => "Administratori",
"web services under your control" => "tīmekļa servisi tavā varā",
"ZIP download is turned off." => "ZIP lejupielādēšana ir izslēgta.",
@@ -37,16 +37,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Jūsu serveris vēl nav pareizi iestatīts, lai ļautu sinhronizēt datnes, jo izskatās, ka WebDAV saskarne ir salauzta.",
"Please double check the <a href='%s'>installation guides</a>." => "Lūdzu, vēlreiz pārbaudiet <a href='%s'>instalēšanas palīdzību</a>.",
"seconds ago" => "sekundes atpakaļ",
-"1 minute ago" => "pirms 1 minūtes",
-"%d minutes ago" => "pirms %d minūtēm",
-"1 hour ago" => "pirms 1 stundas",
-"%d hours ago" => "pirms %d stundām",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "šodien",
"yesterday" => "vakar",
-"%d days ago" => "pirms %d dienām",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "pagājušajā mēnesī",
-"%d months ago" => "pirms %d mēnešiem",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "gājušajā gadā",
"years ago" => "gadus atpakaļ",
"Could not find category \"%s\"" => "Nevarēja atrast kategoriju “%s”"
);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);";
diff --git a/lib/l10n/mk.php b/lib/l10n/mk.php
index 30fa9ab73c1..69d4a1cb694 100644
--- a/lib/l10n/mk.php
+++ b/lib/l10n/mk.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Помош",
"Personal" => "Лично",
"Settings" => "Подесувања",
"Users" => "Корисници",
-"Apps" => "Аппликации",
"Admin" => "Админ",
"web services under your control" => "веб сервиси под Ваша контрола",
"ZIP download is turned off." => "Преземање во ZIP е исклучено",
@@ -17,16 +17,15 @@
"Text" => "Текст",
"Images" => "Слики",
"seconds ago" => "пред секунди",
-"1 minute ago" => "пред 1 минута",
-"%d minutes ago" => "пред %d минути",
-"1 hour ago" => "пред 1 час",
-"%d hours ago" => "пред %d часови",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "денеска",
"yesterday" => "вчера",
-"%d days ago" => "пред %d денови",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "минатиот месец",
-"%d months ago" => "пред %d месеци",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "минатата година",
"years ago" => "пред години",
"Could not find category \"%s\"" => "Не можам да најдам категорија „%s“"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;";
diff --git a/lib/l10n/ml_IN.php b/lib/l10n/ml_IN.php
new file mode 100644
index 00000000000..15f78e0bce6
--- /dev/null
+++ b/lib/l10n/ml_IN.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/ms_MY.php b/lib/l10n/ms_MY.php
index a2930597971..17ef07f83dd 100644
--- a/lib/l10n/ms_MY.php
+++ b/lib/l10n/ms_MY.php
@@ -1,12 +1,17 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Bantuan",
"Personal" => "Peribadi",
"Settings" => "Tetapan",
"Users" => "Pengguna",
-"Apps" => "Aplikasi",
"Admin" => "Admin",
"web services under your control" => "Perkhidmatan web di bawah kawalan anda",
"Authentication error" => "Ralat pengesahan",
"Files" => "Fail-fail",
-"Text" => "Teks"
+"Text" => "Teks",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
+"_%n day go_::_%n days ago_" => array(""),
+"_%n month ago_::_%n months ago_" => array("")
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/my_MM.php b/lib/l10n/my_MM.php
index f214a1ed794..b2e9ca18139 100644
--- a/lib/l10n/my_MM.php
+++ b/lib/l10n/my_MM.php
@@ -1,7 +1,7 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "အကူအညီ",
"Users" => "သုံးစွဲသူ",
-"Apps" => "Apps",
"Admin" => "အက်ဒမင်",
"web services under your control" => "သင်၏ထိန်းချုပ်မှု့အောက်တွင်ရှိသော Web services",
"ZIP download is turned off." => "ZIP ဒေါင်းလုတ်ကိုပိတ်ထားသည်",
@@ -14,16 +14,15 @@
"Text" => "စာသား",
"Images" => "ပုံရိပ်များ",
"seconds ago" => "စက္ကန့်အနည်းငယ်က",
-"1 minute ago" => "၁ မိနစ်အရင်က",
-"%d minutes ago" => "%d မိနစ်အရင်က",
-"1 hour ago" => "၁ နာရီ အရင်က",
-"%d hours ago" => "%d နာရီအရင်က",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "ယနေ့",
"yesterday" => "မနေ့က",
-"%d days ago" => "%d ရက် အရင်က",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "ပြီးခဲ့သောလ",
-"%d months ago" => "%d လအရင်က",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "မနှစ်က",
"years ago" => "နှစ် အရင်က",
"Could not find category \"%s\"" => "\"%s\"ခေါင်းစဉ်ကို ရှာမတွေ့ပါ"
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/nb_NO.php b/lib/l10n/nb_NO.php
index ab2d4f91920..8e7d095d369 100644
--- a/lib/l10n/nb_NO.php
+++ b/lib/l10n/nb_NO.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hjelp",
"Personal" => "Personlig",
"Settings" => "Innstillinger",
"Users" => "Brukere",
-"Apps" => "Apper",
"Admin" => "Admin",
"web services under your control" => "web tjenester du kontrollerer",
"ZIP download is turned off." => "ZIP-nedlasting av avslått",
@@ -19,16 +19,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din nettservev er ikke konfigurert korrekt for filsynkronisering. WebDAV ser ut til å ikke funkere.",
"Please double check the <a href='%s'>installation guides</a>." => "Vennligst dobbelsjekk <a href='%s'>installasjonsguiden</a>.",
"seconds ago" => "sekunder siden",
-"1 minute ago" => "1 minutt siden",
-"%d minutes ago" => "%d minutter siden",
-"1 hour ago" => "1 time siden",
-"%d hours ago" => "%d timer siden",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "i dag",
"yesterday" => "i går",
-"%d days ago" => "%d dager siden",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "forrige måned",
-"%d months ago" => "%d måneder siden",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "forrige år",
"years ago" => "år siden",
"Could not find category \"%s\"" => "Kunne ikke finne kategori \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/ne.php b/lib/l10n/ne.php
new file mode 100644
index 00000000000..15f78e0bce6
--- /dev/null
+++ b/lib/l10n/ne.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/nl.php b/lib/l10n/nl.php
index de80d1b5d56..2d737bd5ebd 100644
--- a/lib/l10n/nl.php
+++ b/lib/l10n/nl.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Help",
"Personal" => "Persoonlijk",
"Settings" => "Instellingen",
"Users" => "Gebruikers",
-"Apps" => "Apps",
"Admin" => "Beheerder",
+"Failed to upgrade \"%s\"." => "Upgrade \"%s\" mislukt.",
"web services under your control" => "Webdiensten in eigen beheer",
+"cannot open \"%s\"" => "Kon \"%s\" niet openen",
"ZIP download is turned off." => "ZIP download is uitgeschakeld.",
"Files need to be downloaded one by one." => "Bestanden moeten één voor één worden gedownload.",
"Back to Files" => "Terug naar bestanden",
"Selected files too large to generate zip file." => "De geselecteerde bestanden zijn te groot om een zip bestand te maken.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Download de bestanden in kleinere brokken, appart of vraag uw administrator.",
"couldn't be determined" => "kon niet worden vastgesteld",
"Application is not enabled" => "De applicatie is niet actief",
"Authentication error" => "Authenticatie fout",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Uw webserver is nog niet goed ingesteld voor bestandssynchronisatie omdat de WebDAV interface verbroken lijkt.",
"Please double check the <a href='%s'>installation guides</a>." => "Controleer de <a href='%s'>installatiehandleiding</a> goed.",
"seconds ago" => "seconden geleden",
-"1 minute ago" => "1 minuut geleden",
-"%d minutes ago" => "%d minuten geleden",
-"1 hour ago" => "1 uur geleden",
-"%d hours ago" => "%d uren geleden",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "vandaag",
"yesterday" => "gisteren",
-"%d days ago" => "%d dagen geleden",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "vorige maand",
-"%d months ago" => "%d maanden geleden",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "vorig jaar",
"years ago" => "jaar geleden",
+"Caused by:" => "Gekomen door:",
"Could not find category \"%s\"" => "Kon categorie \"%s\" niet vinden"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/nn_NO.php b/lib/l10n/nn_NO.php
index c1739398109..28b4f7b7d94 100644
--- a/lib/l10n/nn_NO.php
+++ b/lib/l10n/nn_NO.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hjelp",
"Personal" => "Personleg",
"Settings" => "Innstillingar",
"Users" => "Brukarar",
-"Apps" => "Program",
"Admin" => "Administrer",
"web services under your control" => "Vev tjenester under din kontroll",
"Authentication error" => "Feil i autentisering",
@@ -12,11 +12,14 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Tenaren din er ikkje enno rett innstilt til å tilby filsynkronisering sidan WebDAV-grensesnittet ser ut til å vera øydelagt.",
"Please double check the <a href='%s'>installation guides</a>." => "Ver vennleg og dobbeltsjekk <a href='%s'>installasjonsrettleiinga</a>.",
"seconds ago" => "sekund sidan",
-"1 minute ago" => "1 minutt sidan",
-"1 hour ago" => "1 time sidan",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "i dag",
"yesterday" => "i går",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "førre månad",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "i fjor",
"years ago" => "år sidan"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/oc.php b/lib/l10n/oc.php
index a72da90790a..40a527cc76c 100644
--- a/lib/l10n/oc.php
+++ b/lib/l10n/oc.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ajuda",
"Personal" => "Personal",
"Settings" => "Configuracion",
"Users" => "Usancièrs",
-"Apps" => "Apps",
"Admin" => "Admin",
"web services under your control" => "Services web jos ton contraròtle",
"ZIP download is turned off." => "Avalcargar los ZIP es inactiu.",
@@ -12,12 +12,14 @@
"Authentication error" => "Error d'autentificacion",
"Files" => "Fichièrs",
"seconds ago" => "segonda a",
-"1 minute ago" => "1 minuta a",
-"%d minutes ago" => "%d minutas a",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "uèi",
"yesterday" => "ièr",
-"%d days ago" => "%d jorns a",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "mes passat",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "an passat",
"years ago" => "ans a"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n > 1);";
diff --git a/lib/l10n/pl.php b/lib/l10n/pl.php
index bbca1913b70..1740676080e 100644
--- a/lib/l10n/pl.php
+++ b/lib/l10n/pl.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Pomoc",
"Personal" => "Osobiste",
"Settings" => "Ustawienia",
"Users" => "Użytkownicy",
-"Apps" => "Aplikacje",
"Admin" => "Administrator",
+"Failed to upgrade \"%s\"." => "Błąd przy aktualizacji \"%s\".",
"web services under your control" => "Kontrolowane serwisy",
+"cannot open \"%s\"" => "Nie można otworzyć \"%s\"",
"ZIP download is turned off." => "Pobieranie ZIP jest wyłączone.",
"Files need to be downloaded one by one." => "Pliki muszą zostać pobrane pojedynczo.",
"Back to Files" => "Wróć do plików",
"Selected files too large to generate zip file." => "Wybrane pliki są zbyt duże, aby wygenerować plik zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Pobierz pliki w mniejszy kawałkach, oddzielnie lub poproś administratora o zwiększenie limitu.",
"couldn't be determined" => "nie może zostać znaleziony",
"Application is not enabled" => "Aplikacja nie jest włączona",
"Authentication error" => "Błąd uwierzytelniania",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serwer internetowy nie jest jeszcze poprawnie skonfigurowany, aby umożliwić synchronizację plików, ponieważ interfejs WebDAV wydaje się być uszkodzony.",
"Please double check the <a href='%s'>installation guides</a>." => "Sprawdź ponownie <a href='%s'>przewodniki instalacji</a>.",
"seconds ago" => "sekund temu",
-"1 minute ago" => "1 minutę temu",
-"%d minutes ago" => "%d minut temu",
-"1 hour ago" => "1 godzinę temu",
-"%d hours ago" => "%d godzin temu",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "dziś",
"yesterday" => "wczoraj",
-"%d days ago" => "%d dni temu",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "w zeszłym miesiącu",
-"%d months ago" => "%d miesiecy temu",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "w zeszłym roku",
"years ago" => "lat temu",
+"Caused by:" => "Spowodowane przez:",
"Could not find category \"%s\"" => "Nie można odnaleźć kategorii \"%s\""
);
+$PLURAL_FORMS = "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/lib/l10n/pl_PL.php b/lib/l10n/pl_PL.php
index 67cf0a33259..5494e3dab25 100644
--- a/lib/l10n/pl_PL.php
+++ b/lib/l10n/pl_PL.php
@@ -1,3 +1,5 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Settings" => "Ustawienia"
);
+$PLURAL_FORMS = "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/lib/l10n/pt_BR.php b/lib/l10n/pt_BR.php
index 029331fdec8..4ebf587cf86 100644
--- a/lib/l10n/pt_BR.php
+++ b/lib/l10n/pt_BR.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ajuda",
"Personal" => "Pessoal",
"Settings" => "Ajustes",
"Users" => "Usuários",
-"Apps" => "Aplicações",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "Falha na atualização de \"%s\".",
"web services under your control" => "serviços web sob seu controle",
+"cannot open \"%s\"" => "não pode abrir \"%s\"",
"ZIP download is turned off." => "Download ZIP está desligado.",
"Files need to be downloaded one by one." => "Arquivos precisam ser baixados um de cada vez.",
"Back to Files" => "Voltar para Arquivos",
"Selected files too large to generate zip file." => "Arquivos selecionados são muito grandes para gerar arquivo zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Baixe os arquivos em pedaços menores, separadamente ou solicite educadamente ao seu administrador.",
"couldn't be determined" => "não pôde ser determinado",
"Application is not enabled" => "Aplicação não está habilitada",
"Authentication error" => "Erro de autenticação",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Seu servidor web não está configurado corretamente para permitir sincronização de arquivos porque a interface WebDAV parece estar quebrada.",
"Please double check the <a href='%s'>installation guides</a>." => "Por favor, confira os <a href='%s'>guias de instalação</a>.",
"seconds ago" => "segundos atrás",
-"1 minute ago" => "1 minuto atrás",
-"%d minutes ago" => "%d minutos atrás",
-"1 hour ago" => "1 hora atrás",
-"%d hours ago" => "%d horas atrás",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "hoje",
"yesterday" => "ontem",
-"%d days ago" => "%d dias atrás",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "último mês",
-"%d months ago" => "%d meses atrás",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "último ano",
"years ago" => "anos atrás",
+"Caused by:" => "Causados ​​por:",
"Could not find category \"%s\"" => "Impossível localizar categoria \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n > 1);";
diff --git a/lib/l10n/pt_PT.php b/lib/l10n/pt_PT.php
index 7480026e920..3131499e130 100644
--- a/lib/l10n/pt_PT.php
+++ b/lib/l10n/pt_PT.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ajuda",
"Personal" => "Pessoal",
"Settings" => "Configurações",
"Users" => "Utilizadores",
-"Apps" => "Aplicações",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "A actualização \"%s\" falhou.",
"web services under your control" => "serviços web sob o seu controlo",
+"cannot open \"%s\"" => "Não foi possível abrir \"%s\"",
"ZIP download is turned off." => "Descarregamento em ZIP está desligado.",
"Files need to be downloaded one by one." => "Os ficheiros precisam de ser descarregados um por um.",
"Back to Files" => "Voltar a Ficheiros",
"Selected files too large to generate zip file." => "Os ficheiros seleccionados são grandes demais para gerar um ficheiro zip.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Descarregue os ficheiros em partes menores, separados ou peça gentilmente ao seu administrador.",
"couldn't be determined" => "Não foi possível determinar",
"Application is not enabled" => "A aplicação não está activada",
"Authentication error" => "Erro na autenticação",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web não está configurado correctamente para autorizar sincronização de ficheiros, pois o interface WebDAV parece estar com problemas.",
"Please double check the <a href='%s'>installation guides</a>." => "Por favor verifique <a href='%s'>installation guides</a>.",
"seconds ago" => "Minutos atrás",
-"1 minute ago" => "Há 1 minuto",
-"%d minutes ago" => "há %d minutos",
-"1 hour ago" => "Há 1 horas",
-"%d hours ago" => "Há %d horas",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "hoje",
"yesterday" => "ontem",
-"%d days ago" => "há %d dias",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "ultímo mês",
-"%d months ago" => "Há %d meses atrás",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "ano passado",
"years ago" => "anos atrás",
+"Caused by:" => "Causado por:",
"Could not find category \"%s\"" => "Não foi encontrado a categoria \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/ro.php b/lib/l10n/ro.php
index 5a34e9571e5..2b6d14d58f3 100644
--- a/lib/l10n/ro.php
+++ b/lib/l10n/ro.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ajutor",
"Personal" => "Personal",
"Settings" => "Setări",
"Users" => "Utilizatori",
-"Apps" => "Aplicații",
"Admin" => "Admin",
"web services under your control" => "servicii web controlate de tine",
"ZIP download is turned off." => "Descărcarea ZIP este dezactivată.",
@@ -18,18 +18,17 @@
"Text" => "Text",
"Images" => "Imagini",
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serverul de web nu este încă setat corespunzător pentru a permite sincronizarea fișierelor deoarece interfața WebDAV pare a fi întreruptă.",
-"Please double check the <a href='%s'>installation guides</a>." => "Vă rugăm să verificați <a href='%s'>ghiduri de instalare</ a>.",
+"Please double check the <a href='%s'>installation guides</a>." => "Vă rugăm să verificați <a href='%s'>ghiduri de instalare</a>.",
"seconds ago" => "secunde în urmă",
-"1 minute ago" => "1 minut în urmă",
-"%d minutes ago" => "%d minute în urmă",
-"1 hour ago" => "Acum o ora",
-"%d hours ago" => "%d ore in urma",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "astăzi",
"yesterday" => "ieri",
-"%d days ago" => "%d zile în urmă",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "ultima lună",
-"%d months ago" => "%d luni in urma",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "ultimul an",
"years ago" => "ani în urmă",
"Could not find category \"%s\"" => "Cloud nu a gasit categoria \"%s\""
);
+$PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));";
diff --git a/lib/l10n/ru.php b/lib/l10n/ru.php
index 052b0487c6c..92b14b9b89e 100644
--- a/lib/l10n/ru.php
+++ b/lib/l10n/ru.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Помощь",
"Personal" => "Личное",
"Settings" => "Конфигурация",
"Users" => "Пользователи",
-"Apps" => "Приложения",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "Не смог обновить \"%s\".",
"web services under your control" => "веб-сервисы под вашим управлением",
+"cannot open \"%s\"" => "не могу открыть \"%s\"",
"ZIP download is turned off." => "ZIP-скачивание отключено.",
"Files need to be downloaded one by one." => "Файлы должны быть загружены по одному.",
"Back to Files" => "Назад к файлам",
"Selected files too large to generate zip file." => "Выбранные файлы слишком велики, чтобы создать zip файл.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Загрузите файл маленьшими порциями, раздельно или вежливо попросите Вашего администратора.",
"couldn't be determined" => "Невозможно установить",
"Application is not enabled" => "Приложение не разрешено",
"Authentication error" => "Ошибка аутентификации",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер до сих пор не настроен правильно для возможности синхронизации файлов, похоже что проблема в неисправности интерфейса WebDAV.",
"Please double check the <a href='%s'>installation guides</a>." => "Пожалуйста, дважды просмотрите <a href='%s'>инструкции по установке</a>.",
"seconds ago" => "несколько секунд назад",
-"1 minute ago" => "1 минуту назад",
-"%d minutes ago" => "%d минут назад",
-"1 hour ago" => "час назад",
-"%d hours ago" => "%d часов назад",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "сегодня",
"yesterday" => "вчера",
-"%d days ago" => "%d дней назад",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "в прошлом месяце",
-"%d months ago" => "%d месяцев назад",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "в прошлом году",
"years ago" => "несколько лет назад",
+"Caused by:" => "Вызвано:",
"Could not find category \"%s\"" => "Категория \"%s\" не найдена"
);
+$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);";
diff --git a/lib/l10n/ru_RU.php b/lib/l10n/ru_RU.php
deleted file mode 100644
index 7639a3cc97e..00000000000
--- a/lib/l10n/ru_RU.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php $TRANSLATIONS = array(
-"Settings" => "Настройки",
-"Text" => "Текст"
-);
diff --git a/lib/l10n/si_LK.php b/lib/l10n/si_LK.php
index 49ded7026e0..d10804cae69 100644
--- a/lib/l10n/si_LK.php
+++ b/lib/l10n/si_LK.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "උදව්",
"Personal" => "පෞද්ගලික",
"Settings" => "සිටුවම්",
"Users" => "පරිශීලකයන්",
-"Apps" => "යෙදුම්",
"Admin" => "පරිපාලක",
"web services under your control" => "ඔබට පාලනය කළ හැකි වෙබ් සේවාවන්",
"ZIP download is turned off." => "ZIP භාගත කිරීම් අක්‍රියයි",
@@ -17,12 +17,14 @@
"Text" => "පෙළ",
"Images" => "අනු රූ",
"seconds ago" => "තත්පරයන්ට පෙර",
-"1 minute ago" => "1 මිනිත්තුවකට පෙර",
-"%d minutes ago" => "%d මිනිත්තුවන්ට පෙර",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "අද",
"yesterday" => "ඊයේ",
-"%d days ago" => "%d දිනකට පෙර",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "පෙර මාසයේ",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "පෙර අවුරුද්දේ",
"years ago" => "අවුරුදු කීපයකට පෙර"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/sk.php b/lib/l10n/sk.php
new file mode 100644
index 00000000000..54812b15a6f
--- /dev/null
+++ b/lib/l10n/sk.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
+"_%n day go_::_%n days ago_" => array("","",""),
+"_%n month ago_::_%n months ago_" => array("","","")
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;";
diff --git a/lib/l10n/sk_SK.php b/lib/l10n/sk_SK.php
index 64ad1e540f3..ef3dc6eb977 100644
--- a/lib/l10n/sk_SK.php
+++ b/lib/l10n/sk_SK.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Pomoc",
"Personal" => "Osobné",
"Settings" => "Nastavenia",
"Users" => "Používatelia",
-"Apps" => "Aplikácie",
"Admin" => "Administrátor",
+"Failed to upgrade \"%s\"." => "Zlyhala aktualizácia \"%s\".",
"web services under your control" => "webové služby pod Vašou kontrolou",
+"cannot open \"%s\"" => "nemožno otvoriť \"%s\"",
"ZIP download is turned off." => "Sťahovanie súborov ZIP je vypnuté.",
"Files need to be downloaded one by one." => "Súbory musia byť nahrávané jeden za druhým.",
"Back to Files" => "Späť na súbory",
"Selected files too large to generate zip file." => "Zvolené súbory sú príliš veľké na vygenerovanie zip súboru.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Stiahnite súbory po menších častiach, samostatne, alebo sa obráťte na správcu.",
"couldn't be determined" => "nedá sa zistiť",
"Application is not enabled" => "Aplikácia nie je zapnutá",
"Authentication error" => "Chyba autentifikácie",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server nie je správne nastavený na synchronizáciu, pretože rozhranie WebDAV je poškodené.",
"Please double check the <a href='%s'>installation guides</a>." => "Prosím skontrolujte <a href='%s'>inštalačnú príručku</a>.",
"seconds ago" => "pred sekundami",
-"1 minute ago" => "pred minútou",
-"%d minutes ago" => "pred %d minútami",
-"1 hour ago" => "Pred 1 hodinou",
-"%d hours ago" => "Pred %d hodinami.",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "dnes",
"yesterday" => "včera",
-"%d days ago" => "pred %d dňami",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "minulý mesiac",
-"%d months ago" => "Pred %d mesiacmi.",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "minulý rok",
"years ago" => "pred rokmi",
+"Caused by:" => "Príčina:",
"Could not find category \"%s\"" => "Nemožno nájsť danú kategóriu \"%s\""
);
+$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;";
diff --git a/lib/l10n/sl.php b/lib/l10n/sl.php
index a5b4decd61a..73a397f3c84 100644
--- a/lib/l10n/sl.php
+++ b/lib/l10n/sl.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Pomoč",
"Personal" => "Osebno",
"Settings" => "Nastavitve",
"Users" => "Uporabniki",
-"Apps" => "Programi",
"Admin" => "Skrbništvo",
"web services under your control" => "spletne storitve pod vašim nadzorom",
"ZIP download is turned off." => "Prejemanje datotek v paketu ZIP je onemogočeno.",
@@ -38,16 +38,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Spletni stražnik še ni ustrezno nastavljen in ne omogoča usklajevanja, saj je nastavitev WebDAV okvarjena.",
"Please double check the <a href='%s'>installation guides</a>." => "Preverite <a href='%s'>navodila namestitve</a>.",
"seconds ago" => "pred nekaj sekundami",
-"1 minute ago" => "pred minuto",
-"%d minutes ago" => "pred %d minutami",
-"1 hour ago" => "Pred 1 uro",
-"%d hours ago" => "Pred %d urami",
+"_%n minute ago_::_%n minutes ago_" => array("","","",""),
+"_%n hour ago_::_%n hours ago_" => array("","","",""),
"today" => "danes",
"yesterday" => "včeraj",
-"%d days ago" => "pred %d dnevi",
+"_%n day go_::_%n days ago_" => array("","","",""),
"last month" => "zadnji mesec",
-"%d months ago" => "Pred %d meseci",
+"_%n month ago_::_%n months ago_" => array("","","",""),
"last year" => "lansko leto",
"years ago" => "let nazaj",
"Could not find category \"%s\"" => "Kategorije \"%s\" ni mogoče najti."
);
+$PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);";
diff --git a/lib/l10n/sq.php b/lib/l10n/sq.php
index df5e2a31743..ca2364f9864 100644
--- a/lib/l10n/sq.php
+++ b/lib/l10n/sq.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Ndihmë",
"Personal" => "Personale",
"Settings" => "Parametra",
"Users" => "Përdoruesit",
-"Apps" => "App",
"Admin" => "Admin",
"web services under your control" => "shërbime web nën kontrollin tënd",
"ZIP download is turned off." => "Shkarimi i skedarëve ZIP është i çaktivizuar.",
@@ -37,16 +37,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serveri web i juaji nuk është konfiguruar akoma për të lejuar sinkronizimin e skedarëve sepse ndërfaqja WebDAV mund të jetë e dëmtuar.",
"Please double check the <a href='%s'>installation guides</a>." => "Ju lutemi kontrolloni mirë <a href='%s'>shoqëruesin e instalimit</a>.",
"seconds ago" => "sekonda më parë",
-"1 minute ago" => "1 minutë më parë",
-"%d minutes ago" => "%d minuta më parë",
-"1 hour ago" => "1 orë më parë",
-"%d hours ago" => "%d orë më parë",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "sot",
"yesterday" => "dje",
-"%d days ago" => "%d ditë më parë",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "muajin e shkuar",
-"%d months ago" => "%d muaj më parë",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "vitin e shkuar",
"years ago" => "vite më parë",
"Could not find category \"%s\"" => "Kategoria \"%s\" nuk u gjet"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/sr.php b/lib/l10n/sr.php
index 71d627e7890..c42419b6d92 100644
--- a/lib/l10n/sr.php
+++ b/lib/l10n/sr.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Помоћ",
"Personal" => "Лично",
"Settings" => "Поставке",
"Users" => "Корисници",
-"Apps" => "Апликације",
"Admin" => "Администратор",
"web services under your control" => "веб сервиси под контролом",
"ZIP download is turned off." => "Преузимање ZIP-а је искључено.",
@@ -20,16 +20,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер тренутно не подржава синхронизацију датотека јер се чини да је WebDAV сучеље неисправно.",
"Please double check the <a href='%s'>installation guides</a>." => "Погледајте <a href='%s'>водиче за инсталацију</a>.",
"seconds ago" => "пре неколико секунди",
-"1 minute ago" => "пре 1 минут",
-"%d minutes ago" => "пре %d минута",
-"1 hour ago" => "Пре једног сата",
-"%d hours ago" => "пре %d сата/и",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "данас",
"yesterday" => "јуче",
-"%d days ago" => "пре %d дана",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "прошлог месеца",
-"%d months ago" => "пре %d месеца/и",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "прошле године",
"years ago" => "година раније",
"Could not find category \"%s\"" => "Не могу да пронађем категорију „%s“."
);
+$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);";
diff --git a/lib/l10n/sr@latin.php b/lib/l10n/sr@latin.php
index 13cedc83279..5ba51bc0ba7 100644
--- a/lib/l10n/sr@latin.php
+++ b/lib/l10n/sr@latin.php
@@ -1,11 +1,16 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Pomoć",
"Personal" => "Lično",
"Settings" => "Podešavanja",
"Users" => "Korisnici",
-"Apps" => "Programi",
"Admin" => "Adninistracija",
"Authentication error" => "Greška pri autentifikaciji",
"Files" => "Fajlovi",
-"Text" => "Tekst"
+"Text" => "Tekst",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
+"_%n day go_::_%n days ago_" => array("","",""),
+"_%n month ago_::_%n months ago_" => array("","","")
);
+$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);";
diff --git a/lib/l10n/string.php b/lib/l10n/string.php
index 8eef10071e6..88c85b32e70 100644
--- a/lib/l10n/string.php
+++ b/lib/l10n/string.php
@@ -7,19 +7,50 @@
*/
class OC_L10N_String{
+ /**
+ * @var OC_L10N
+ */
protected $l10n;
- public function __construct($l10n, $text, $parameters) {
+
+ /**
+ * @var string
+ */
+ protected $text;
+
+ /**
+ * @var array
+ */
+ protected $parameters;
+
+ /**
+ * @var integer
+ */
+ protected $count;
+
+ public function __construct($l10n, $text, $parameters, $count = 1) {
$this->l10n = $l10n;
$this->text = $text;
$this->parameters = $parameters;
-
+ $this->count = $count;
}
public function __toString() {
$translations = $this->l10n->getTranslations();
+
+ $text = $this->text;
if(array_key_exists($this->text, $translations)) {
- return vsprintf($translations[$this->text], $this->parameters);
+ if(is_array($translations[$this->text])) {
+ $fn = $this->l10n->getPluralFormFunction();
+ $id = $fn($this->count);
+ $text = $translations[$this->text][$id];
+ }
+ else{
+ $text = $translations[$this->text];
+ }
}
- return vsprintf($this->text, $this->parameters);
+
+ // Replace %n first (won't interfere with vsprintf)
+ $text = str_replace('%n', $this->count, $text);
+ return vsprintf($text, $this->parameters);
}
}
diff --git a/lib/l10n/sv.php b/lib/l10n/sv.php
index 56776e574aa..fa3ae318cee 100644
--- a/lib/l10n/sv.php
+++ b/lib/l10n/sv.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Hjälp",
"Personal" => "Personligt",
"Settings" => "Inställningar",
"Users" => "Användare",
-"Apps" => "Program",
"Admin" => "Admin",
+"Failed to upgrade \"%s\"." => "Misslyckades med att uppgradera \"%s\".",
"web services under your control" => "webbtjänster under din kontroll",
+"cannot open \"%s\"" => "Kan inte öppna \"%s\"",
"ZIP download is turned off." => "Nerladdning av ZIP är avstängd.",
"Files need to be downloaded one by one." => "Filer laddas ner en åt gången.",
"Back to Files" => "Tillbaka till Filer",
"Selected files too large to generate zip file." => "Valda filer är för stora för att skapa zip-fil.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Ladda ner filerna i mindre bitar, separat eller fråga din administratör.",
"couldn't be determined" => "kunde inte bestämmas",
"Application is not enabled" => "Applikationen är inte aktiverad",
"Authentication error" => "Fel vid autentisering",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din webbserver är inte korrekt konfigurerad för att tillåta filsynkronisering eftersom WebDAV inte verkar fungera.",
"Please double check the <a href='%s'>installation guides</a>." => "Var god kontrollera <a href='%s'>installationsguiden</a>.",
"seconds ago" => "sekunder sedan",
-"1 minute ago" => "1 minut sedan",
-"%d minutes ago" => "%d minuter sedan",
-"1 hour ago" => "1 timme sedan",
-"%d hours ago" => "%d timmar sedan",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "i dag",
"yesterday" => "i går",
-"%d days ago" => "%d dagar sedan",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "förra månaden",
-"%d months ago" => "%d månader sedan",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "förra året",
"years ago" => "år sedan",
+"Caused by:" => "Orsakad av:",
"Could not find category \"%s\"" => "Kunde inte hitta kategorin \"%s\""
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/sw_KE.php b/lib/l10n/sw_KE.php
new file mode 100644
index 00000000000..15f78e0bce6
--- /dev/null
+++ b/lib/l10n/sw_KE.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/ta_LK.php b/lib/l10n/ta_LK.php
index 9193f6f1d2f..e70e65845be 100644
--- a/lib/l10n/ta_LK.php
+++ b/lib/l10n/ta_LK.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "உதவி",
"Personal" => "தனிப்பட்ட",
"Settings" => "அமைப்புகள்",
"Users" => "பயனாளர்",
-"Apps" => "செயலிகள்",
"Admin" => "நிர்வாகம்",
"web services under your control" => "வலைய சேவைகள் உங்களுடைய கட்டுப்பாட்டின் கீழ் உள்ளது",
"ZIP download is turned off." => "வீசொலிப் பூட்டு பதிவிறக்கம் நிறுத்தப்பட்டுள்ளது.",
@@ -17,16 +17,15 @@
"Text" => "உரை",
"Images" => "படங்கள்",
"seconds ago" => "செக்கன்களுக்கு முன்",
-"1 minute ago" => "1 நிமிடத்திற்கு முன் ",
-"%d minutes ago" => "%d நிமிடங்களுக்கு முன்",
-"1 hour ago" => "1 மணித்தியாலத்திற்கு முன்",
-"%d hours ago" => "%d மணித்தியாலத்திற்கு முன்",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "இன்று",
"yesterday" => "நேற்று",
-"%d days ago" => "%d நாட்களுக்கு முன்",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "கடந்த மாதம்",
-"%d months ago" => "%d மாதத்திற்கு முன்",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "கடந்த வருடம்",
"years ago" => "வருடங்களுக்கு முன்",
"Could not find category \"%s\"" => "பிரிவு \"%s\" ஐ கண்டுப்பிடிக்க முடியவில்லை"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/te.php b/lib/l10n/te.php
index 87c73d790e2..524ea0c6024 100644
--- a/lib/l10n/te.php
+++ b/lib/l10n/te.php
@@ -1,13 +1,17 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "సహాయం",
"Settings" => "అమరికలు",
"Users" => "వాడుకరులు",
"seconds ago" => "క్షణాల క్రితం",
-"1 minute ago" => "1 నిమిషం క్రితం",
-"1 hour ago" => "1 గంట క్రితం",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "ఈరోజు",
"yesterday" => "నిన్న",
+"_%n day go_::_%n days ago_" => array("",""),
"last month" => "పోయిన నెల",
+"_%n month ago_::_%n months ago_" => array("",""),
"last year" => "పోయిన సంవత్సరం",
"years ago" => "సంవత్సరాల క్రితం"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/th_TH.php b/lib/l10n/th_TH.php
index 4ec6ef55f4e..53a150d8f1e 100644
--- a/lib/l10n/th_TH.php
+++ b/lib/l10n/th_TH.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "ช่วยเหลือ",
"Personal" => "ส่วนตัว",
"Settings" => "ตั้งค่า",
"Users" => "ผู้ใช้งาน",
-"Apps" => "แอปฯ",
"Admin" => "ผู้ดูแล",
"web services under your control" => "เว็บเซอร์วิสที่คุณควบคุมการใช้งานได้",
"ZIP download is turned off." => "คุณสมบัติการดาวน์โหลด zip ถูกปิดการใช้งานไว้",
@@ -18,16 +18,15 @@
"Text" => "ข้อความ",
"Images" => "รูปภาพ",
"seconds ago" => "วินาที ก่อนหน้านี้",
-"1 minute ago" => "1 นาทีก่อนหน้านี้",
-"%d minutes ago" => "%d นาทีที่ผ่านมา",
-"1 hour ago" => "1 ชั่วโมงก่อนหน้านี้",
-"%d hours ago" => "%d ชั่วโมงก่อนหน้านี้",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "วันนี้",
"yesterday" => "เมื่อวานนี้",
-"%d days ago" => "%d วันที่ผ่านมา",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "เดือนที่แล้ว",
-"%d months ago" => "%d เดือนมาแล้ว",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "ปีที่แล้ว",
"years ago" => "ปี ที่ผ่านมา",
"Could not find category \"%s\"" => "ไม่พบหมวดหมู่ \"%s\""
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/tr.php b/lib/l10n/tr.php
index 6325ad9886a..f95933645da 100644
--- a/lib/l10n/tr.php
+++ b/lib/l10n/tr.php
@@ -1,15 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Yardım",
"Personal" => "Kişisel",
"Settings" => "Ayarlar",
"Users" => "Kullanıcılar",
-"Apps" => "Uygulamalar",
"Admin" => "Yönetici",
+"Failed to upgrade \"%s\"." => "\"%s\" yükseltme başarısız oldu.",
"web services under your control" => "Bilgileriniz güvenli ve şifreli",
+"cannot open \"%s\"" => "\"%s\" açılamıyor",
"ZIP download is turned off." => "ZIP indirmeleri kapatılmıştır.",
"Files need to be downloaded one by one." => "Dosyaların birer birer indirilmesi gerekmektedir.",
"Back to Files" => "Dosyalara dön",
"Selected files too large to generate zip file." => "Seçilen dosyalar bir zip dosyası oluşturmak için fazla büyüktür.",
+"Download the files in smaller chunks, seperately or kindly ask your administrator." => "Dosyaları ayrı ayrı, küçük parçalar halinde indirin ya da yöneticinizden yardım isteyin. ",
"couldn't be determined" => "tespit edilemedi",
"Application is not enabled" => "Uygulama etkinleştirilmedi",
"Authentication error" => "Kimlik doğrulama hatası",
@@ -38,16 +41,16 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web sunucunuz dosya transferi için düzgün bir şekilde yapılandırılmamış. WevDAV arabirimini sorunlu gözüküyor.",
"Please double check the <a href='%s'>installation guides</a>." => "Lütfen <a href='%s'>kurulum kılavuzlarını</a> iki kez kontrol edin.",
"seconds ago" => "saniye önce",
-"1 minute ago" => "1 dakika önce",
-"%d minutes ago" => "%d dakika önce",
-"1 hour ago" => "1 saat önce",
-"%d hours ago" => "%d saat önce",
+"_%n minute ago_::_%n minutes ago_" => array("","%n dakika önce"),
+"_%n hour ago_::_%n hours ago_" => array("","%n saat önce"),
"today" => "bugün",
"yesterday" => "dün",
-"%d days ago" => "%d gün önce",
+"_%n day go_::_%n days ago_" => array("","%n gün önce"),
"last month" => "geçen ay",
-"%d months ago" => "%d ay önce",
+"_%n month ago_::_%n months ago_" => array("","%n ay önce"),
"last year" => "geçen yıl",
"years ago" => "yıl önce",
+"Caused by:" => "Neden olan:",
"Could not find category \"%s\"" => "\"%s\" kategorisi bulunamadı"
);
+$PLURAL_FORMS = "nplurals=2; plural=(n > 1);";
diff --git a/lib/l10n/ug.php b/lib/l10n/ug.php
index 62d91616c1d..731ad904d7e 100644
--- a/lib/l10n/ug.php
+++ b/lib/l10n/ug.php
@@ -1,19 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "ياردەم",
"Personal" => "شەخسىي",
"Settings" => "تەڭشەكلەر",
"Users" => "ئىشلەتكۈچىلەر",
-"Apps" => "ئەپلەر",
"Authentication error" => "سالاھىيەت دەلىللەش خاتالىقى",
"Files" => "ھۆججەتلەر",
"Text" => "قىسقا ئۇچۇر",
"Images" => "سۈرەتلەر",
-"1 minute ago" => "1 مىنۇت ئىلگىرى",
-"%d minutes ago" => "%d مىنۇت ئىلگىرى",
-"1 hour ago" => "1 سائەت ئىلگىرى",
-"%d hours ago" => "%d سائەت ئىلگىرى",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "بۈگۈن",
"yesterday" => "تۈنۈگۈن",
-"%d days ago" => "%d كۈن ئىلگىرى",
-"%d months ago" => "%d ئاي ئىلگىرى"
+"_%n day go_::_%n days ago_" => array(""),
+"_%n month ago_::_%n months ago_" => array("")
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/uk.php b/lib/l10n/uk.php
index 7ff7829e1a2..26617396e06 100644
--- a/lib/l10n/uk.php
+++ b/lib/l10n/uk.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Допомога",
"Personal" => "Особисте",
"Settings" => "Налаштування",
"Users" => "Користувачі",
-"Apps" => "Додатки",
"Admin" => "Адмін",
"web services under your control" => "підконтрольні Вам веб-сервіси",
"ZIP download is turned off." => "ZIP завантаження вимкнено.",
@@ -37,16 +37,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш Web-сервер ще не налаштований належним чином для того, щоб дозволити синхронізацію файлів, через те що інтерфейс WebDAV, здається, зламаний.",
"Please double check the <a href='%s'>installation guides</a>." => "Будь ласка, перевірте <a href='%s'>інструкції по встановленню</a>.",
"seconds ago" => "секунди тому",
-"1 minute ago" => "1 хвилину тому",
-"%d minutes ago" => "%d хвилин тому",
-"1 hour ago" => "1 годину тому",
-"%d hours ago" => "%d годин тому",
+"_%n minute ago_::_%n minutes ago_" => array("","",""),
+"_%n hour ago_::_%n hours ago_" => array("","",""),
"today" => "сьогодні",
"yesterday" => "вчора",
-"%d days ago" => "%d днів тому",
+"_%n day go_::_%n days ago_" => array("","",""),
"last month" => "минулого місяця",
-"%d months ago" => "%d місяців тому",
+"_%n month ago_::_%n months ago_" => array("","",""),
"last year" => "минулого року",
"years ago" => "роки тому",
"Could not find category \"%s\"" => "Не вдалося знайти категорію \"%s\""
);
+$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);";
diff --git a/lib/l10n/ur_PK.php b/lib/l10n/ur_PK.php
index 21e711c6df5..7dc967ccd93 100644
--- a/lib/l10n/ur_PK.php
+++ b/lib/l10n/ur_PK.php
@@ -1,9 +1,14 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "مدد",
"Personal" => "ذاتی",
"Settings" => "سیٹینگز",
"Users" => "یوزرز",
-"Apps" => "ایپز",
"Admin" => "ایڈمن",
-"web services under your control" => "آپ کے اختیار میں ویب سروسیز"
+"web services under your control" => "آپ کے اختیار میں ویب سروسیز",
+"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n hour ago_::_%n hours ago_" => array("",""),
+"_%n day go_::_%n days ago_" => array("",""),
+"_%n month ago_::_%n months ago_" => array("","")
);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/lib/l10n/vi.php b/lib/l10n/vi.php
index f2a7d669b8f..ebdb3ab2810 100644
--- a/lib/l10n/vi.php
+++ b/lib/l10n/vi.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "Giúp đỡ",
"Personal" => "Cá nhân",
"Settings" => "Cài đặt",
"Users" => "Người dùng",
-"Apps" => "Ứng dụng",
"Admin" => "Quản trị",
"web services under your control" => "dịch vụ web dưới sự kiểm soát của bạn",
"ZIP download is turned off." => "Tải về ZIP đã bị tắt.",
@@ -18,16 +18,15 @@
"Text" => "Văn bản",
"Images" => "Hình ảnh",
"seconds ago" => "vài giây trước",
-"1 minute ago" => "1 phút trước",
-"%d minutes ago" => "%d phút trước",
-"1 hour ago" => "1 giờ trước",
-"%d hours ago" => "%d giờ trước",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "hôm nay",
"yesterday" => "hôm qua",
-"%d days ago" => "%d ngày trước",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "tháng trước",
-"%d months ago" => "%d tháng trước",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "năm trước",
"years ago" => "năm trước",
"Could not find category \"%s\"" => "không thể tìm thấy mục \"%s\""
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/zh_CN.GB2312.php b/lib/l10n/zh_CN.GB2312.php
index 4780a69eb34..bc81ff8fe1b 100644
--- a/lib/l10n/zh_CN.GB2312.php
+++ b/lib/l10n/zh_CN.GB2312.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "帮助",
"Personal" => "私人",
"Settings" => "设置",
"Users" => "用户",
-"Apps" => "程序",
"Admin" => "管理员",
"web services under your control" => "您控制的网络服务",
"ZIP download is turned off." => "ZIP 下载已关闭",
@@ -19,13 +19,14 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "因WebDAV接口故障,您的网络服务器好像并未允许文件同步。",
"Please double check the <a href='%s'>installation guides</a>." => "请双击<a href='%s'>安装向导</a>。",
"seconds ago" => "秒前",
-"1 minute ago" => "1 分钟前",
-"%d minutes ago" => "%d 分钟前",
-"1 hour ago" => "1小时前",
+"_%n minute ago_::_%n minutes ago_" => array("%n 分钟以前"),
+"_%n hour ago_::_%n hours ago_" => array("%n 小时以前"),
"today" => "今天",
"yesterday" => "昨天",
-"%d days ago" => "%d 天前",
+"_%n day go_::_%n days ago_" => array("%n 天以前"),
"last month" => "上个月",
+"_%n month ago_::_%n months ago_" => array("%n 个月以前"),
"last year" => "去年",
"years ago" => "年前"
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/zh_CN.php b/lib/l10n/zh_CN.php
index 7630f885c4a..b814b055a22 100644
--- a/lib/l10n/zh_CN.php
+++ b/lib/l10n/zh_CN.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "帮助",
"Personal" => "个人",
"Settings" => "设置",
"Users" => "用户",
-"Apps" => "应用",
"Admin" => "管理",
"web services under your control" => "您控制的web服务",
"ZIP download is turned off." => "ZIP 下载已经关闭",
@@ -38,16 +38,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "您的Web服务器尚未正确设置以允许文件同步, 因为WebDAV的接口似乎已损坏.",
"Please double check the <a href='%s'>installation guides</a>." => "请认真检查<a href='%s'>安装指南</a>.",
"seconds ago" => "秒前",
-"1 minute ago" => "一分钟前",
-"%d minutes ago" => "%d 分钟前",
-"1 hour ago" => "1小时前",
-"%d hours ago" => "%d小时前",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "今天",
"yesterday" => "昨天",
-"%d days ago" => "%d 天前",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "上月",
-"%d months ago" => "%d 月前",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "去年",
"years ago" => "年前",
"Could not find category \"%s\"" => "无法找到分类 \"%s\""
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/zh_HK.php b/lib/l10n/zh_HK.php
index cfa33ec36f5..ca3e6d504e7 100644
--- a/lib/l10n/zh_HK.php
+++ b/lib/l10n/zh_HK.php
@@ -1,13 +1,18 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "幫助",
"Personal" => "個人",
"Settings" => "設定",
"Users" => "用戶",
-"Apps" => "軟件",
"Admin" => "管理",
"Files" => "文件",
"Text" => "文字",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "今日",
"yesterday" => "昨日",
-"last month" => "前一月"
+"_%n day go_::_%n days ago_" => array(""),
+"last month" => "前一月",
+"_%n month ago_::_%n months ago_" => array("")
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/l10n/zh_TW.php b/lib/l10n/zh_TW.php
index afd196f7c82..83e0dff3926 100644
--- a/lib/l10n/zh_TW.php
+++ b/lib/l10n/zh_TW.php
@@ -1,9 +1,9 @@
-<?php $TRANSLATIONS = array(
+<?php
+$TRANSLATIONS = array(
"Help" => "說明",
"Personal" => "個人",
"Settings" => "設定",
"Users" => "使用者",
-"Apps" => "應用程式",
"Admin" => "管理",
"web services under your control" => "由您控制的網路服務",
"ZIP download is turned off." => "ZIP 下載已關閉。",
@@ -38,16 +38,15 @@
"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "您的網頁伺服器尚未被正確設定來進行檔案同步,因為您的 WebDAV 界面似乎無法使用。",
"Please double check the <a href='%s'>installation guides</a>." => "請參考<a href='%s'>安裝指南</a>。",
"seconds ago" => "幾秒前",
-"1 minute ago" => "1 分鐘前",
-"%d minutes ago" => "%d 分鐘前",
-"1 hour ago" => "1 小時之前",
-"%d hours ago" => "%d 小時之前",
+"_%n minute ago_::_%n minutes ago_" => array(""),
+"_%n hour ago_::_%n hours ago_" => array(""),
"today" => "今天",
"yesterday" => "昨天",
-"%d days ago" => "%d 天前",
+"_%n day go_::_%n days ago_" => array(""),
"last month" => "上個月",
-"%d months ago" => "%d 個月之前",
+"_%n month ago_::_%n months ago_" => array(""),
"last year" => "去年",
"years ago" => "幾年前",
"Could not find category \"%s\"" => "找不到分類:\"%s\""
);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/lib/legacy/config.php b/lib/legacy/config.php
index 5294a48ea44..7e498013737 100644
--- a/lib/legacy/config.php
+++ b/lib/legacy/config.php
@@ -46,6 +46,10 @@ class OC_Config {
*/
public static $object;
+ public static function getObject() {
+ return self::$object;
+ }
+
/**
* @brief Lists all available config keys
* @return array with key names
diff --git a/lib/log/owncloud.php b/lib/log/owncloud.php
index 7a11a588330..d16b9537a16 100644
--- a/lib/log/owncloud.php
+++ b/lib/log/owncloud.php
@@ -44,12 +44,14 @@ class OC_Log_Owncloud {
* write a message in the log
* @param string $app
* @param string $message
- * @param int level
+ * @param int $level
*/
public static function write($app, $message, $level) {
$minLevel=min(OC_Config::getValue( "loglevel", OC_Log::WARN ), OC_Log::ERROR);
if($level>=$minLevel) {
- $time = date("F d, Y H:i:s", time());
+ // default to ISO8601
+ $format = OC_Config::getValue('logdateformat', 'c');
+ $time = date($format, time());
$entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time);
$handle = @fopen(self::$logFile, 'a');
if ($handle) {
@@ -61,8 +63,8 @@ class OC_Log_Owncloud {
/**
* get entries from the log in reverse chronological order
- * @param int limit
- * @param int offset
+ * @param int $limit
+ * @param int $offset
* @return array
*/
public static function getEntries($limit=50, $offset=0) {
diff --git a/lib/log/syslog.php b/lib/log/syslog.php
index d1fb28d8b0a..c98deab7109 100644
--- a/lib/log/syslog.php
+++ b/lib/log/syslog.php
@@ -28,10 +28,13 @@ class OC_Log_Syslog {
* write a message in the log
* @param string $app
* @param string $message
- * @param int level
+ * @param int $level
*/
public static function write($app, $message, $level) {
- $syslog_level = self::$levels[$level];
- syslog($syslog_level, '{'.$app.'} '.$message);
+ $minLevel = min(OC_Config::getValue("loglevel", OC_Log::WARN), OC_Log::ERROR);
+ if ($level >= $minLevel) {
+ $syslog_level = self::$levels[$level];
+ syslog($syslog_level, '{'.$app.'} '.$message);
+ }
}
}
diff --git a/lib/memcache/apcu.php b/lib/memcache/apcu.php
new file mode 100644
index 00000000000..ccc1aa6e562
--- /dev/null
+++ b/lib/memcache/apcu.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Memcache;
+
+class APCu extends APC {
+ public function clear($prefix = '') {
+ $ns = $this->getNamespace() . $prefix;
+ $ns = preg_quote($ns, '/');
+ $iter = new \APCIterator('/^'.$ns.'/');
+ return apc_delete($iter);
+ }
+
+ static public function isAvailable() {
+ if (!extension_loaded('apcu')) {
+ return false;
+ } elseif (!ini_get('apc.enable_cli') && \OC::$CLI) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+}
diff --git a/lib/memcache/factory.php b/lib/memcache/factory.php
index b1b49971031..4c1b1ab207f 100644
--- a/lib/memcache/factory.php
+++ b/lib/memcache/factory.php
@@ -18,6 +18,8 @@ class Factory {
function create($prefix = '') {
if (XCache::isAvailable()) {
return new XCache($prefix);
+ } elseif (APCu::isAvailable()) {
+ return new APCu($prefix);
} elseif (APC::isAvailable()) {
return new APC($prefix);
} elseif (Memcached::isAvailable()) {
@@ -33,6 +35,6 @@ class Factory {
* @return bool
*/
public function isAvailable() {
- return XCache::isAvailable() || APC::isAvailable() || Memcached::isAvailable();
+ return XCache::isAvailable() || APCu::isAvailable() || APC::isAvailable() || Memcached::isAvailable();
}
}
diff --git a/lib/migration/content.php b/lib/migration/content.php
index 400a46a4340..2d8268a1d74 100644
--- a/lib/migration/content.php
+++ b/lib/migration/content.php
@@ -112,7 +112,7 @@ class OC_Migration_Content{
foreach( $options['matchval'] as $matchval ) {
// Run the query for this match value (where x = y value)
- $sql = 'SELECT * FROM `*PREFIX*' . $options['table'] . '` WHERE `' . $options['matchcol'] . '` LIKE ?';
+ $sql = 'SELECT * FROM `*PREFIX*' . $options['table'] . '` WHERE `' . $options['matchcol'] . '` = ?';
$query = OC_DB::prepare( $sql );
$results = $query->execute( array( $matchval ) );
$newreturns = $this->insertData( $results, $options );
diff --git a/lib/mimetypes.list.php b/lib/mimetypes.list.php
index 2aac3bbfd27..8ab8ac81bd8 100644
--- a/lib/mimetypes.list.php
+++ b/lib/mimetypes.list.php
@@ -102,5 +102,6 @@ return array(
'md' => 'text/markdown',
'markdown' => 'text/markdown',
'mdown' => 'text/markdown',
- 'mdwn' => 'text/markdown'
+ 'mdwn' => 'text/markdown',
+ 'reveal' => 'text/reveal'
);
diff --git a/lib/public/files.php b/lib/public/files.php
index 4975bbb7dfa..852b041eefb 100644
--- a/lib/public/files.php
+++ b/lib/public/files.php
@@ -61,7 +61,7 @@ class Files {
* @param string $query
* @return array
*/
- public function searchByMime($mimetype) {
+ static public function searchByMime($mimetype) {
return(\OC\Files\Filesystem::searchByMime( $mimetype ));
}
diff --git a/lib/public/share.php b/lib/public/share.php
index 596a729a47d..63645e6fa34 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -454,6 +454,9 @@ class Share {
$forcePortable = (CRYPT_BLOWFISH != 1);
$hasher = new \PasswordHash(8, $forcePortable);
$shareWith = $hasher->HashPassword($shareWith.\OC_Config::getValue('passwordsalt', ''));
+ } else {
+ // reuse the already set password
+ $shareWith = $checkExists['share_with'];
}
// Generate token
@@ -1285,6 +1288,8 @@ class Share {
if ($shareType == self::SHARE_TYPE_GROUP) {
$groupItemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith['group'],
$uidOwner, $suggestedItemTarget);
+ $run = true;
+ $error = '';
\OC_Hook::emit('OCP\Share', 'pre_shared', array(
'itemType' => $itemType,
'itemSource' => $itemSource,
@@ -1294,8 +1299,15 @@ class Share {
'uidOwner' => $uidOwner,
'permissions' => $permissions,
'fileSource' => $fileSource,
- 'token' => $token
+ 'token' => $token,
+ 'run' => &$run,
+ 'error' => &$error
));
+
+ if ($run === false) {
+ throw new \Exception($error);
+ }
+
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {
@@ -1371,6 +1383,8 @@ class Share {
} else {
$itemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
$suggestedItemTarget);
+ $run = true;
+ $error = '';
\OC_Hook::emit('OCP\Share', 'pre_shared', array(
'itemType' => $itemType,
'itemSource' => $itemSource,
@@ -1380,8 +1394,15 @@ class Share {
'uidOwner' => $uidOwner,
'permissions' => $permissions,
'fileSource' => $fileSource,
- 'token' => $token
+ 'token' => $token,
+ 'run' => &$run,
+ 'error' => &$error
));
+
+ if ($run === false) {
+ throw new \Exception($error);
+ }
+
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {
diff --git a/lib/template/functions.php b/lib/template/functions.php
index 2d43cae1c0c..717e197c1cb 100644
--- a/lib/template/functions.php
+++ b/lib/template/functions.php
@@ -78,15 +78,13 @@ function relative_modified_date($timestamp) {
$diffmonths = round($diffdays/31);
if($timediff < 60) { return $l->t('seconds ago'); }
- else if($timediff < 120) { return $l->t('1 minute ago'); }
- else if($timediff < 3600) { return $l->t('%d minutes ago', $diffminutes); }
- else if($timediff < 7200) { return $l->t('1 hour ago'); }
- else if($timediff < 86400) { return $l->t('%d hours ago', $diffhours); }
+ else if($timediff < 3600) { return $l->n('%n minute ago', '%n minutes ago', $diffminutes); }
+ else if($timediff < 86400) { return $l->n('%n hour ago', '%n hours ago', $diffhours); }
else if((date('G')-$diffhours) > 0) { return $l->t('today'); }
else if((date('G')-$diffhours) > -24) { return $l->t('yesterday'); }
- else if($timediff < 2678400) { return $l->t('%d days ago', $diffdays); }
+ else if($timediff < 2678400) { return $l->n('%n day go', '%n days ago', $diffdays); }
else if($timediff < 5184000) { return $l->t('last month'); }
- else if((date('n')-$diffmonths) > 0) { return $l->t('%d months ago', $diffmonths); }
+ else if((date('n')-$diffmonths) > 0) { return $l->n('%n month ago', '%n months ago', $diffmonths); }
else if($timediff < 63113852) { return $l->t('last year'); }
else { return $l->t('years ago'); }
}
diff --git a/lib/user.php b/lib/user.php
index ee20f2e0971..93c7c9d4cd5 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -137,7 +137,6 @@ class OC_User {
*/
public static function useBackend($backend = 'database') {
if ($backend instanceof OC_User_Interface) {
- OC_Log::write('core', 'Adding user backend instance of ' . get_class($backend) . '.', OC_Log::DEBUG);
self::$_usedBackends[get_class($backend)] = $backend;
self::getManager()->registerBackend($backend);
} else {
diff --git a/lib/util.php b/lib/util.php
index 4c878f8b2fe..7c610e5400d 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -188,6 +188,10 @@ class OC_Util {
* @return array arrays with error messages and hints
*/
public static function checkServer() {
+ // Assume that if checkServer() succeeded before in this session, then all is fine.
+ if(\OC::$session->exists('checkServer_suceeded') && \OC::$session->get('checkServer_suceeded'))
+ return array();
+
$errors=array();
$defaults = new \OC_Defaults();
@@ -329,6 +333,9 @@ class OC_Util {
'hint'=>'Please ask your server administrator to restart the web server.');
}
+ // Cache the result of this function
+ \OC::$session->set('checkServer_suceeded', count($errors) == 0);
+
return $errors;
}
@@ -891,6 +898,10 @@ class OC_Util {
if (function_exists('xcache_clear_cache')) {
xcache_clear_cache(XC_TYPE_VAR, 0);
}
+ // Opcache (PHP >= 5.5)
+ if (function_exists('opcache_reset')) {
+ opcache_reset();
+ }
}
/**
@@ -910,4 +921,11 @@ class OC_Util {
return $value;
}
+
+ public static function basename($file)
+ {
+ $file = rtrim($file, '/');
+ $t = explode('/', $file);
+ return array_pop($t);
+ }
}