github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

yar / simple_loc_compat

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 7
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Helper syntax of simple-localization.arkanis.de for Rails 2.1 bult-in i18n — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Ported SimpleLocalization's LocalizedModelAttributes feature 
Moritz Heidkamp (author)
Thu Mar 26 04:29:57 -0700 2009
commit  8b3dbb45efcd1654255a4c365f8c79a5c32b706f
tree    0ac166ef17149d689fc1a2c4ebd25083af6e0b8d
parent  a35b493c75e321365d04ffa361c5fbf3e54fafd0
simple_loc_compat /
name age
history
message
file README.rdoc Fri Feb 06 16:00:59 -0800 2009 updated README [yar]
file init.rb Loading commit data...
directory lib/
README.rdoc

Set of i18n helper methods compatible with Simple Localization

Simple Localization was a popular i18n plugin for Rails in pre-2.2 era. One of its killer features that competitors lacked was support for deeply nested namespaces which helped keep the translations organized. Unfortunately, the author announced the end of development of that plugin in October 2008.

Here you can see a small plugin that recreates the neat helper methods of Simple Localization for the Rails-2.2+ built-in i18n engine.

Precisely:

ll(:my_phrase, :macro_one => "Qwerty", :macro_two => "Azerty"):translation for the key :my_phrase with two macro substitutions
ll(:foo, :bar, :qux):translation for the key :qux in namespace foo.bar
lc(:qux):translation for the key :qux in namespace pages.index if the current controller is pages and the current action is index
l_scope(:foo, :bar):creates a block with namespace foo.bar. All ll() and lc() calls inside are adjusted to use this namespace (in addition to root or automatically-calculated one)
lnc():like ll(), but ignores the surrounding l_scope(), always starting from the root namespace

Please see i18n_db_admin for usage example.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server