Internationalisation In Rails
Upcoming SlideShare
Loading in...5
×
 

Internationalisation In Rails

on

  • 3,424 views

Internationalisation In Rails presented at Ruby Fun Day!!

Internationalisation In Rails presented at Ruby Fun Day!!

Statistics

Views

Total Views
3,424
Views on SlideShare
3,424
Embed Views
0

Actions

Likes
0
Downloads
10
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Internationalisation In Rails Internationalisation In Rails Presentation Transcript

  • INTERNATIONALIZATION IN RUBY ON RAILS By: Siddhaarth Verma
  • What is i18n and L10n
    • i18n (short for Internationalization ) is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes.
    • L10n (short for Localization) is the process of adapting software for a specific region or language by adding locale-specific components and translating text.
  • So What's The Difference
    • Internationalization is the adaptation of products for potential use virtually everywhere, while localization is the addition of special features for use in a specific locale.
    • Internationalization is done once per product, while localization is done once for each combination of product and locale.
  • Cost Vs Benefit Tradeoff
    • In a commercial setting, the benefit from localization is access to more markets. It costs more to produce products for international markets, but in an increasingly global economy, supporting only one language/market is scarcely an option.
    • Since open source software can generally be freely modified and redistributed, it is more prone to internationalization. The KDE project, for example, has been translated into over 100 languages.
  • Where Does Rails Come In
    • Well, from version 2.2 Rails ships with the Ruby I18n gem which provides us with and easy to use and extensible framework and allows multi-language support for our applications.
    • The main focus of Rails I18n API is to provide support for English and similar languages out of the box and make it easy to customize and extend everything for other languages.
  • How Does It Work In Rails
    • This module comes with the following features:
    • The main translation method #translate which is used to lookup translations.
    • The #localize method which is used to localize Date, DateTime and Time objects.
    • It stores a default locale which is used when no locale has been passed or set.
    • It stores a backend which carries the actual implementation for the translate and localize methods.
    • It comes with a default exception handler which catches exceptions that are raised in the backend.
    • Both the backend and the exception handler can be swapped with different implementations for cases where you need more flexibility and features.
  • Demo
    • Lets look at two very basic apps, one uses Rails 2.1 and the Gibberish plugin and the other uses Rails 2.2 and the built in I18n API.
  • References
    • I18n Wiki ( http://rails-i18n.org/wiki )‏
    • Some text shamelessly copied from Wikipedia. :P