This post originated from an RSS feed registered with PHP Buzz
by Stephan Schmidt.
Original Post: patForms Gettext Patch
Feed Title: a programmer's best friend
Feed URL: http://blog.php-tools.net/rss.php?version=1.0
Feed Description: The blog of PHP Application Tools
Usually i18n and multi language support is not a big issue in web business. Even if web-sites seem to be global players, most of them get along with support for very few languages. patForms for example comes with support for English, French and German and therefore covers pretty much everything I ever wanted.
On the contrary non-French, non-English and non-Germans may blame patForms for lack of support for Danish, Swedish, Spanish, Russian etc. Rightly, I suppose. Unfortinately, the supported languages are within the form elements and rules. Hence it would mean to change a lot of files (classes) to simply add another languaga's messages. Knowing that we started to introduce support for extrernal translation tables - stored in ini-files.
Another idea was to use the PHP Gettext extension which should be available on most servers. The two major advanteages of this method are: (1) You simply don't have to bother about NLS (native language support) while you write some geek patForm rules or element. (2) Gettext is widly spread and comes with a bunch of tools to extract translatable strings and maintain translation tables. This makes it fairly simple to add support for additional languages like Spanish, Danish and even Gungan.
So far, patForms does not use Gettext. Still, I created a patch which works extremly well. I love to invite you to test this patch and and tell me what you think about patForms using Gettext. Please also tell me your opinon whether we should move to Gettext for the next release of patForms.