Re: [PHPTAL] Collecting translation messages from templates

2010-11-04 Thread Kornel Lesiński

On 04-11-2010 at 02:52:06 Per Bernhardt  wrote:

When using gettext within php, tools like "poedit" are able to parse the  
php source code to generate a list of all messages that have to be  
translated.

Is there anything similar for phptal and it's i18n features?


There is a tool for this in SVN:

https://svn.motion-twin.com/phptal/phptal_i18n/trunk/

but I haven't touched it for a while, so I'm not sure if it still works.

--
regards, Kornel

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] Collecting translation messages from templates

2010-11-03 Thread Per Bernhardt
Hi,

When using gettext within php, tools like "poedit" are able to parse the php 
source code to generate a list of all messages that have to be translated.
Is there anything similar for phptal and it's i18n features?

We thought about it and it looks like a parses could easily be written:

- Any translation is within a tag with a "i18n:translate" attribute on it
- Nested translations are forbidden
- Only "i18n:name" is allowed within translations, so all other markup and any 
tal:repeat or the like are stripped

So as long as you don't use any  you 
could find those tags, replace i18n:names with ${placeholders} and strip all 
other markup from their content to generate a complete list of messages from 
any / all templates (We therefor would recommend to disable the ability to use 
${} within i18n:translate. It's just sending you down the wrong path...).

So, we have two questions:

1. Is there anybody who already solved this stuff?
2. If not, does anybody have any hint why this approach won't work?

Kind regards,
Per
 
--

webfactory GmbH
Per Bernhardt, Anwendungsentwickler

Lessingstraße 60
53113 Bonn
Germany

Fon +49 228 9114455
Fax +49 228 9114499
www.webfactory.de
p...@webfactory.de

Geschäftsführer: Sebastian Kugler, Matthias Pigulla
Handelsregister: HRB 8673, Amtsgericht Bonn


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal