I just had some spare time and wrote a Script that extracts all translatable entries from a given Directory.
The Script is called LangBuilder and is attached to this post. It should work under Mac OS X or Linux with PHP installed. I wasn't able to test this on Windows as of now.
Extract the archive. The LangBuilder.php script is a command line PHP script. You'll need to set the executable permission bit (eg. chmod 0755 LangBuilder.php).
Open your shell and type:
LangBuilder.php module/dir pathto/outputfile.php
This will search the module/dir and all its sub-directories for translatable strings and write them to pathto/outputfile.php.
For help, just enter
I ran this script for the event_calendar module folder. Attached to this post, you'll find the auto-generated file (autocreated.php)
Hope that helps.
This script might be useful for all module developers. I should possibly provide it somewhere for download.
Wow, banal, I'm speechless. That is a really slick script for the two hours it took you. I had already started the copying-and-pasting process, but I suppose I can stop now and use your file. Anxious to use in my other modules. Please submit to the Silverstripe team. This is way to useful to be ignored.
Glad the script is useful to you. Oh yes I see, now that you mention it... the date templates are broken. I guess my script can't resolve PHP variables as translate keys... that would be a task of other magnitude.
Hmm I think that's a case where the developer has to do some work on his own :)
Regarding SVN access: That would be nice, yes. You can contact me via mailbox [at] banal.ch
I fixed a problem with the LangBuilder (escaped quotes were matched as closing quotes). You can find the new version here:
Oh, btw. There seems to be a utility like this built into SilverStripe:
It didn't work for me though.
Update: I was just informed, that as of SilverStripe 2.3, the textcollector can be invoked using the following url:
Use with caution, since this will overwrite your en_US.php file