On 10/17/2011 01:13 PM, Jark Tonnätt wrote:
Hello
I'm new to Agavi and I'm trying to use "AgaviGettextTranslator".
This is a part of my php-test-file:
echo $this->tm->_('Tasse', 'default.test', 'en'); echo
$this->tm->_(array('Ein Kamel', '%d Kamele', 3), 'default.test', 'en');
It's simple to create a po-file:
xgettext filename.php
But my first problem is: Only singular translations are detected. The
second line is ignored, because it's not the php-standard syntax of
(n)gettext. How is it possible to translate the second line?
From a quick look at xgettext manual, and assuming I understand your
question correctly, what you want is
xgettext foo.php -o foo.po -karray:1,2
This, then, produces the following:
#: foo.php:3
msgid "Tasse"
msgstr ""
#: foo.php:3
#, php-format
msgid "Ein Kamel"
msgid_plural "%d Kamele"
msgstr[0] ""
msgstr[1] ""
After I've got the po-template-file I create a new translation with:
msginit --locale=en --input=messages.po
The file en.po will created and I can add my translation ("Tasse").
But now I add the following line in the php-file:
echo $this->tm->_('Tisch', 'default.test', 'en');
If I want to extend the existing template-file (messages.po) with
xgettext, there is no problem.
But if I want to extend the translation-file (en.po) with msginit (see
above) I will get an error, because the file already exists.
You aren't supposed to do that with msginit. It is designed to create
new PO files only. The correct procedure is to create a POT (template)
file with xgettext, and then keep the slave files up to date with msgcat
and msgmerge, please see gettext info manual for details.
What can is do? Ok the second question isn't agavi specific, but I
hope anyone knows an answer.
And a last question: Is agavi not documented? I see only a tutorial
and inofficial faq. Will there be a documentation in the future?
The API documentation is the primary documentation I use, and I feel
comfortable reading the source code anyway. Although the tutorial has
plenty of information about architecture and use of many components, a
full user manual hasn't yet been written because everyone's busy doing
real work ;)
Thx and Regards, Jark
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users