This has been a common request in the past already. Today David pinged me about it, too, because it's necessary for the translated views feature that's about to be added to Rails 2.3 (think index.en.html.erb vs index.de.html.erb).
I assume there are no objections anyway? Otherwise, speak up now :)
Iain Hecker
unread,
Jan 8, 2009, 6:30:10 PM1/8/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rails...@googlegroups.com
Sven,
Looks nice!
Iain
Chris Cruft
unread,
Jan 9, 2009, 8:17:46 AM1/9/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rails-i18n
Sven,
As a big proponent in the past, I'm glad to see it available in core.
> I assume there are no objections anyway? Otherwise, speak up now :)
Nice. I'm glad that it got included in the end - I was about to
suggest something similar to list available locales :-). Not only for
upcoming translated views - I found a few other use cases where this
method becomes handy (posted a few in http://zargony.com/2009/01/09/selecting-the-locale-for-a-request).
How about another small method like the following:
def locale_exists? (locale)
available_locales.include?(locale.to_sym)
end