Translation Tools for Symfony2

New topics about Symfony 2 should go here

Moderators: dcobalt, tiagojsag

Translation Tools for Symfony2

Postby ipartemk » Thu Nov 17, 2011 11:57 am

in ZendFramework I used PoEdit.

Symfony provide 3 types libraries
· xliff: XLIFF file;
· php: PHP file;
· yml: YAML file.

I need Tool, wich collect translation KEYS from
- Controllers
trans('Symfony2 is great');
trans('Hello %name%', array('%name%' => $name));
transChoice( 'There is one apple|There are %count% apples', 10, array('%count%' => 10) );

- Twig
{% trans %}Hello %name%{% endtrans %}
{% transchoice count %} {0} There is no apples|{1} There is one apple|]1,Inf] There are %count% apples {% endtranschoice %}

...and give interface for translation this keys. Results should saved in any provided type library. In general , everything what PoEdit can.

I saw this links, but not try:
http://xliff-tools.freedesktop.org/wiki/
http://drupal.org/project/xliff

What Tool do you use?
User avatar
ipartemk
Junior Member
 
Posts: 4
Joined: Thu Nov 17, 2011 10:54 am

Re: Translation Tools for Symfony2

Postby althaus » Thu Nov 17, 2011 3:20 pm

This it at the moment no strength of Symfony2. IIRC the core team is working on gettext support for the 2.1 release.

I'm currently using only key based translations and as I don't have that much entries, I'm doing it by good old copy and paste. A simple script reading the files with some regex magic should do the trick to create a translation file of your choice. Then you'd only need a separate tool for the translation process itself.

Cheers
Matthias
althaus
Faithful Member
 
Posts: 605
Joined: Tue Oct 18, 2011 2:20 pm
Location: Germany

Re: Translation Tools for Symfony2

Postby ipartemk » Fri Nov 18, 2011 9:22 am

Thank you for reply.
I know about version 2.1 with gettext, but I doubt that PoEdit can find keys in Twig...

Your approach with copy/paste is not very good with several moments:
- you can lost some keys;
- you can make mistake in key or change them and not translate later;

So the best way is automatic key searching with some tool.

One friend give me an URL to bundle
https://github.com/schmittjoh/JMSTransl ... /index.rst

may be this can help, but I'm not try yet :)
If some one already used this and can say , is this bundle solve my problem in topic ?
User avatar
ipartemk
Junior Member
 
Posts: 4
Joined: Thu Nov 17, 2011 10:54 am

Re: Translation Tools for Symfony2

Postby althaus » Fri Nov 18, 2011 2:55 pm

I know that doing manually isn't a solution as soon as you hit a certain load of text. ^^

One friend give me an URL to bundle

That sounds really nice and I think I stumbled upon it some time ago. As it's created by schmittjoh (core dev), I'd really give it a try.

I'll add it to my project and see how it's working out.

Cheers
Matthias
althaus
Faithful Member
 
Posts: 605
Joined: Tue Oct 18, 2011 2:20 pm
Location: Germany

Re: Translation Tools for Symfony2

Postby ipartemk » Mon Dec 12, 2011 4:35 pm

User avatar
ipartemk
Junior Member
 
Posts: 4
Joined: Thu Nov 17, 2011 10:54 am

Re: Translation Tools for Symfony2

Postby jmontoya » Wed Apr 11, 2012 2:26 pm

Chamilo Developer
www.chamilo.org
jmontoya
Junior Member
 
Posts: 1
Joined: Wed Apr 11, 2012 2:13 pm

Re: Translation Tools for Symfony2

Postby umpirsky » Fri Aug 31, 2012 4:03 pm

Here is how you can extract strings from Twig templates with Poedit http://dev.umpirsky.com/use-poedit-to-e ... templates/.
umpirsky
Junior Member
 
Posts: 16
Joined: Fri Dec 31, 2010 9:19 am


Return to General Symfony 2 discussion

Who is online

Users browsing this forum: Bing [Bot] and 4 guests