07-03-2009, 05:21 AM
[eluser]uprocka[/eluser]
Hello everybody,
I know this question might have been already discussed here but I could not find a satisfying solution yet... perhaps I am overlooking something?!
I want to extract the language from the URI e.g. from the subdomain or a uri-segment... that I have managed on my own ;-)
But now the problem is where/when to overwrite the default config language-setting:
I tried to do it via:
1a) a post_controller hook:
CI instance exists but to overwrite the default config language-setting it is too late.
1b) a post_controller_constructor
CI instance exists but to overwrite the default config language-setting it is too late
(I need the new language to be available in the controller constructor ).
1c) a pre_controller hook
CI instance doesn't exist, get_instance cannot be called
SEE also: http://ellislab.com/forums/viewthread/108639/
2) extending the Controller Class
CI get_instance exists but overwriting the default config language-setting is too late. I am not sure why?
3) extending the Language Class (MY_Language)
CI instance doesn't exist, get_instance cannot be called
SEE also: http://ellislab.com/forums/viewthread/70655/
what am I overlooking? What is the best solution to get this done?
Thank you in Advance
uprocka
Hello everybody,
I know this question might have been already discussed here but I could not find a satisfying solution yet... perhaps I am overlooking something?!
I want to extract the language from the URI e.g. from the subdomain or a uri-segment... that I have managed on my own ;-)
But now the problem is where/when to overwrite the default config language-setting:
I tried to do it via:
1a) a post_controller hook:
CI instance exists but to overwrite the default config language-setting it is too late.
1b) a post_controller_constructor
CI instance exists but to overwrite the default config language-setting it is too late
(I need the new language to be available in the controller constructor ).
1c) a pre_controller hook
CI instance doesn't exist, get_instance cannot be called
SEE also: http://ellislab.com/forums/viewthread/108639/
2) extending the Controller Class
CI get_instance exists but overwriting the default config language-setting is too late. I am not sure why?
3) extending the Language Class (MY_Language)
CI instance doesn't exist, get_instance cannot be called
SEE also: http://ellislab.com/forums/viewthread/70655/
what am I overlooking? What is the best solution to get this done?
Thank you in Advance
uprocka