Demo of Rails 2.2 internationalization

Posted by David August 27, 2008 @ 10:12 PM

Rails 2.2 is going to make it much, much easier to do internationalized sites. Check out Clemens Kofler’s sample app running live or peruse his code. Thread safety? Internationalization? What stock objections to Rails will we have left?!

Posted in Sightings | 27 comments

Comments

  1. Scott Walter on 27 Aug 23:07:

    Sweetness!

  2. Bob Martens on 27 Aug 23:38:

    Excellent, a lot of useful stuff there. The gears are already turning in my head … my wife will not be pleased.

  3. Dr Nic on 27 Aug 23:46:

    What stock objections to Rails will we have left?!

    Apparently Rails doesn’t scale still. That’s just what I heard on the street.

  4. Jeremy McAnally on 28 Aug 01:03:

    I believe I was on the same street as Dr. Nic. There was some dude singing a song about it…

  5. Philip Hallstrom on 28 Aug 03:34:

    Well, with all these features it’s too enterprisey!

    I kid… I kid!

    :)

  6. Sikachu! on 28 Aug 05:40:

    hmm .. if this make rails goes too big, should it be written as a plugin or ‘gem’ instead? something like .. rails_i18n gem :P

  7. Clemens Kofler on 28 Aug 05:55:

    One should probably also mention the great work some of the other guys have done, namely Fabio Akita (akitaonrails), Simon Tokumine (tokumine) and Masayuki Nakamura. I’ll try to merge their changes back to the original repo (http://github.com/clemens/i18n_demo_app/tree/master) when I find the time.

  8. Rex Chung on 28 Aug 07:20:

    internationalization is definitely the most anticipated feature for the non-English speaking developers. :)

  9. Manfred Stienstra on 28 Aug 08:00:

    Actually, the i18n code is the effort towards internationalization of Rails. The process of actually adapting your site to a specific locale is called localization.

    See: http://en.wikipedia.org/wiki/Internationalization_and_localization

  10. iGEL on 28 Aug 08:42:

    The most interesting thing is: Does it allow to i18n validation messages? Both buildin as well as custom messages? My Rails 2.1 solution is not very pretty and I’d love to see an improvement here.

  11. karmi on 28 Aug 09:42:

    Hi all,

    if you wanna play with the Rails i18n, try as well this application: http://github.com/karmi/rails_i18n_demo_app/ . It is a working mini-application including locale setting, switching and loading, default en-US locale file, Czech localization in Ruby hash and German localization in YAML, and demonstrates localization of Strings, Date&Time, Numbers, ActiveRecord messages.

    Also check Sven Fuchs’ fork for “edge” experiments with i18n gem like advanced pluralization rules: http://github.com/svenfuchs/rails_i18n_demo_app/

    Karel

  12. alib on 28 Aug 10:42:

    when selecting a language where there is no translation is it possible to show the default strings (ex: English) instead of the horrible variables that a user wouldn’t understand?

    Really great work guys been waiting for this.

  13. karmi on 28 Aug 11:14:

    @alib: It is, check http://github.com/karmi/rails_i18n_demo_app/tree/master/app/views/home/index.html.erb#L3

  14. Sven Fuchs on 28 Aug 13:23:

    Thanks much for the announcement, David!

    To clarify the scope for the I18n api (i guess we’ll have to say this a couple of times in the near future) ... this is not a fullblown (and heavyweight) Localization solution baked right into Rails.

    Instead it is two things: a) a common API where we can build our L10n solutions on (this is what we call the I18n api) and b) a Simple backend which (might be used for other purposes) but has the sole requirement to localize Rails back to en-US.

    :)

  15. Bob Aman on 28 Aug 15:03:

    Stock objection:

    The code for Rails is still hideously ugly.

  16. lolcatz on 28 Aug 15:32:

    Bob Aman: what do you mean? drop a gitlink please?

    Personally, I think Rails should be more modular: hell, i don’t need generators on production.

  17. Ksuha on 28 Aug 17:04:

    Great demo! I think 99translations.com has pretty interface to edit these translations files .

  18. wow! on 28 Aug 18:02:

    This is super usefull! And very nice demo! Waiting for the 2.0 :)

  19. aksly on 28 Aug 21:18:

    internationalization means also that stuff like validates_numericality_of :field accept numbers as 13.0, but also like 13,0 ? (i know, english is different, more like 1,300.00…but some country use like 1’300,00 or worst 1.300,00…any idea how to accept both? :(

  20. Jens on 28 Aug 23:27:

    Why 13? a little bit much.

  21. Peter Iwanowitsch on 29 Aug 08:55:

    It’s a great demo! Excellent, a lot of useful stuff there …

  22. Brandon Zylstra on 30 Aug 20:48:

    This is very cool. Unfortunately the demo has the wrong settings for en-US localizations. I’ve fixed this in my fork and issued a pull-request, so hopefully it will be fixed in the main master.

    It’s quite easy to fix yourself, or you can get my fork: http://github.com/brandondrew/i18n_demo_app/tree/master

  23. Nikolay Kolev on 30 Aug 23:49:

    I really hate the i18n.t() notation! It’s not natural language like the most of Rails is! Even “intl” is much more meaningful than that cryptic and nerdy (and enterprisey?) i18n! Wasn’t it possible to make it just t() or text() or phrase() or something similar at least within .erb?

  24. Flug on 03 Sep 08:33:

    Clemens did a great job, it looks really nice! You guys rule!

  25. Erik Allik on 06 Sep 00:53:

    Demo link does not work – bad gateway.

  26. Soleone on 07 Sep 01:36:

    @Nikolay Kolev: “t” is just the abbreviated version for “translate”, so you can always use the longer version if you like :) You can also define your own method like “intl” and delegate to “translate”.

  27. Dustin on 16 Sep 18:58:

    So, where the heck is 2.2 release schedule? I’ve been googling for 30 minutes and still can’t find it! Thanks!