Kohana::i18n == Fuel::Core::Lang
Getting your Kohana i18n stuff migrated to Fuel is actually very easy.
First of all copy your old language translation file into lang/[countrycode], for example: lang/de/german_signup.php
In the general config (config/config.php) you have to set the language, which determines in which of the directories under ‘lang’ Fuel will look for the file. e.g. ‘language’ => ‘de’.
Then you have to load this somewhere using Lang::Load(‘[filename]‘);, for example Lang::Load(‘german_signup.php’);
In this particular Project I’ve put it within the before() function of my Base Controller, that way i don’t have to worry about it.
Right now i don’t see any sense in having a separate language file for each controller, because of this i can load it within the base controller of everything. Who knows, maybe i’ll change my mind about this later, but not just yet.
To Load a string:
I18n::get(‘firstlevel.secondlevel’);
becomes
Lang::line(‘firstlevel.secondlevel’);
That’s pretty much it. easy huh?