gettext functions
PHP’s gettext functions provide an interface to the GNU gettext utility, which is a utility for programmers to internationalize their programs. Gettext helps manage the messages output by the software. we can also use it for internationalization (often abbreviated to I18N) of website using PHP.
The basic usage in your PHP script :
1. set the language to be used
2. echo/print your text as you normally would, prepending ‘gettext’ or an underscore ‘_’. So instead of
‘echo “Hello World”‘, you would write ‘echo _(”Hello World”)’ or ‘echo gettext(”Hello World”)’
The translations are stored in a compressed binary file (.mo files), which you create from the plain ASCII files created by gettext from script (.po files).
