README.md in exvo_globalize-0.5.0 vs README.md in exvo_globalize-0.5.1

- old
+ new

@@ -1,12 +1,31 @@ # Exvo Globalize -This gem lets you make use of the Globalize app (http://globalize.exvo.com/) -to handle the translation of your Rails app into multiple languages. +Rails gem providing universal I18n support for your application. Supports I18n of both your normal Ruby/Rails app (based on the i18n gem) as well as javascript using a custom i18n library. +Ruby/Rails features: +* additional database backed I18n backend to store the translations +* in-memory caching of database backed translations +* pluralization rules for 108 languages (`config/locales/plurals.rb`) +* localization rules for 51 languages (`config/locales/*.(yml|rb)`) +* locale fallback support (will search for translation using `I18n.default_locale` when not found using requested locale) +* web UI to view your application’s translations (`/globalize/translations`) +Javascript features: + +* all translations defined in `config/locales/*` are available in javascript +* localization support for dates, times, numbers, currencies (localization rules are read from `config/locales/*.(yml|rb)`) +* locale fallback support (will search for translation using `I18n.default_locale` when not found using requested locale) +* global t() and l() helpers to translate and localize phrases, respectively +* does not depend on any other external javascript library + + +This gem also integrates your application with [Globalize](http://store.exvo.com/apps/shops/globalize/items/globalize-125). Globalize is a service for website owners, who want to translate their websites into multiple languages by using human (as opposed to machine/automatic) translators. + + + ## Requirements Rails 3.0+ @@ -135,11 +154,11 @@ I18n.strftime(I18n.parseDate("<%= Time.now %>"), "%Y/%m/%d %H:%M") => "2011/09/14 12:03" // uses formats from `config/locale/en.yml` file I18n.l("date.formats.default", "Wed Sep 14 12:03:11 +0200 2011") -=> "14-09-2011" +=> "2011-09-14" I18n.l("date.formats.long", "2011-09-14") => "September 14, 2011" ``` @@ -163,11 +182,11 @@ ## Globalize integration -In order to fully integrate this gem with Globalize, after installing it you need to register your application (http://globalize.exvo.com/) and order some translations (Globalize should automatically detect the gem installation and should let you choose the JSON translations option). +In order to fully integrate this gem with Globalize, after installing it you need to [register your application](http://store.exvo.com/apps/shops/globalize/items/globalize-125) and order some translations (Globalize should automatically detect the gem installation and should let you choose the JSON translations option). By default a link between your application and Globalize is established by using `request.host` by the gem. If your application’s main DNS record is a CNAME (as is the common case when using Heroku), you can set your application’s domain in the `config/initializers/exvo_globalize.rb` file: ```ruby ENV['GLOBALIZE_REQUEST_HOST'] = 'yourawesomewebapp.com' @@ -183,20 +202,35 @@ ``` And pressing `Update translations`. +### Caveats -## Running the tests +* Adding or changing any existing translations requires application restart for those new updated translations to be visible (it is because of the caching mechanism, which does not currently support cache-invalidation). +* Heroku considerations: updating translations from Globalize, when there are many translations in many different languages is a time consuming process. Unfortunately Heroku has a habit of silently killing web processes running longer than a specified period of time (typically 30s). When that happenes your translations will be only partially updated. Best way to deal with that is to update them from `heroku console` using this script: -Running tests via `Guard` is the recommended way: +```ruby +ENV["GLOBALIZE_USE_PRODUCTION_SERVER"] = "true" +@globalize_app = GlobalizeApp.new("your-applications-host-registered-at-globalize") + +translations = @globalize_app.fetch_translations +I18n.backend.store_nested_translations(translations) +``` + + + +## Running the specs + +Running specs via `Guard` is the recommended way: + ```bash $ bundle exec guard ``` -But tests can be run separately as well: +But specs can be run separately as well: ```bash $ bundle exec rspec spec ``` @@ -204,20 +238,20 @@ ```bash $ jasmine-headless-webkit -c ``` -There is a great guide for setting up `jasmine-headless-webkit` in your OS if you have problems with it: -http://johnbintz.github.com/jasmine-headless-webkit/ +There is a [great guide](http://johnbintz.github.com/jasmine-headless-webkit/) for setting up `jasmine-headless-webkit` in your OS if you have problems with it. ## Copyrights -exvo_globalize is based on the following projects: -https://github.com/svenfuchs/i18n -https://github.com/svenfuchs/rails-i18n/ -https://github.com/toretore/babilu -https://github.com/spider-network/i18n-js +[exvo_globalize](https://github.com/Exvo/exvo_globalize/) is based on the following projects: + +* [i18n](https://github.com/svenfuchs/i18n) +* [rails-i18n](https://github.com/svenfuchs/rails-i18n/) +* [babilu](https://github.com/toretore/babilu) +* [i18n-js](https://github.com/spider-network/i18n-js) Copyright © 2011 Exvo.com Development BV, released under the MIT license