Using gettext in PHP

I am working on open source software and am thinking about using gettext to localize the interface. The question is: is there a way so that I don't add the gettext module dependency?

Since gettext support comes as a PHP module, I need all users to install it. Is there an alternative for this?

+3
source share
3 answers

I think that gettextcompiled in the vast majority of PHP installations. I have never seen him without him.

However, the Zend Framework Zend_Translate is really package independent and much more powerful than gettext. It can handle several dictionary formats, including gettext. It can be used as a separate component. If you start with localization, this is definitely worth a look.

+4
source

Consider gettextit an outdated extension. PHP now supports the new ICU library. Look for the following classes: Intl, Locale, MessageFormatter.

+3
source

There are actually two alternatives. php-gettext and gettext.php are both implemented in PHP userland, so you can use them as a backup if the PHP gettext built-in extension is not compiled.

+1
source

Source: https://habr.com/ru/post/1774055/


All Articles