I’m developing a web app in Kohana 3.2.
I use the __() function in message files, views, etc. because I want to make my app available in multiple languages.
Is there a fast and easy way to collect all the strings I have to translate? For example a code editor that can do this for me (on windows)?
So I want a list with all the strings from all my files, used for calling the __() function.
How you handle this problem, or what you suggest?
Thank you!
There is a simple drop-in module (kohana-i18nget, kohana-i18nget on github) that lets you collect all your __() enclosed strings from a module or the application folder and outputs the appropriate language arrays (specify all the needed languages in the config file) to your i18n folders.
Any already existing translation keys are kept intact. It is invoked from your project root via the commandline:
The first command generates language files for strings found in mymodule to mymodule/i18n/, the second generates the files for the application folder in application/i18n/
It also points out orphaned translation keys which are not used in the source files.