This project is archived and is in readonly mode.

#1391 ✓committed
Sven Fuchs

Use :en as a default locale instead of :"en-US" for shipped locale data

Reported by Sven Fuchs | November 17th, 2008 @ 01:29 PM

I stumble across this bit every time I start porting or implementing "real" stuff to work with Rails I18n / Rails 2.2RC.

For Rails we've picked the default locale :"en-US" because we've thought it's be the most defensive claim to make. Nobody could really argue for picking anything else because this is in fact the locale to which Rails always (implicitely) was localized.

But I believe this choice isn't really in line with the principle of "doing the simplest thing that ever could work" for Rails that we'd sticked to otherwise.

It doesn't work well in two obvious and common scenarios:

  1. One only wants to localize an app to some simple locales like en, fr, es, de, doesn't care about differences in countries (like en-US vs en-GB) and wants to expose the locale in the URL (like en/:controller/:action). Then one has to map en to en-US for no other reason than to make I18n find the shipped Rails data.

  2. One wants to use a locale fallback mechanism (like in [1]) that makes I18n lookup data from en when requested data is not available in en-US. Then one has to map a specific fallback for every English locale (en-GB, en-AU, ...) to en-US so that I18n would look up en-US when data is not available in the requested locale (say en-GB) - again for no other reason than that Rails ships its default data like this.

So my feeling is our original choice was spoiled by too much discussion about fallbacks and other rather political issues and that picking :en as the default locale for Rails would be the far better choice instead.

So, can we change the Rails default locale from :"en-US" to just :en as long as it is still possible?

I've raised the same issue on the rails-i18n mailinglist [2] and people either wholeheartly agree or side-track to other solutions that rather would not belong to Rails core. ;)

[1] + [2]

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket