A script that helps the SilverStripe Module developer to extract all translatable Strings and save them as a file.
This is a command line script that should work on Mac OS X or Linux/Unix with installed PHP. Will be tested soon on Windows. Since the script has to be executable, one must set the according permission bit.
After that, you can enter the following in your shell:
This will search all *.php and *.ss files in the given directory (and its subdirectories) for calls to the translate method (_t). All translatable strings will then be stored in a php file, in above example to: pathto/output.php
Per default, the output directory is: <searchdir>/lang/en_US.php
For a brief help text, just enter:
The extracted Strings can serve as a starting-point for translations.
Please note: This only works for hard-coded string identifiers, not for variables: