summaryrefslogtreecommitdiff
path: root/plugins/Geonames
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-10-04 12:54:36 -0700
committerBrion Vibber <brion@pobox.com>2010-10-04 12:54:36 -0700
commit59119482ca34540bd7f0a2a1aa994de1d5328ea2 (patch)
tree864fdc9dda3da54a78d868339c32479b5296b6d0 /plugins/Geonames
parent2db8aa3ec3f6804f8f16efe754aafb149f4035c9 (diff)
parent1652ded48c9c62c40157a5142e5231adbc574ddb (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
Conflicts: actions/hostmeta.php actions/imsettings.php classes/User.php lib/adminpanelaction.php lib/channel.php lib/default.php lib/router.php lib/util.php
Diffstat (limited to 'plugins/Geonames')
-rw-r--r--plugins/Geonames/GeonamesPlugin.php503
-rw-r--r--plugins/Geonames/locale/Geonames.pot23
-rw-r--r--plugins/Geonames/locale/br/LC_MESSAGES/Geonames.po31
-rw-r--r--plugins/Geonames/locale/eo/LC_MESSAGES/Geonames.po30
-rw-r--r--plugins/Geonames/locale/es/LC_MESSAGES/Geonames.po31
-rw-r--r--plugins/Geonames/locale/fr/LC_MESSAGES/Geonames.po32
-rw-r--r--plugins/Geonames/locale/ia/LC_MESSAGES/Geonames.po31
-rw-r--r--plugins/Geonames/locale/mk/LC_MESSAGES/Geonames.po31
-rw-r--r--plugins/Geonames/locale/nb/LC_MESSAGES/Geonames.po30
-rw-r--r--plugins/Geonames/locale/nl/LC_MESSAGES/Geonames.po31
-rw-r--r--plugins/Geonames/locale/ru/LC_MESSAGES/Geonames.po32
-rw-r--r--plugins/Geonames/locale/tl/LC_MESSAGES/Geonames.po31
-rw-r--r--plugins/Geonames/locale/uk/LC_MESSAGES/Geonames.po32
-rw-r--r--plugins/Geonames/locale/zh_CN/LC_MESSAGES/Geonames.po31
14 files changed, 899 insertions, 0 deletions
diff --git a/plugins/Geonames/GeonamesPlugin.php b/plugins/Geonames/GeonamesPlugin.php
new file mode 100644
index 000000000..d88014bb8
--- /dev/null
+++ b/plugins/Geonames/GeonamesPlugin.php
@@ -0,0 +1,503 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to convert string locations to Geonames IDs and vice versa
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Action
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+/**
+ * Plugin to convert string locations to Geonames IDs and vice versa
+ *
+ * This handles most of the events that Location class emits. It uses
+ * the geonames.org Web service to convert names like 'Montreal, Quebec, Canada'
+ * into IDs and lat/lon pairs.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ *
+ * @seeAlso Location
+ */
+class GeonamesPlugin extends Plugin
+{
+ const LOCATION_NS = 1;
+
+ public $host = 'ws.geonames.org';
+ public $username = null;
+ public $token = null;
+ public $expiry = 7776000; // 90-day expiry
+ public $timeout = 2; // Web service timeout in seconds.
+ public $timeoutWindow = 60; // Further lookups in this process will be disabled for N seconds after a timeout.
+ public $cachePrefix = null; // Optional shared memcache prefix override
+ // to share lookups between local instances.
+
+ protected $lastTimeout = null; // timestamp of last web service timeout
+
+ /**
+ * convert a name into a Location object
+ *
+ * @param string $name Name to convert
+ * @param string $language ISO code for anguage the name is in
+ * @param Location &$location Location object (may be null)
+ *
+ * @return boolean whether to continue (results in $location)
+ */
+ function onLocationFromName($name, $language, &$location)
+ {
+ $loc = $this->getCache(array('name' => $name,
+ 'language' => $language));
+
+ if ($loc !== false) {
+ $location = $loc;
+ return false;
+ }
+
+ try {
+ $geonames = $this->getGeonames('search',
+ array('maxRows' => 1,
+ 'q' => $name,
+ 'lang' => $language,
+ 'type' => 'xml'));
+ } catch (Exception $e) {
+ $this->log(LOG_WARNING, "Error for $name: " . $e->getMessage());
+ return true;
+ }
+
+ if (count($geonames) == 0) {
+ // no results
+ $this->setCache(array('name' => $name,
+ 'language' => $language),
+ null);
+ return true;
+ }
+
+ $n = $geonames[0];
+
+ $location = new Location();
+
+ $location->lat = $this->canonical($n->lat);
+ $location->lon = $this->canonical($n->lng);
+ $location->names[$language] = (string)$n->name;
+ $location->location_id = (string)$n->geonameId;
+ $location->location_ns = self::LOCATION_NS;
+
+ $this->setCache(array('name' => $name,
+ 'language' => $language),
+ $location);
+
+ // handled, don't continue processing!
+ return false;
+ }
+
+ /**
+ * convert an id into a Location object
+ *
+ * @param string $id Name to convert
+ * @param string $ns Name to convert
+ * @param string $language ISO code for language for results
+ * @param Location &$location Location object (may be null)
+ *
+ * @return boolean whether to continue (results in $location)
+ */
+ function onLocationFromId($id, $ns, $language, &$location)
+ {
+ if ($ns != self::LOCATION_NS) {
+ // It's not one of our IDs... keep processing
+ return true;
+ }
+
+ $loc = $this->getCache(array('id' => $id));
+
+ if ($loc !== false) {
+ $location = $loc;
+ return false;
+ }
+
+ try {
+ $geonames = $this->getGeonames('hierarchy',
+ array('geonameId' => $id,
+ 'lang' => $language));
+ } catch (Exception $e) {
+ $this->log(LOG_WARNING, "Error for ID $id: " . $e->getMessage());
+ return false;
+ }
+
+ $parts = array();
+
+ foreach ($geonames as $level) {
+ if (in_array($level->fcode, array('PCLI', 'ADM1', 'PPL'))) {
+ $parts[] = (string)$level->name;
+ }
+ }
+
+ $last = $geonames[count($geonames)-1];
+
+ if (!in_array($level->fcode, array('PCLI', 'ADM1', 'PPL'))) {
+ $parts[] = (string)$last->name;
+ }
+
+ $location = new Location();
+
+ $location->location_id = (string)$last->geonameId;
+ $location->location_ns = self::LOCATION_NS;
+ $location->lat = $this->canonical($last->lat);
+ $location->lon = $this->canonical($last->lng);
+
+ $location->names[$language] = implode(', ', array_reverse($parts));
+
+ $this->setCache(array('id' => (string)$last->geonameId),
+ $location);
+
+ // We're responsible for this namespace; nobody else
+ // can resolve it
+
+ return false;
+ }
+
+ /**
+ * convert a lat/lon pair into a Location object
+ *
+ * Given a lat/lon, we try to find a Location that's around
+ * it or nearby. We prefer populated places (cities, towns, villages).
+ *
+ * @param string $lat Latitude
+ * @param string $lon Longitude
+ * @param string $language ISO code for language for results
+ * @param Location &$location Location object (may be null)
+ *
+ * @return boolean whether to continue (results in $location)
+ */
+ function onLocationFromLatLon($lat, $lon, $language, &$location)
+ {
+ // Make sure they're canonical
+
+ $lat = $this->canonical($lat);
+ $lon = $this->canonical($lon);
+
+ $loc = $this->getCache(array('lat' => $lat,
+ 'lon' => $lon));
+
+ if ($loc !== false) {
+ $location = $loc;
+ return false;
+ }
+
+ try {
+ $geonames = $this->getGeonames('findNearbyPlaceName',
+ array('lat' => $lat,
+ 'lng' => $lon,
+ 'lang' => $language));
+ } catch (Exception $e) {
+ $this->log(LOG_WARNING, "Error for coords $lat, $lon: " . $e->getMessage());
+ return true;
+ }
+
+ if (count($geonames) == 0) {
+ // no results
+ $this->setCache(array('lat' => $lat,
+ 'lon' => $lon),
+ null);
+ return true;
+ }
+
+ $n = $geonames[0];
+
+ $parts = array();
+
+ $location = new Location();
+
+ $parts[] = (string)$n->name;
+
+ if (!empty($n->adminName1)) {
+ $parts[] = (string)$n->adminName1;
+ }
+
+ if (!empty($n->countryName)) {
+ $parts[] = (string)$n->countryName;
+ }
+
+ $location->location_id = (string)$n->geonameId;
+ $location->location_ns = self::LOCATION_NS;
+ $location->lat = $this->canonical($n->lat);
+ $location->lon = $this->canonical($n->lng);
+
+ $location->names[$language] = implode(', ', $parts);
+
+ $this->setCache(array('lat' => $lat,
+ 'lon' => $lon),
+ $location);
+
+ // Success! We handled it, so no further processing
+
+ return false;
+ }
+
+ /**
+ * Human-readable name for a location
+ *
+ * Given a location, we try to retrieve a human-readable name
+ * in the target language.
+ *
+ * @param Location $location Location to get the name for
+ * @param string $language ISO code for language to find name in
+ * @param string &$name Place to put the name
+ *
+ * @return boolean whether to continue
+ */
+ function onLocationNameLanguage($location, $language, &$name)
+ {
+ if ($location->location_ns != self::LOCATION_NS) {
+ // It's not one of our IDs... keep processing
+ return true;
+ }
+
+ $id = $location->location_id;
+
+ $n = $this->getCache(array('id' => $id,
+ 'language' => $language));
+
+ if ($n !== false) {
+ $name = $n;
+ return false;
+ }
+
+ try {
+ $geonames = $this->getGeonames('hierarchy',
+ array('geonameId' => $id,
+ 'lang' => $language));
+ } catch (Exception $e) {
+ $this->log(LOG_WARNING, "Error for ID $id: " . $e->getMessage());
+ return false;
+ }
+
+ if (count($geonames) == 0) {
+ $this->setCache(array('id' => $id,
+ 'language' => $language),
+ null);
+ return false;
+ }
+
+ $parts = array();
+
+ foreach ($geonames as $level) {
+ if (in_array($level->fcode, array('PCLI', 'ADM1', 'PPL'))) {
+ $parts[] = (string)$level->name;
+ }
+ }
+
+ $last = $geonames[count($geonames)-1];
+
+ if (!in_array($level->fcode, array('PCLI', 'ADM1', 'PPL'))) {
+ $parts[] = (string)$last->name;
+ }
+
+ if (count($parts)) {
+ $name = implode(', ', array_reverse($parts));
+ $this->setCache(array('id' => $id,
+ 'language' => $language),
+ $name);
+ }
+
+ return false;
+ }
+
+ /**
+ * Human-readable URL for a location
+ *
+ * Given a location, we try to retrieve a geonames.org URL.
+ *
+ * @param Location $location Location to get the url for
+ * @param string &$url Place to put the url
+ *
+ * @return boolean whether to continue
+ */
+ function onLocationUrl($location, &$url)
+ {
+ if ($location->location_ns != self::LOCATION_NS) {
+ // It's not one of our IDs... keep processing
+ return true;
+ }
+
+ $url = 'http://www.geonames.org/' . $location->location_id;
+
+ // it's been filled, so don't process further.
+ return false;
+ }
+
+ /**
+ * Machine-readable name for a location
+ *
+ * Given a location, we try to retrieve a geonames.org URL.
+ *
+ * @param Location $location Location to get the url for
+ * @param string &$url Place to put the url
+ *
+ * @return boolean whether to continue
+ */
+ function onLocationRdfUrl($location, &$url)
+ {
+ if ($location->location_ns != self::LOCATION_NS) {
+ // It's not one of our IDs... keep processing
+ return true;
+ }
+
+ $url = 'http://sws.geonames.org/' . $location->location_id . '/';
+
+ // it's been filled, so don't process further.
+ return false;
+ }
+
+ function getCache($attrs)
+ {
+ $c = Cache::instance();
+
+ if (empty($c)) {
+ return null;
+ }
+
+ $key = $this->cacheKey($attrs);
+
+ $value = $c->get($key);
+
+ return $value;
+ }
+
+ function setCache($attrs, $loc)
+ {
+ $c = Cache::instance();
+
+ if (empty($c)) {
+ return null;
+ }
+
+ $key = $this->cacheKey($attrs);
+
+ $result = $c->set($key, $loc, 0, time() + $this->expiry);
+
+ return $result;
+ }
+
+ function cacheKey($attrs)
+ {
+ $key = 'geonames:' .
+ implode(',', array_keys($attrs)) . ':'.
+ Cache::keyize(implode(',', array_values($attrs)));
+ if ($this->cachePrefix) {
+ return $this->cachePrefix . ':' . $key;
+ } else {
+ return Cache::key($key);
+ }
+ }
+
+ function wsUrl($method, $params)
+ {
+ if (!empty($this->username)) {
+ $params['username'] = $this->username;
+ }
+
+ if (!empty($this->token)) {
+ $params['token'] = $this->token;
+ }
+
+ $str = http_build_query($params, null, '&');
+
+ return 'http://'.$this->host.'/'.$method.'?'.$str;
+ }
+
+ function getGeonames($method, $params)
+ {
+ if ($this->lastTimeout && (time() - $this->lastTimeout < $this->timeoutWindow)) {
+ throw new Exception("skipping due to recent web service timeout");
+ }
+
+ $client = HTTPClient::start();
+ $client->setConfig('connect_timeout', $this->timeout);
+ $client->setConfig('timeout', $this->timeout);
+
+ try {
+ $result = $client->get($this->wsUrl($method, $params));
+ } catch (Exception $e) {
+ common_log(LOG_ERR, __METHOD__ . ": " . $e->getMessage());
+ $this->lastTimeout = time();
+ throw $e;
+ }
+
+ if (!$result->isOk()) {
+ throw new Exception("HTTP error code " . $result->getStatus());
+ }
+
+ $body = $result->getBody();
+
+ if (empty($body)) {
+ throw new Exception("Empty HTTP body in response");
+ }
+
+ // This will throw an exception if the XML is mal-formed
+
+ $document = new SimpleXMLElement($body);
+
+ // No children, usually no results
+
+ $children = $document->children();
+
+ if (count($children) == 0) {
+ return array();
+ }
+
+ if (isset($document->status)) {
+ throw new Exception("Error #".$document->status['value']." ('".$document->status['message']."')");
+ }
+
+ // Array of elements, >0 elements
+
+ return $document->geoname;
+ }
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => 'Geonames',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Evan Prodromou',
+ 'homepage' => 'http://status.net/wiki/Plugin:Geonames',
+ 'rawdescription' =>
+ _m('Uses <a href="http://geonames.org/">Geonames</a> service to get human-readable '.
+ 'names for locations based on user-provided lat/long pairs.'));
+ return true;
+ }
+
+ function canonical($coord)
+ {
+ $coord = rtrim($coord, "0");
+ $coord = rtrim($coord, ".");
+
+ return $coord;
+ }
+}
diff --git a/plugins/Geonames/locale/Geonames.pot b/plugins/Geonames/locale/Geonames.pot
new file mode 100644
index 000000000..10efb57ef
--- /dev/null
+++ b/plugins/Geonames/locale/Geonames.pot
@@ -0,0 +1,23 @@
+# 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-03 19:53+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"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
diff --git a/plugins/Geonames/locale/br/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/br/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..cf5fba135
--- /dev/null
+++ b/plugins/Geonames/locale/br/LC_MESSAGES/Geonames.po
@@ -0,0 +1,31 @@
+# Translation of StatusNet - Geonames to Breton (Brezhoneg)
+# Expored from translatewiki.net
+#
+# Author: Fulup
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+0000\n"
+"Language-Team: Breton <http://translatewiki.net/wiki/Portal:br>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: br\n"
+"X-Message-Group: #out-statusnet-plugin-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Implijout a ra ar servij <a href=\"http://geonames.org/\">Geonames</a> evit "
+"tapout anvadurioù douaroniel lennus gant mab-den evit lec'hiadoù diazezet "
+"war un daouad ledred/hedred pourchaset gant an implijer."
diff --git a/plugins/Geonames/locale/eo/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/eo/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..55ac440db
--- /dev/null
+++ b/plugins/Geonames/locale/eo/LC_MESSAGES/Geonames.po
@@ -0,0 +1,30 @@
+# Translation of StatusNet - Geonames to Esperanto (Esperanto)
+# Expored from translatewiki.net
+#
+# Author: LyzTyphone
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+0000\n"
+"Language-Team: Esperanto <http://translatewiki.net/wiki/Portal:eo>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: eo\n"
+"X-Message-Group: #out-statusnet-plugin-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Uziĝas <a href=\"http://geonames.org/\">Geonames</a> servo por akiri "
+"kompreneblan nomon de lokoj baze de latituda-longituda paro donita de uzanto."
diff --git a/plugins/Geonames/locale/es/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/es/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..ad3841c94
--- /dev/null
+++ b/plugins/Geonames/locale/es/LC_MESSAGES/Geonames.po
@@ -0,0 +1,31 @@
+# Translation of StatusNet - Geonames to Spanish (Español)
+# Expored from translatewiki.net
+#
+# Author: Translationista
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+0000\n"
+"Language-Team: Spanish <http://translatewiki.net/wiki/Portal:es>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: es\n"
+"X-Message-Group: #out-statusnet-plugin-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Usa el servicio <a href=\"http://geonames.org/\">Geonames</a>para obtener "
+"nombresde ubicaciones legibles por humanos, basadas en pares longitud/"
+"latitud provistos por el usuario."
diff --git a/plugins/Geonames/locale/fr/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/fr/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..8deaeed65
--- /dev/null
+++ b/plugins/Geonames/locale/fr/LC_MESSAGES/Geonames.po
@@ -0,0 +1,32 @@
+# Translation of StatusNet - Geonames to French (Français)
+# Expored from translatewiki.net
+#
+# Author: Verdy p
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+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-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); 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-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Utilise le service <a href=\"http://geonames.org/\">Geonames</a> pour "
+"obtenir des dénominations géographiques lisibles par l’homme pour les "
+"emplacements basés sur des paires latitude/longitude fournies par "
+"l’utilisateur."
diff --git a/plugins/Geonames/locale/ia/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/ia/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..a367b5822
--- /dev/null
+++ b/plugins/Geonames/locale/ia/LC_MESSAGES/Geonames.po
@@ -0,0 +1,31 @@
+# Translation of StatusNet - Geonames 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 - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+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-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); 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-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Usa le servicio <a href=\"http://geonames.org/\">Geonames</a> pro obtener "
+"nomines geographic ben legibile a base de coordinatas latitude/longitude "
+"fornite per usatores."
diff --git a/plugins/Geonames/locale/mk/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/mk/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..b57e675b4
--- /dev/null
+++ b/plugins/Geonames/locale/mk/LC_MESSAGES/Geonames.po
@@ -0,0 +1,31 @@
+# Translation of StatusNet - Geonames 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 - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+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-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); 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-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Ја користи службата <a href=\"http://geonames.org/\">Geonames</a> за "
+"добивање на имиња на места за приказ врз основа на парови од географска "
+"ширина и должина внесени од корисниците."
diff --git a/plugins/Geonames/locale/nb/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/nb/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..7cf63717d
--- /dev/null
+++ b/plugins/Geonames/locale/nb/LC_MESSAGES/Geonames.po
@@ -0,0 +1,30 @@
+# Translation of StatusNet - Geonames to Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
+# Expored from translatewiki.net
+#
+# Author: Nghtwlkr
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+0000\n"
+"Language-Team: Norwegian (bokmål)‬ <http://translatewiki.net/wiki/Portal:no>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: no\n"
+"X-Message-Group: #out-statusnet-plugin-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Bruker tjenesten <a href=\"http://geonames.org/\">Geonames</a> for å få "
+"lesbare navn for steder basert på brukergitte lengde- og breddegrader."
diff --git a/plugins/Geonames/locale/nl/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/nl/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..b8358b781
--- /dev/null
+++ b/plugins/Geonames/locale/nl/LC_MESSAGES/Geonames.po
@@ -0,0 +1,31 @@
+# Translation of StatusNet - Geonames 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 - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+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-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); 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-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"De dienst <a href=\"http://geonames.org/\">Geonames</a> gebruiken om "
+"leesbare namen voor locaties te krijgen op basis van door gebruikers "
+"opgegeven paren van lengte en breedte."
diff --git a/plugins/Geonames/locale/ru/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/ru/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..1387047e6
--- /dev/null
+++ b/plugins/Geonames/locale/ru/LC_MESSAGES/Geonames.po
@@ -0,0 +1,32 @@
+# Translation of StatusNet - Geonames to Russian (Русский)
+# Expored from translatewiki.net
+#
+# Author: Сrower
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+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-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); 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-geonames\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"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Использование сервиса <a href=\"http://geonames.org/\">GeoNames</a> для "
+"получения понятных для человека названий по указанным пользователем "
+"географическим координатам."
diff --git a/plugins/Geonames/locale/tl/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/tl/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..269a77434
--- /dev/null
+++ b/plugins/Geonames/locale/tl/LC_MESSAGES/Geonames.po
@@ -0,0 +1,31 @@
+# Translation of StatusNet - Geonames 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 - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+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-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); 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-geonames\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Gumagamit ng serbisyong <a href=\"http://geonames.org/\">Geonames</a> upang "
+"kumuha ng mga pangalan mababasa ng tao para sa mga lokasyon batay sa mga "
+"pares ng lat/long na bigay ng tagagamit."
diff --git a/plugins/Geonames/locale/uk/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/uk/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..1ee4b40eb
--- /dev/null
+++ b/plugins/Geonames/locale/uk/LC_MESSAGES/Geonames.po
@@ -0,0 +1,32 @@
+# Translation of StatusNet - Geonames 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 - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+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-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); 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-geonames\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"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"Використання сервісу <a href=\"http://geonames.org/\">Geonames</a> дозволяє "
+"отримувати зрозумілі географічні назви замість координат, що були вказані "
+"користувачами."
diff --git a/plugins/Geonames/locale/zh_CN/LC_MESSAGES/Geonames.po b/plugins/Geonames/locale/zh_CN/LC_MESSAGES/Geonames.po
new file mode 100644
index 000000000..09a978470
--- /dev/null
+++ b/plugins/Geonames/locale/zh_CN/LC_MESSAGES/Geonames.po
@@ -0,0 +1,31 @@
+# Translation of StatusNet - Geonames to Simplified Chinese (‪中文(简体)‬)
+# Expored from translatewiki.net
+#
+# Author: ZhengYiFeng
+# --
+# This file is distributed under the same license as the StatusNet package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: StatusNet - Geonames\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-10-03 19:53+0000\n"
+"PO-Revision-Date: 2010-10-03 19:56:46+0000\n"
+"Language-Team: Simplified Chinese <http://translatewiki.net/wiki/Portal:zh-"
+"hans>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-POT-Import-Date: 2010-10-01 20:38:54+0000\n"
+"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n"
+"X-Translation-Project: translatewiki.net at http://translatewiki.net\n"
+"X-Language-Code: zh-hans\n"
+"X-Message-Group: #out-statusnet-plugin-geonames\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: GeonamesPlugin.php:491
+msgid ""
+"Uses <a href=\"http://geonames.org/\">Geonames</a> service to get human-"
+"readable names for locations based on user-provided lat/long pairs."
+msgstr ""
+"使用 <a href=\"http://geonames.org/\">Geonames</a> 服务获取基于用户提供的经纬"
+"度坐标的可读的名称。"