[#10718] Cli scripts, using the user_admin param on appInit resets language setting
Summary Cli scripts, using the user_admin param on appInit resets language setting
Queue Kronolith
Queue Version Git master
Type Bug
State Assigned
Priority 1. Low
Owners jan@horde.org
Requester goncalo.queiros@portugalmail.net
Created 2011-11-07 (2952 days ago)
Due
Updated 2013-08-27 (2293 days ago)
Assigned 2013-08-27 (2293 days ago)
Resolved
Milestone
Patch No

Comments
goncalo.queiros@portugalmail.net 2011-11-07 16:07:34
Using kronolith/bin/kronolith_agenda as an example, if after the 
appInit call you add

var_dump(_("on the same weekday"));die();

the sentence is correctly translated.

Althoug, if you add the option 'user_admin' => true to 
Horde_Registry::appInit call, the sentence will no longer be translated

Jan Schneider <jan@horde.org> 2011-11-08 17:26:35
Then why do you add it?

goncalo.queiros@portugalmail.net 2011-11-09 01:02:11
> Then why do you add it?

Because i need to run a script from command line has a privileged user.
Isn't this the correct way?

Jan Schneider <jan@horde.org> 2011-11-09 10:53:12
It is, I was wondering why you would do this with kronolith-agenda though.

That options sets the current user to the first admin user. That user 
probably doesn't have a language set in his prefs, that's why you 
don't get translated strings.

goncalo.queiros@portugalmail.net 2011-11-09 14:47:00
> It is, I was wondering why you would do this with kronolith-agenda though.
>
> That options sets the current user to the first admin user. That 
> user probably doesn't have a language set in his prefs, that's why 
> you don't get translated strings.

Just used kronolith-agenda as an example ;-)
I don't think its a question of prefs since if i swap the code flow 
(as shown in the patch attached), it works fine.

I didn't propose the patch in the first place, because i don't think 
this is the correct way to fix it.


Jan Schneider <jan@horde.org> 2011-11-13 20:25:38
Wouldn't it work if you set the default language in the preferences too?

goncalo.queiros@portugalmail.net 2011-11-14 11:10:59
> Wouldn't it work if you set the default language in the preferences too?
No