Language files

edited April 2013 in Modules
Hi,

I've trying to use language files, but it is not working for me. For instance I've translated the blog module and added a 'swedish' language folder in blog/language/. Also changed fuel/application/config/config.php to:

$config['language'] = 'swedish';
Everywhere (I think) where there is a language folder, I've created a 'swedish' instance with a copy of the english *_lang.php files. (except of course in blog where the translated blog_lang.php resides)

What am I missing here?

Comments

  • edited 12:48PM
    Try clicking on your your login name in the upper right and then changing your language value to swedish.
  • edited 12:48PM
    Oh, sorry. I mean outside fuel admin in public pages. Or don't those files cover the public areas?

    Thanks!
  • edited 12:48PM
    Could you give me an example of a language key that you are wanting to see translated on the front end?
  • edited 12:48PM
    My bad! I assumed lang files were connected to front end also. I copied the default theme and changed the html as supposed I think ;-) Voila! Sometimes solutions are the simplest...

    Thanks again!
  • edited 12:48PM
    Sure. As an FYI, the FUEL 1.0 beta has added much better support for multiple language sites if you are not already aware:
    https://github.com/daylightstudio/FUEL-CMS/tree/1.0
  • edited 12:48PM
    Yes, I forgot to inform about that... I'm on 1.0 right now. In what way will it have better support? Haven't looked around especially for that, probably why I missed the obvious above.
    No need to hurry with an answer about this.

    Thanks for your time!
  • edited May 2013
    There is a "languages" fuel configuration parameter you can set in MY_fuel.php (not there by default so you'll need to add it). The value is a key/value array with the key being the language key and the value being the language name. The default value is:
    $config['languages'] = array('english' => 'English');
    If you add additional languages, there will be language dropdowns that appear in the CMS in appropriate areas (e.g. pages, navigation, blocks). For pages, you can save multiple language versions at the same location (e.g. about/location). Then on the front end, you can use the Fuel_language class to get and set the language value. I'd review the methods on the Fuel_language class for a little more info.

    The documentation is still lacking a bit on the subject but I plan on adding some more.
  • edited 12:48PM
    I also forgot to mention that if your pages use views and there is a language value set by the user using Fuel_language, it will first look for a view file in the views/language/{language}/ folder and if it doesn't find it, it will default to just the views folder.
Sign In or Register to comment.