![]() |
|
server caching of gettext translation files - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Translating (https://forum.zenphoto.org/forum-8.html) +--- Thread: server caching of gettext translation files (/thread-9537.html) |
server caching of gettext translation files - tunafish - 28-01-2012 I just started translating my theme with the That reminded me of something... the .mo files are cached. Restarting my local MAMP server and all was ok. Only problem my (shared) host does not allow me to restart their server... I did some digging in an old project where I implemented a solution to this. Basically you a timestamp is added to the .mo filename So now I am wondering did you ZP guys think about this already and am I missing something? server caching of gettext translation files - acrylian - 28-01-2012 No, we don't have anything for that. If I see the example correctly from a quick look it just tells get text to use a new file to workaround the cache. You could of course create a custom function theme or plugin based for this like you suggested. But how long is the file kept in the cache? If it is just a day or so you could just wait on the live server until they are updated automatically. How often do you change translations? I am not used to or even tried but maybe it is possible to disable the cache via htaccess or php.ini for these files as well or at least temporarilyl: Update: Maybe the first comment here is worth to try as well: server caching of gettext translation files - tunafish - 28-01-2012 Hi acrylian, I just did what I said and it works great. I actually have no idea how long the files are kept in the cache or when they are updated.. Anyway, here are the 2 function mods I put into function.php in my theme folder: ` function my_setupDomain($domain=NULL,$type=NULL) {
} server caching of gettext translation files - acrylian - 28-01-2012 Good you got it working. We need to investigate regarding security with the writable folder I guess. I will have to leave that to my colleage. Maybe that is something for the theme/plugin translations. Maybe you could just ask your host about the server cache period? Would be interesting, I somehow never thought about that. server caching of gettext translation files - tunafish - 28-01-2012 OK, just something to add. I used this mainly for working on my translations, once they are all set it's very easy to do a search and replace in my themes folder and replace all the server caching of gettext translation files - sbillard - 28-01-2012 [quote]These translations are not necessary, but apparently my function goes also sniffing in ZP's core files, looking for the filemtime, I don't know why yet... [/quote] Never mind. It is the second server caching of gettext translation files - tunafish - 28-01-2012 Sweet, cheers sbillard! |