README.md in po_to_json-0.0.1 vs README.md in po_to_json-0.0.2

- old
+ new

@@ -7,24 +7,32 @@ ## Installing Via rubygems: ```ruby -gem install 'po_to_json' +gem install po_to_json ``` In your gemfile: ```ruby gem 'po_to_json' ``` ## Usage -Simply parses a po file generating the corresponding JSON encoded string. +Most common use would be to generate a Jed ready javascript file. For example, in a Rails 3 project: ```ruby require 'po_to_json' -json_string = PoToJson.new.parse_po('/path/to/your/translations.po') +json_string = PoToJson.new("#{Rails.root}/locale/es/app.po").generate_for_jed('es') +File.open("#{Rails.root}/app/assets/javascripts/locale/es/app.js",'w').write(json_string) +``` + +The javascript file generated has a global 'locales' object with an attribute corresponding to the generated language: + +```javascript +i18n = new Jed(locales['es']) +i18n.gettext('Hello World') // Should evaluate to 'Hola Mundo' ``` ## Maintainers * eromirou (https://github.com/eromirou)