Added:
trunk/things.todo
Modified:
trunk/lib/localization.rb
Log:
Made :date_helper optional.
Modified: trunk/lib/localization.rb
==============================================================================
--- trunk/lib/localization.rb (original)
+++ trunk/lib/localization.rb Thu Dec 20 13:09:10 2007
@@ -107,6 +107,7 @@
# formatted date/time string.
def localize(format='default')
# unabashedly stolen from Globalite which unabashedly stole this
snippet from Globalize which unabashedly stole this snippet from
Tadayoshi Funaba's Date class
+ return strftime("%a, %d %b %Y %H:%M:%S %z") unless __(:date_helper)
o = ''
format =
__(:date_helper)[:date_helper_time_formats][format.to_s.downcase.to_sym]
if __(:date_helper)[:date_helper_time_formats][format.to_s.downcase.to_sym]
format.scan(/%[EO]?.|./o) do |c|
@@ -130,11 +131,13 @@
# Acts the same as #strftime, but returns a localized version of the
formatted date string.
def self.un_localize(value)
+ return Date.strptime(value, "%Y-%m-%d") unless __(:date_helper)
Date.strptime(value, __(:date_helper)[:date_helper_date_formats][:default])
end
def localize(format='default')
# unabashedly stolen from Globalite which unabashedly stole this
snippet from Globalize which unabashedly stole this snippet from
Tadayoshi Funaba's Date class
+ return strftime("%Y-%m-%d") unless __(:date_helper)
o = ''
format =
__(:date_helper)[:date_helper_date_formats][format.to_s.downcase.to_sym]
if __(:date_helper)[:date_helper_date_formats][format.to_s.downcase.to_sym]
format.scan(/%[EO]?.|./o) do |c|
Added: trunk/things.todo
==============================================================================
--- (empty file)
+++ trunk/things.todo Thu Dec 20 13:09:10 2007
@@ -0,0 +1,15 @@
+========
+= HIGH =
+========
+
+==========
+= MEDIUM =
+==========
+
+- Add date_helper translations for the other languages
+
+- Add country localization - the Globalite way
+
+=======
+= LOW =
+=======