I'm currently struggling with gettext in PHP.
Gettext use cache. That's a good thing, but when I update my translations, I can't access them, which is annoying.
I read we can't flush the cache apart from restarting the web server, which is not a viable solution. Other people use copy of the .mo files with a different name to force them to be loaded again.
I was searching for how long gettext caches the files in memory to consider whether it's acceptable for my application to wait that time before the strings appear. But I couldn't find that information... Is the duration infinite?
I can't imagine a such popular project as gettext hasn't come with a solution to overcome this problem. Is it PHP-specific?
Thanks in advance for the anwsers I will have. Regards.
Every app that uses gettext always uses the cache while the app is running, the file is probably opened at start-up/first use and then stored in memory until closed down. PHP is continually running as part of apache (via mod_php) rather than starting up and closing down.
If you use php-cgi it doesn't have this problem as PHP is started by apache when needed.
Gettext was originally developed for desktop apps, not long running server side applications that the "sysadmin" doesn't have control over stopping and starting. You wouldn't expect a desktop app to change while running it.