Removed gettext and simplified_localization-plugin. L18n is now the appropriate module.

Upgraded to rails 2.2.2 and replaced complex foodsoft.rb-loader with simple
initializers/load_app_config.rb. Multiple foodcoops option is temporarly deactivated.
This commit is contained in:
Benjamin Meichsner 2009-01-06 15:45:19 +01:00
parent 5b9a7e05df
commit 9f8d0d28ac
121 changed files with 1197 additions and 15237 deletions

View file

@ -0,0 +1,12 @@
# extend the BigDecimal class
class String
# remove comma from decimal inputs
def self.delocalized_decimal(string)
if !string.blank? and string.is_a?(String)
BigDecimal.new(string.sub(',', '.'))
else
string
end
end
end

View file

@ -0,0 +1,10 @@
# Remove this file, when every gettext-method <_("text to translate..")>
# is replaced by rails l18n method: l18n.name.name...
module ActionView
class Base
def _(text)
text
end
end
end

View file

@ -0,0 +1,10 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end

View file

@ -0,0 +1,9 @@
raw_config = File.read(RAILS_ROOT + "/config/app_config.yml")
APP_CONFIG = YAML.load(raw_config)[RAILS_ENV].symbolize_keys
# Configuration of the exception_notification plugin
# Mailadresses are set in config/foodsoft.yaml
ExceptionNotifier.exception_recipients = APP_CONFIG[:error_recipients]
ExceptionNotifier.sender_address = APP_CONFIG[:sender_address]
ExceptionNotifier.email_prefix = APP_CONFIG[:email_prefix]

View file

@ -0,0 +1,5 @@
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone

View file

@ -0,0 +1,17 @@
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = true
# Store the full class name (including module namespace) in STI type column.
ActiveRecord::Base.store_full_sti_class = true
end
# Use ISO 8601 format for JSON serialized times and dates.
ActiveSupport.use_standard_json_time_format = true
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
# if you're including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false