In taking a look through the code base, one way to change over to gettext might be to modify the language system to only have a single language directory instead of a language directory for each language. So instead of this:
Code: Select all
admin/language/english/payment/
admin/language/french/payment/
admin/language/spanish/payment/
Code: Select all
admin/language/payment/
Code: Select all
Order Status
Code: Select all
_('Order Status')
And then you can run xgettext over your OpenCart files and it will extract all of your translatable strings into a messages.po file. Then you put your translation in it and run 'msgfmt' to gen the messages.mo file and this is what PHP looks into for the translations.
And it would greatly reduce the number of files you have to deal with for language. Especially if you're doing many languages.
Just a thought but I think it might work and it would make a much more flexible solution that would work with the whole gettext centralized localisation for all your other PHP scripts using gettext as well.
.