Based on Localization for Ruby’s Time#strftime, I’ve come across a simple solution when you are developing a non-multilanguage app in a non-English language.
If it’s for rails, we put this on lib/environment.rb. In any other cases, put this code at the initialisation stage
Date::MONTHNAMES.replace [nil] + %w(Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre Diciembre)
Date::DAYNAMES.replace = %w(Domingo Lunes Martes Miércoles Jueves Viernes Sábado)
Date::ABBR_MONTHNAMES.replace [nil] + %w(Ene Feb Mar Abr May Jun Jul Ago Sep Oct Nov Dic)
Date::ABBR_DAYNAMES.replace %w(Dom Lun Mar Mié Jue Vie Sab)
Of course, you should translate it to your language if it’s not Spanish.
The result:
>> Date.today.strftime("%A, %d de %B de %Y")
=> "Miércoles, 17 de Febrero de 2007"
That’s it. I’m tired of error 500 all the time. I’m not sure if I should blame typo or Dreamhost, but the thing is I’ll migrate this blog back to Wordpress one of these days.
Note: Also note that if you are embedding PHP within XML or XHTML you will need to use the <?php ?> tags to remain compliant with standards.
What?? Who cares?? I mean, this embedded PHP code is meant to be seen only by the PHP interpreter, parsed and sent back to the client as XML or XHTML, so what’s the point here?
I think this resumes all the strength of the Apple brand:
The biggest letdown is the fact that the iPhone won’t be available until June 2007 in the U.S. They have so much horsepower and untested software packed into this tiny device that the first version will almost certainly have problems – overheating, bugs, etc. That won’t stop millions from buying it as soon as it is available. And it won’t stop me, either.