Skip to content

jinzhu/javascript_localize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

= Javascript Localize

== INSTALL:
  $ ./script/plugin install git://github.com/jinzhu/locale_javascript.git

== How To Use:
  1. drop all localized content into RAILS_ROOT/config/js_locales/
    e.g:
      RAILS_ROOT/config/js_locales/en.yml
        hello world : 'Hello World!'
        hello world for you : '{{you}},Hello World!'

      RAILS_ROOT/config/js_locales/zh.yml
        hello world : '世界你好!'
        hello world for you : '{{you}},世界你好!'

   2. include into views
     <%= include_localized_javascript %>

   3. Use it as javascript
     _('hello world')                                 => en: 'Hello World!'               zh: '世界你好!'
     _('hello world for you',{you : 'ZhangJinzhu'})   => en: 'ZhangJinzhu,Hello World!'   zh: 'ZhangJinzhu,世界你好!'

   4. Rake Task
     rake js_locale:sync  => Keep localized content in sync with default locale
     rake js_locale:build => Generate javascript localization files

Author : ZhangJinzhu
GitHub : http://github.com/jinzhu
Email  : wosmvp (no-spam) gmail (no-spam) com

About

javascript localize solution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages