summaryrefslogtreecommitdiff
path: root/plugins/SphinxSearch
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SphinxSearch')
-rw-r--r--plugins/SphinxSearch/SphinxSearchPlugin.php30
-rw-r--r--plugins/SphinxSearch/locale/SphinxSearch.pot32
-rw-r--r--plugins/SphinxSearch/locale/fr/LC_MESSAGES/SphinxSearch.po38
-rw-r--r--plugins/SphinxSearch/locale/ia/LC_MESSAGES/SphinxSearch.po37
-rw-r--r--plugins/SphinxSearch/locale/mk/LC_MESSAGES/SphinxSearch.po37
-rw-r--r--plugins/SphinxSearch/locale/nl/LC_MESSAGES/SphinxSearch.po38
-rw-r--r--plugins/SphinxSearch/locale/ru/LC_MESSAGES/SphinxSearch.po38
-rw-r--r--plugins/SphinxSearch/locale/tl/LC_MESSAGES/SphinxSearch.po38
-rw-r--r--plugins/SphinxSearch/locale/uk/LC_MESSAGES/SphinxSearch.po38
-rwxr-xr-xplugins/SphinxSearch/scripts/gen_config.php2
-rwxr-xr-xplugins/SphinxSearch/scripts/index_update.php8
-rw-r--r--plugins/SphinxSearch/scripts/sphinx-utils.php1
-rw-r--r--plugins/SphinxSearch/sphinxsearch.php4
13 files changed, 329 insertions, 12 deletions
diff --git a/plugins/SphinxSearch/SphinxSearchPlugin.php b/plugins/SphinxSearch/SphinxSearchPlugin.php
index 7a27a4c04..ad34a7cc1 100644
--- a/plugins/SphinxSearch/SphinxSearchPlugin.php
+++ b/plugins/SphinxSearch/SphinxSearchPlugin.php
@@ -41,8 +41,6 @@ foreach($sphinxDefaults as $key => $val) {
}
}
-
-
/**
* Plugin for Sphinx search backend.
*
@@ -53,7 +51,6 @@ foreach($sphinxDefaults as $key => $val) {
* @link http://laconi.ca/
* @link http://twitter.com/
*/
-
class SphinxSearchPlugin extends Plugin
{
/**
@@ -86,7 +83,8 @@ class SphinxSearchPlugin extends Plugin
{
if (common_config('sphinx', 'enabled')) {
if (!class_exists('SphinxClient')) {
- throw new ServerException('Sphinx PHP extension must be installed.');
+ // TRANS: Server exception.
+ throw new ServerException(_m('Sphinx PHP extension must be installed.'));
}
$engine = new SphinxSearch($target, $table);
if ($engine->is_connected()) {
@@ -97,4 +95,28 @@ class SphinxSearchPlugin extends Plugin
// Sphinx disabled or disconnected
return true;
}
+
+ /**
+ * Provide plugin version information.
+ *
+ * This data is used when showing the version page.
+ *
+ * @param array &$versions array of version data arrays; see EVENTS.txt
+ *
+ * @return boolean hook value
+ */
+ function onPluginVersion(&$versions)
+ {
+ $url = 'http://status.net/wiki/Plugin:SphinxSearch';
+
+ $versions[] = array('name' => 'SphinxSearch',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Brion Vibber',
+ 'homepage' => $url,
+ 'rawdescription' =>
+ // TRANS: Plugin description.
+ _m('Plugin for Sphinx search backend.'));
+
+ return true;
+ }
}
diff --git a/plugins/SphinxSearch/locale/SphinxSearch.pot b/plugins/SphinxSearch/locale/SphinxSearch.pot
new file mode 100644
index 000000000..cac794802
--- /dev/null
+++ b/plugins/SphinxSearch/locale/SphinxSearch.pot
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-09 14:04+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr ""
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr ""
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr ""
diff --git a/plugins/SphinxSearch/locale/fr/LC_MESSAGES/SphinxSearch.po b/plugins/SphinxSearch/locale/fr/LC_MESSAGES/SphinxSearch.po
new file mode 100644
index 000000000..98f421c77
--- /dev/null
+++ b/plugins/SphinxSearch/locale/fr/LC_MESSAGES/SphinxSearch.po
@@ -0,0 +1,38 @@
+# Translation of StatusNet - SphinxSearch to French (Français)
+# Expored from translatewiki.net
+#
+# Author: Peter17
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - SphinxSearch\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-09 14:04+0000\n"
+"PO-Revision-Date: 2010-10-09 14:08:23+0000\n"
+"Language-Team: French <http://translatewiki.net/wiki/Portal:fr>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-04 23:12:36+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74529); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: fr\n"
+"X-Message-Group: #out-statusnet-plugin-sphinxsearch\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr "L’extension PHP Sphinx doit être installée."
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr "Extension pour le moteur de recherche Sphinx."
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr ""
+"La recherche Sphinx n’a pas pu identifier le nom de la base de données."
diff --git a/plugins/SphinxSearch/locale/ia/LC_MESSAGES/SphinxSearch.po b/plugins/SphinxSearch/locale/ia/LC_MESSAGES/SphinxSearch.po
new file mode 100644
index 000000000..b07a0f0ef
--- /dev/null
+++ b/plugins/SphinxSearch/locale/ia/LC_MESSAGES/SphinxSearch.po
@@ -0,0 +1,37 @@
+# Translation of StatusNet - SphinxSearch to Interlingua (Interlingua)
+# Expored from translatewiki.net
+#
+# Author: McDutchie
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - SphinxSearch\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-09 14:04+0000\n"
+"PO-Revision-Date: 2010-10-09 14:08:23+0000\n"
+"Language-Team: Interlingua <http://translatewiki.net/wiki/Portal:ia>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-04 23:12:36+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74529); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: ia\n"
+"X-Message-Group: #out-statusnet-plugin-sphinxsearch\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr "Le extension PHP Sphinx debe esser installate."
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr "Plug-in pro back-end de recerca Sphinx."
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr "Le recerca Sphinx non poteva identificar le nomine del base de datos."
diff --git a/plugins/SphinxSearch/locale/mk/LC_MESSAGES/SphinxSearch.po b/plugins/SphinxSearch/locale/mk/LC_MESSAGES/SphinxSearch.po
new file mode 100644
index 000000000..3a0dbd620
--- /dev/null
+++ b/plugins/SphinxSearch/locale/mk/LC_MESSAGES/SphinxSearch.po
@@ -0,0 +1,37 @@
+# Translation of StatusNet - SphinxSearch to Macedonian (Македонски)
+# Expored from translatewiki.net
+#
+# Author: Bjankuloski06
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - SphinxSearch\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-09 14:04+0000\n"
+"PO-Revision-Date: 2010-10-09 14:08:23+0000\n"
+"Language-Team: Macedonian <http://translatewiki.net/wiki/Portal:mk>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-04 23:12:36+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74529); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: mk\n"
+"X-Message-Group: #out-statusnet-plugin-sphinxsearch\n"
+"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr "Мора да се инсталира PHP-додатокот Sphinx"
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr "Приклучок за пребарување со Sphinx."
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr "Пребарувањето со Sphinx не можеше да го утврди името на базата."
diff --git a/plugins/SphinxSearch/locale/nl/LC_MESSAGES/SphinxSearch.po b/plugins/SphinxSearch/locale/nl/LC_MESSAGES/SphinxSearch.po
new file mode 100644
index 000000000..d12baabe4
--- /dev/null
+++ b/plugins/SphinxSearch/locale/nl/LC_MESSAGES/SphinxSearch.po
@@ -0,0 +1,38 @@
+# Translation of StatusNet - SphinxSearch to Dutch (Nederlands)
+# Expored from translatewiki.net
+#
+# Author: Siebrand
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - SphinxSearch\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-09 14:04+0000\n"
+"PO-Revision-Date: 2010-10-09 14:08:23+0000\n"
+"Language-Team: Dutch <http://translatewiki.net/wiki/Portal:nl>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-04 23:12:36+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74529); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: nl\n"
+"X-Message-Group: #out-statusnet-plugin-sphinxsearch\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr "De PHP-extensie Sphinx moet geïnstalleerd. zijn."
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr "Plug-in voor een Sphinxbackend."
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr ""
+"Het was voor Sphinx search niet mogelijk een database te identificeren."
diff --git a/plugins/SphinxSearch/locale/ru/LC_MESSAGES/SphinxSearch.po b/plugins/SphinxSearch/locale/ru/LC_MESSAGES/SphinxSearch.po
new file mode 100644
index 000000000..6541ab169
--- /dev/null
+++ b/plugins/SphinxSearch/locale/ru/LC_MESSAGES/SphinxSearch.po
@@ -0,0 +1,38 @@
+# Translation of StatusNet - SphinxSearch to Russian (Русский)
+# Expored from translatewiki.net
+#
+# Author: MaxSem
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - SphinxSearch\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-18 18:35+0000\n"
+"PO-Revision-Date: 2010-10-18 18:43:56+0000\n"
+"Language-Team: Russian <http://translatewiki.net/wiki/Portal:ru>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-09 14:37:22+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74952); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: ru\n"
+"X-Message-Group: #out-statusnet-plugin-sphinxsearch\n"
+"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= "
+"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr "Необходимо установить расширение Sphinx для PHP."
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr "Плагин для поискового движка Sphinx."
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr "Поиск Sphinx не смог определить название базы данных."
diff --git a/plugins/SphinxSearch/locale/tl/LC_MESSAGES/SphinxSearch.po b/plugins/SphinxSearch/locale/tl/LC_MESSAGES/SphinxSearch.po
new file mode 100644
index 000000000..62a35bf2c
--- /dev/null
+++ b/plugins/SphinxSearch/locale/tl/LC_MESSAGES/SphinxSearch.po
@@ -0,0 +1,38 @@
+# Translation of StatusNet - SphinxSearch to Tagalog (Tagalog)
+# Expored from translatewiki.net
+#
+# Author: AnakngAraw
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - SphinxSearch\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-09 14:04+0000\n"
+"PO-Revision-Date: 2010-10-09 14:08:23+0000\n"
+"Language-Team: Tagalog <http://translatewiki.net/wiki/Portal:tl>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-04 23:12:36+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74529); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: tl\n"
+"X-Message-Group: #out-statusnet-plugin-sphinxsearch\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr "Dapat na iluklok ang dugtong na PHP ng Sphinx."
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr "Pamasak para sa wakas ng likuran ng panghanap ng Sphinx."
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr ""
+"Hindi makilala ng panghanap ng Sphinx ang pangalan ng kalipunan ng dato."
diff --git a/plugins/SphinxSearch/locale/uk/LC_MESSAGES/SphinxSearch.po b/plugins/SphinxSearch/locale/uk/LC_MESSAGES/SphinxSearch.po
new file mode 100644
index 000000000..db526fb32
--- /dev/null
+++ b/plugins/SphinxSearch/locale/uk/LC_MESSAGES/SphinxSearch.po
@@ -0,0 +1,38 @@
+# Translation of StatusNet - SphinxSearch to Ukrainian (Українська)
+# Expored from translatewiki.net
+#
+# Author: Boogie
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - SphinxSearch\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-09 14:04+0000\n"
+"PO-Revision-Date: 2010-10-09 14:08:23+0000\n"
+"Language-Team: Ukrainian <http://translatewiki.net/wiki/Portal:uk>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-04 23:12:36+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74529); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: uk\n"
+"X-Message-Group: #out-statusnet-plugin-sphinxsearch\n"
+"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= "
+"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n"
+
+#. TRANS: Server exception.
+#: SphinxSearchPlugin.php:87
+msgid "Sphinx PHP extension must be installed."
+msgstr "Розширення Sphinx PHP повинно бути встановлено."
+
+#. TRANS: Plugin description.
+#: SphinxSearchPlugin.php:118
+msgid "Plugin for Sphinx search backend."
+msgstr "Додаток для пошуку за допомогою Sphinx."
+
+#. TRANS: Server exception thrown when a database name cannot be identified.
+#: sphinxsearch.php:96
+msgid "Sphinx search could not identify database name."
+msgstr "Пошук Sphinx не може визначити ім’я бази даних."
diff --git a/plugins/SphinxSearch/scripts/gen_config.php b/plugins/SphinxSearch/scripts/gen_config.php
index d5a00b6b6..e7f397747 100755
--- a/plugins/SphinxSearch/scripts/gen_config.php
+++ b/plugins/SphinxSearch/scripts/gen_config.php
@@ -70,8 +70,6 @@ searchd
END;
-
-
/**
* Build config entries for a single site
* @fixme we only seem to have master DB currently available...
diff --git a/plugins/SphinxSearch/scripts/index_update.php b/plugins/SphinxSearch/scripts/index_update.php
index 23c60ced7..abac5434f 100755
--- a/plugins/SphinxSearch/scripts/index_update.php
+++ b/plugins/SphinxSearch/scripts/index_update.php
@@ -42,20 +42,20 @@ sphinx_iterate_sites('sphinx_index_update');
function sphinx_index_update($sn)
{
$base = sphinx_base();
-
+
$baseIndexes = array('notice', 'profile');
$params = array();
-
+
if (have_option('rotate')) {
$params[] = '--rotate';
}
foreach ($baseIndexes as $index) {
$params[] = "{$sn->dbname}_{$index}";
}
-
+
$params = implode(' ', $params);
$cmd = "$base/bin/indexer --config $base/etc/sphinx.conf $params";
-
+
print "$cmd\n";
system($cmd);
}
diff --git a/plugins/SphinxSearch/scripts/sphinx-utils.php b/plugins/SphinxSearch/scripts/sphinx-utils.php
index 7bbc25270..22d70fb8d 100644
--- a/plugins/SphinxSearch/scripts/sphinx-utils.php
+++ b/plugins/SphinxSearch/scripts/sphinx-utils.php
@@ -60,4 +60,3 @@ function sphinx_iterate_sites($callback)
}
}
}
-
diff --git a/plugins/SphinxSearch/sphinxsearch.php b/plugins/SphinxSearch/sphinxsearch.php
index 654b9c9d5..1ce9bfd72 100644
--- a/plugins/SphinxSearch/sphinxsearch.php
+++ b/plugins/SphinxSearch/sphinxsearch.php
@@ -91,6 +91,8 @@ class SphinxSearch extends SearchEngine
if (preg_match('!^.*?://.*?:.*?@.*?/(.*?)$!', common_config('db', 'database'), $matches)) {
return $matches[1];
}
- throw new ServerException("Sphinx search could not identify database name");
+
+ // TRANS: Server exception thrown when a database name cannot be identified.
+ throw new ServerException(_m("Sphinx search could not identify database name."));
}
}