Portfolio

Our clients come from a broad range of industries with a wide array of challenges. How can we deliver improved services and product experiences that make a difference. We partner with them to navigate that.

product

Interior design site

Category: | Industry: Trade & Retail

In this project for a Netherland client in late 2009, one of the major features that we built is a multi-language feature for his existing Rails application, an interior design / product site. We have done multi-language feature for several Rails applications in the past, using gettext, gibberish, gibberish_db, etc, but here we use Globalize2 plugin and Rails built-in internationalization I18n.

We used I18n for all our static contents, it’s a piece of cake. And all you need to do is to update that ymls files. For dynamic contents, we use Globalize2.

Here comes the fun part. Because you are most likely be working on an existing application, the bulk of the work is not making a nice back-end for multi-language objects, but it’s making sure the Rails application works correctly after we implement multi-language. It’s especially true when the application doesn’t have a complete test (rspec) suite.

Some things worth noting:

  1. All occurrences of find_by_name will no longer work correctly. So grep that and modify accordingly
  2. Basically all queries that use ‘name’ field, either on the select clause or condition clause, will also no longer work correctly
  3. All routes that need locale path should also be added /locale/ to it
  4. Javascript methods within a .js file that calls a Rails action and needs ‘locale’. Simply make a global Javascript variable for the locale and use that when necessary within the .js file
  5. Javascript method that uses hard-coded words. Eg.
    this.value = ‘Beware’. Either we refactor it completely since it’s most likely we can do it another cleaner way, or we have to pull out that Javascript method from .js file to rhtml

Related Projects

Subscribe to our Newsletter

Keep up to date with our latest offerings!

TOP!

Contact Us

Please tell us a little bit about your project in the form below. KT is looking forward to working with you!

Thank you! Your message has been sent, we will get back to you shortly.
Submission failed. Please fill in all required information.