The Gettext
family of functions is a good starting point:
The gettext functions implement an NLS
(Native Language Support) API which
can be used to internationalize your
PHP applications.
Zend_Translate
is extremely flexible and has a thread-safe implementation of gettext
. The manual states that it addresses the following problems with native internationalization implementations:
- Inconsistent API: There is no single API for the different source
formats. The usage of gettext for
example is very complicated.
- PHP supports only gettext and native array: PHP itself offers
only support for array or gettext.
All other source formats have to be
coded manually, because there is no
native support.
- No detection of the default language:The default language of
the user cannot be detected without
deeper knowledge of the backgrounds
for the different web browsers.
- Gettext is not thread-safe: PHP s gettext library is not thread safe, and it should not be used in a multithreaded environment. This is due to problems with gettext itself, not PHP, but it is an existing problem.
It is worth noting that the Zend Framework
is not a full-stack framework - in other words, you will not need to use the whole thing just to make use of its internationalization API.
What I really like about it is its support for multiple adapters for different data sources, which you can easily mix, match, and change only having to apply very light modifications to your application. Hope that helps.