Update of /cvsroot/phpwebapp/web_app/l10n-module/php-gettext/examples
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26701/l10n-module/php-gettext/examples
Added Files:
update serbian.po serbian.mo pigs.php
Log Message:
l10n renamed to l10n-module
--- NEW FILE: update ---
#!/bin/sh
TEMPLATE=pigs.pot
xgettext -kT_ngettext:1,2 -kT_ -L PHP -o $TEMPLATE pigs.php
if [ x$1 == 'x-p' ]; then
msgfmt --statistics $TEMPLATE
else
if [ -f $1.po ]; then
msgmerge -o .tmp$1.po $1.po $TEMPLATE
mv .tmp$1.po $1.po
msgfmt --statistics $1.po
else
echo "Usage: $0 [-p|<basename>]"
fi
fi
--- NEW FILE: serbian.po ---
# Sample translation for PHP-gettext 1.0
# Copyright (c) 2003 Danilo Segan <da...@kv...>
#
msgid ""
msgstr ""
"Project-Id-Version: pigs\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-10-23 04:50+0200\n"
"PO-Revision-Date: 2003-11-01 23:40+0100\n"
"Last-Translator: Danilo Segan <da...@kv...>\n"
"Language-Team: Serbian (sr) <da...@kv...>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\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"
#: pigs.php:19
msgid ""
"This is how the story goes.\n"
"\n"
msgstr ""
"Ðвако иде пÑиÑа.\n"
"\n"
#: pigs.php:21
#, php-format
msgid "%d pig went to the market\n"
msgid_plural "%d pigs went to the market\n"
msgstr[0] "%d мало пÑаÑе Ñе оÑиÑло на пиÑаÑ\n"
msgstr[1] "%d мала пÑаÑеÑа ÑÑ Ð¾ÑиÑла на пиÑаÑ\n"
msgstr[2] "%d малиÑ
пÑаÑеÑа Ñе оÑиÑло на пиÑаÑ\n"
--- NEW FILE: serbian.mo ---
Þ
Report-Msgid-Bugs-To:
POT-Creation-Date: 2003-10-23 04:50+0200
PO-Revision-Date: 2003-11-01 23:40+0100
Last-Translator: Danilo Segan <da...@kv...>
Language-Team: Serbian (sr) <da...@kv...>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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);
--- NEW FILE: pigs.php ---
<?php
/*
Copyright (c) 2003 Danilo Segan <da...@kv...>.
This file is part of PHP-gettext.
PHP-gettext is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
PHP-gettext 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with PHP-gettext; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require("../streams.php");
require("../gettext.php");
$input = new FileReader('serbian.mo');
$l10n = new gettext_reader($input);
// create standard wrapers, so xgettext could work
function T_($text) {
global $l10n;
return $l10n->translate($text);
}
function T_ngettext($single, $plural, $number) {
global $l10n;
return $l10n->ngettext($single, $plural, $number);
}
print T_("This is how the story goes.\n\n");
for ($number=6; $number>=0; $number--) {
print sprintf( T_ngettext("%d pig went to the market\n",
"%d pigs went to the market\n", $number),
$number );
}
?>
|