I'm trying to add i18n support for my open-source PHP project. I've been trying to use
gettext, but I am running into some issues which I could see being a problem down the road.
For example, the way that caching requires one to restart the web server is frustrating during development. The workarounds I've seen are hacky, and several people have suggested that
gettext doesn't make sense for the web and should be deprecated. I would agree, and add that the
.po format itself seems outdated, especially in the modern world of JSON and XML.
I also don't like that the main tool (poEdit) for generating and editing the
.po translation files is freemium, rather than completely free.
That being said, is there a real alternative? I saw php-gettext, but I can't tell if it is still actively maintained. Ideally, I'd like something that is:
- Widely used (maybe it's just hiding from me?)
- Actively maintained
- Works out of the box (doesn't require special web server configuration)
- Available on Packagist
This question suggests that
gettext is the right way to go, but at this point the question is over 2 years old. As we know, a lot can change in software over two years.