localized_application_extensions.rb

Path: lib/features/localized_application_extensions.rb
Last Update: Wed Oct 31 17:57:58 +0100 2007

Localized application extensions

This feature adds the l and lc helper methods to the String and Symbol class. This is a common way to localize strings.

Used sections of the language file

This feature uses the app section of the language file. This section is reserved for localizing your application and you can create entries in this section just as you need it.

  app:
    test: this is a test
    users:
      show:
        title: Showing user...

Somewhere in your app:

  'test'.l  # => "this is a test"
  :test.l   # => "this is a test"

in app/views/users/show.rhtml:

  :title.lc   # => "Showing user..."
  'title'.lc  # => "Showing user..."

[Validate]