Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #2106 (closed enhancement: wontfix)

Opened 3 years ago

Last modified 1 year ago

Internationalization

Reported by: goetzilla Assigned to: David
Priority: high Milestone: 1.x
Component: ActiveSupport Version: 1.0.0
Severity: normal Keywords: internationalization, i18n
Cc: lubo@manolov.org, rails@bitsweat.net, cohen1@gmail.com, sebastien@goetzilla.info, mbrito@gmail.com, rails_nut@hotpop.com

Description

I think that a smart system for making internationalization of an application easy should be included in rails. One which would work on all OS.

In my opinion, this is something very important before lauching Rails 1.0.

Change History

09/13/05 17:31:58 changed by eastcoastcoder@gmail.com

Yes, rails sorely lacks this. I can't think of any other thing if this importance that rails is missing.

A good way to do (part of this) would be to add a .to_i18n method to all Strings. It would be used in views instead of .to_s . By default, it would just delegate to .to_s, but it could be overrideen to either do a lookup based on current locale.

The i18n lookup table could either be generic, or use reflection to treat different models and fields differently.

Another option is an i() method, similar to the current h() method.

Last, there needs to be a way to i18n the text in the templates, without needing to put it inside eruby tags. The designs which work the best for this normally surround the text with <i18n> tags - this doesn't seem to be in harmony with the rest of erb, though.

10/03/05 13:55:52 changed by jvoorhis@gmail.com

Also - we can't just bolt on i18n - there are also default messages for failed validations from AR, etc.

10/06/05 08:14:32 changed by anonymous

  • cc set to lubo@manolov.org.

10/20/05 14:24:30 changed by koke <jbernal@warp.es>

I'm using ri18n right now and I think it's the best solution. I'll try to propose something more complete when I get some free time (maybe weekend)

10/21/05 05:37:59 changed by koke <jbernal@warp.es>

10/30/05 07:23:02 changed by sebastien@goetzilla.info

10/31/05 20:11:50 changed by Ron

It would also be nice to have different storage formats/methods to choose from. The PHP pear module at: http://pear.php.net/package/Translation2 has some really nice things, like multiple storage methods. Maybe we could use that as an inspiration?

I don't think its a good idea to go and develop a whole new way of storing the translatable string (like in a .rb file, like most implementations of i18n in rails i've seen), when there is already the .PO format. And to be honest, i think even simply keeping each string in a row in the database, would be better than loading them from .rb files. Because keeping them in ruby-files makes it hard to parse and change them, unlike simple database storage or PO files.

11/15/05 08:42:54 changed by bitsweat

  • cc changed from lubo@manolov.org to lubo@manolov.org, rails@bitsweat.net.
  • component changed from Web to ActiveSupport.
  • milestone changed from 1.0 to 1.x.

11/17/05 09:30:19 changed by anonymous

  • cc changed from lubo@manolov.org, rails@bitsweat.net to lubo@manolov.org, rails@bitsweat.net. cohen1@gmail.com.

11/18/05 06:48:33 changed by sebastien@goetzilla.info

  • cc changed from lubo@manolov.org, rails@bitsweat.net. cohen1@gmail.com to lubo@manolov.org, rails@bitsweat.net. cohen1@gmail.com,sebastien@goetzilla.info.

03/06/06 03:06:51 changed by anonymous

  • cc changed from lubo@manolov.org, rails@bitsweat.net. cohen1@gmail.com,sebastien@goetzilla.info to lubo@manolov.org, rails@bitsweat.net. cohen1@gmail.com,sebastien@goetzilla.info,mbrito@gmail.com.
  • keywords changed from internationalization to internationalization, i18n.

03/06/06 03:07:29 changed by anonymous

  • cc changed from lubo@manolov.org, rails@bitsweat.net. cohen1@gmail.com,sebastien@goetzilla.info,mbrito@gmail.com to lubo@manolov.org, rails@bitsweat.net, cohen1@gmail.com, sebastien@goetzilla.info, mbrito@gmail.com.

03/06/06 06:43:57 changed by sebastien@goetzilla.info

  • version changed from 0.13.1 to 1.0.0.
  • milestone changed from 1.x to 1.2.

03/10/06 18:04:45 changed by anonymous

  • cc changed from lubo@manolov.org, rails@bitsweat.net, cohen1@gmail.com, sebastien@goetzilla.info, mbrito@gmail.com to lubo@manolov.org, rails@bitsweat.net, cohen1@gmail.com, sebastien@goetzilla.info, mbrito@gmail.com, rails_nut@hotpop.com.

07/08/06 04:54:09 changed by bitsweat

  • milestone changed from 1.2 to 1.x.

05/29/07 18:25:32 changed by josh

  • status changed from new to closed.
  • resolution set to wontfix.

Closing because there is no proposed patch.