Code Monkey home page Code Monkey logo

devise-i18n-views's Introduction

devise-i18n-views

If you're not familiar, Devise "is a flexible authentication solution for Rails based on Warden". Internationalization (aka i18n) is a "means of adapting computer software to different languages, regional differences and technical requirements of a target market".

While Devise supports internationalization in controllers, models, and in other areas, it does not support internationalization in its views. devise-i18n adds translations for the things Devise has internationalized, but does not add support for internationalized views, either.

devise-i18n-views does add support for internationalization in views, and provides the translations too.

Prerequisites

It would be senseless to use devise-i18n-views without Devise, so consider that a prerequisite. devise-i18n-views contains views compatible with Devise v2 and above.

Additionally, to have Devise fully translated, you will want devise-i18n as well.

Install

Add the following line to your Gemfile

gem 'devise-i18n-views'

and run bundle install. Assuming you have not previously generated Devise's views into your project, that's all you need to do. If you have previously done this, you will need to regenerate your views (see the next section) and then reapply whatever customizations that made you do this in the first place.

Customizing Views

The devise:views:i18n_templates generator will copy all devise-i18n-views's views to your application, so you can modify the files as you wish:

rails g devise:views:i18n_templates

You should only do this if you really need to, though, because doing this will make it so that you won't get the updated views should they change in a future version of devise-i18n-views. To "uncustomize" the views, just delete them, and your app will go back to grabbing devise-i18n-views's default views.

Customizating Translations

If, for whatever reason, you want to change devise-i18n-views's translations, you can generate the locale file into your project with

rails g devise:views:locale it

which will generate config/locales/devise.views.it.yml. If you're doing this to add a missing translation or to improve an existing one, it'd be nice if you could share your suggestions with us!

Contributing to devise-i18n-views

If you would like to submit a new or updated translation, you can do so on the devise-i18n-views project on Locale or with a pull request on GitHub. These two places will be kept in sync.

devise-i18n-views/locales/en.yml is the original, and only, file that needs to be translated.

Copyright

Copyright (c) 2012 mcasimir. See LICENSE.txt for further details.

A ruby translation project managed on Locale that's open to all!

devise-i18n-views's People

Contributors

arturt avatar bbonamin avatar bricesanchez avatar coupling avatar danielweinmann avatar fbonomi avatar gcerquant avatar hron84 avatar humancopy avatar igmarin avatar jasonbarnabe avatar jh125486 avatar joel avatar kendrikat avatar martyciz avatar mcasimir avatar myabc avatar nyjt avatar panos78 avatar rafaelmcarvalho avatar raszi avatar rickygu avatar saicheg avatar teefan avatar tmaier avatar tombu avatar weijen avatar wongwf82 avatar wordgraphy avatar zpvip avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.