1 edb Apr 24, 2008 19:04
3 edb Apr 24, 2008 20:19
Thanks friend! Now creating messages.pot and eventually fully or partially translated plugins will be very easy.
Search the plugin for translatable bits.
Stash each bit with it's line number in an array.
Sort the array by alphabet.
Output the appropriate bits for the messages.pot file.
Hooray for translatable plugins!
4 edb Apr 25, 2008 03:30
Okay one more question...
I have an automated method to create a messages.pot file that eventually I will give away to anyone who wants it. It assumes $this->T_('foo') is what will be translated, and unfortunately doesn't even try to deal with something like $this->T_('doesn\'t') - which is technically legal I guess but won't work with my little hack job.
I'm thinking about the locales/ab_CD/_global.php and locales/ab_CD/LC_MESSAGES/messages.po files that actually be a translation. Should I try to create a "sample" translation package (the two files), or should I leave that up to the actual translator to do?
Perhaps the best solution here is to provide 2 tools. One for the plugin author to create messages.pot, and another for the translator to create _global.php from the messages.po file that poedit created?
Thoughts?
5 sam2kb Apr 25, 2008 03:53
A sample translation files are needed when somebody wants to create a very first translation, so he don't have to create and name files/folders.
But a tool, which can automatically create _global.php without uploading messages.po in existing system, is very useful.
Now these two steps creating messages.pot and extracting _global.php take too much time, at least for Windows users. :(
I believe there are no order rules, since b2evo search the string through the whole global.php file.
I successfully merged and changed the order in messages.pot files.