Welcome Guest, Not a member yet? Register   Sign In
Accessing language outside of the class
#1

[eluser]richthegeek[/eluser]
Hi,

Is there a way to access language lines outside of the class?

The reason I ask is that my current app is in 2 languages, and writing
Code:
$this->lang->line('some_bit_of_text');
all the time is getting on my tits, so I want to be able to shorten it to
Code:
dict( 'some_bit_of_text' );

Anyone know how to do this?
#2

[eluser]richthegeek[/eluser]
aha, done it.. really should investigate a bit more before posting these topics Wink

Here is the function, please tell me if this is a "bad way" of doing this.
Code:
function dict( $line ) {
        $lang = get_instance();
        return $lang->lang->line( $line );
    }
#3

[eluser]Référencement Google[/eluser]
I have posted some days ago a language helper that do perfectly what you need and even more: http://ellislab.com/forums/viewthread/75629/
#4

[eluser]richthegeek[/eluser]
ah good stuff - don't really need that level of power just yet, but thanks for letting me know Smile




Theme © iAndrew 2016 - Forum software by © MyBB