Activating translated files without a server restart?

Andreas Thyholdt

Joined: 2007-06-29
Posts: 54
Posted: Fri, 2007-07-20 04:11

Hi.

Is there really no way to activate a translated file without doing a server restart? As I am on a shared server, restarts can not be done at my discretion.

Is there no way to turn off PHP caching for G2, for instance?

As the translation is a colaborate effort, I can not easily install G2 on a local server.

I really hope there is a solution for this, in fact this is the first time I've come across this issue in all the php based os projects I've worked on.

Cheers,

Andreas

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2007-07-24 20:12

I'm not sure... plenty of people have mentioned a webserver restart being needed, but I've never seen that behavior myself (no restart needed for me) so I'm not sure where/how the caching happens or how to turn it off. If anyone has clues/pointers we'll gladly add them to our localization docs..

 
Andreas Thyholdt

Joined: 2007-06-29
Posts: 54
Posted: Tue, 2007-07-24 23:40

Thanks, mindless.

I asked my ISP and they didn'nt have a clue, so I am still in the dark on this matter.

Cheers,

Andreas

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2007-07-25 23:16

Read about the cache here.

 
Andreas Thyholdt

Joined: 2007-06-29
Posts: 54
Posted: Thu, 2007-07-26 11:15

Thanks again, that was very informative.

It seems that this issue is an inherit property of gettext, so I guess we are stuck with it.

Or maybe not.

I found this article that suggests that clearing the cache can be done with the textdomain(textdomain(NULL)) command.

If that is the case, I hope someone can test this. Maybe this command could be issued from the Admin maintainence section.

See more here:
http://www.mysociety.org/2005/11/08/changing-language-twice-with-gettext/

Cheers,

Andreas

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2007-07-26 19:56

maybe try putting that command in your main.php file and let us know if it works.. i'll be glad to throw together a maintenance task if it does..

 
Andreas Thyholdt

Joined: 2007-06-29
Posts: 54
Posted: Thu, 2007-07-26 23:58

Hello again.

Seems my ISP has changed something on their end as now the translations update at once. I did not have a chance to see if the textdomain(textdomain(NULL)) command would have worked as it is working now without it.

Thanks for your help, mindless.

Cheers,

Andreas