From 4b5e977a7b1c390555d880d3dc7f8b8c6744646c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 8 Dec 2009 12:17:11 -0800 Subject: New _m() gettext wrapper with smart detection of plugin domains. Plugin base class registers your gettext files if present at initialization. update_pot.sh replaced with update_po_templates.php which can do core, plugins, or all (default). Top-level Makefile added to build .mo files for plugins as well as core. As described on list: http://lists.status.net/pipermail/statusnet-dev/2009-December/002869.html --- plugins/Mapstraction/MapstractionPlugin.php | 4 +-- plugins/Mapstraction/allmap.php | 4 +-- plugins/Mapstraction/locale/Mapstraction.po | 48 +++++++++++++++++++++++++++++ plugins/Mapstraction/map.php | 4 +-- plugins/Mapstraction/usermap.php | 2 +- 5 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 plugins/Mapstraction/locale/Mapstraction.po (limited to 'plugins/Mapstraction') diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php index f20e81b0e..93679e56c 100644 --- a/plugins/Mapstraction/MapstractionPlugin.php +++ b/plugins/Mapstraction/MapstractionPlugin.php @@ -177,7 +177,7 @@ class MapstractionPlugin extends Plugin $action->elementStart('div', array('id' => 'entity_map', 'class' => 'section')); - $action->element('h2', null, _('Map')); + $action->element('h2', null, _m('Map')); $action->element('div', array('id' => 'map_canvas', 'class' => 'gray smallmap', @@ -188,7 +188,7 @@ class MapstractionPlugin extends Plugin array('nickname' => $action->trimmed('nickname'))); $action->element('a', array('href' => $mapUrl), - _("Full size")); + _m("Full size")); $action->elementEnd('div'); } diff --git a/plugins/Mapstraction/allmap.php b/plugins/Mapstraction/allmap.php index 0c4f03b31..e73aa76e8 100644 --- a/plugins/Mapstraction/allmap.php +++ b/plugins/Mapstraction/allmap.php @@ -68,10 +68,10 @@ class AllmapAction extends MapAction } if ($this->page == 1) { - return sprintf(_("%s friends map"), + return sprintf(_m("%s friends map"), $base); } else { - return sprintf(_("%s friends map, page %d"), + return sprintf(_m("%s friends map, page %d"), $base, $this->page); } diff --git a/plugins/Mapstraction/locale/Mapstraction.po b/plugins/Mapstraction/locale/Mapstraction.po new file mode 100644 index 000000000..c1c50bf50 --- /dev/null +++ b/plugins/Mapstraction/locale/Mapstraction.po @@ -0,0 +1,48 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-12-07 20:38-0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: allmap.php:71 +#, php-format +msgid "%s friends map" +msgstr "" + +#: allmap.php:74 +#, php-format +msgid "%s friends map, page %d" +msgstr "" + +#: map.php:72 +msgid "No such user." +msgstr "" + +#: map.php:79 +msgid "User has no profile." +msgstr "" + +#: usermap.php:71 +#, php-format +msgid "%s map, page %d" +msgstr "" + +#: MapstractionPlugin.php:180 +msgid "Map" +msgstr "" + +#: MapstractionPlugin.php:191 +msgid "Full size" +msgstr "" diff --git a/plugins/Mapstraction/map.php b/plugins/Mapstraction/map.php index 734e48088..a33dfc736 100644 --- a/plugins/Mapstraction/map.php +++ b/plugins/Mapstraction/map.php @@ -69,14 +69,14 @@ class MapAction extends OwnerDesignAction $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - $this->clientError(_('No such user.'), 404); + $this->clientError(_m('No such user.'), 404); return false; } $this->profile = $this->user->getProfile(); if (!$this->profile) { - $this->serverError(_('User has no profile.')); + $this->serverError(_m('User has no profile.')); return false; } diff --git a/plugins/Mapstraction/usermap.php b/plugins/Mapstraction/usermap.php index 3e517ee86..ff47b6ada 100644 --- a/plugins/Mapstraction/usermap.php +++ b/plugins/Mapstraction/usermap.php @@ -68,7 +68,7 @@ class UsermapAction extends MapAction if ($this->page == 1) { return $base; } else { - return sprintf(_("%s map, page %d"), + return sprintf(_m("%s map, page %d"), $base, $this->page); } -- cgit v1.2.3-54-g00ecf