language_engine =============== [![Build Status](https://travis-ci.org/dryade/language_engine.svg?branch=master)](https://travis-ci.org/dryade/language_engine) language_engine is a rails engine for language with : * a controller * a helper Views and assets are not defined because we think everybody wants to adapt the view in their page. You can access to a demo on [http://appli.chouette.mobi](http://appli.chouette.mobi/chouette2/users/sign_in) with * login : demo@chouette.mobi * password : chouette Requirements ------------ This code has been run and tested on Travis with : * Ruby 1.9.3 Installation ------------ Add gem to your rails app in Gemfile : ```sh gem 'language_engine' ``` Download gem librairies : ```sh bundle install ``` Usage (with bootstrap plugin) ---- First you must set local in your application controller for example : ```ruby class ApplicationController < ActionController::Base protect_from_forgery before_filter :set_locale def set_locale I18n.locale = session[:language] || I18n.default_locale end end ``` And then you can use it inline : ```html
``` Or with dropdown : ```html ``` Test ---- ```sh bundle exec rake spec ``` License ------- This project is licensed under the MIT license, a copy of which can be found in the [LICENSE](./MIT-LICENSE) file. Support ------- Users looking for support should file an issue on the GitHub [issue tracking page](../../issues), or file a [pull request](../../pulls) if you have a fix available.