Browse Source

Fixed deployment and added Spanish translations

* Fixed deployment and added Spanish translations

* Fixed deployment and added Spanish translations

* Fixed errors
development
Godwin 8 years ago
parent
commit
cc246d34a8
  1. 11
      app/assets/stylesheets/bumbleberry-settings.json
  2. 111
      app/helpers/application_helper.rb
  3. 10
      app/models/conference_registration_form_field.rb
  4. 2
      app/views/shared/_footer.html.haml
  5. 3
      config/initializers/sorcery.rb
  6. 4
      config/locales/es.yml

11
app/assets/stylesheets/bumbleberry-settings.json

@ -1,5 +1,14 @@
{ {
"stylesheets": ["application", "translations", "email-example"], "stylesheets": ["application", "translations", "email-example"],
"precompile": {
"test": {
"chrome": ["50"]
},
"development": {
"chrome": ["50"],
"ios_saf": ["8", "9"]
}
},
"background-color": "#FFFEFE", "background-color": "#FFFEFE",
"breakpoint-unit": "px", "breakpoint-unit": "px",
"unresponsive-width": 1000, "unresponsive-width": 1000,
@ -21,7 +30,7 @@
"reset-order": "n" "reset-order": "n"
}, },
"medium": { "medium": {
"range": [564], "range": [680],
"grid": "y", "grid": "y",
"offset": "n", "offset": "n",
"reset-order": "n" "reset-order": "n"

111
app/helpers/application_helper.rb

@ -151,84 +151,6 @@ module ApplicationHelper
content_for?(section) ? content_for(section) : default content_for?(section) ? content_for(section) : default
end end
# def _(key, behavior = nil, behavior_size = nil, locale: nil, vars: {}, html: nil, blockData: {}, &block)
# options = vars
# options[:fallback] = true
# if behavior
# options[:behavior] = behavior
# options[:behavior_size] = behavior_size
# end
# if locale
# options[:locale] = locale.to_sym
# end
# #if vars
# # puts "\nVARS:\t#{vars}\n"
# #end
# I18n.translate(key, options)
#
# #queued_keys = nil
# #result = nil
#
# #if key.kind_of?(Hash)
# # blockData.merge!(key)
# # key = key.keys
# #end
#
# #if block_given?
# # @@keyQueue ||= Array.new
#
# # if key.kind_of?(Array)
# # @@keyQueue += key
# # else
# # @@keyQueue << key
# # end
# #end
#
# #if key.kind_of?(Array)
# # new_key = key.shift
# # if key.count > 0
# # queued_keys = key.dup
# # end
# # key = new_key
# #end
#
# #if blockData[key]
# # behavior = blockData[key][:behavior] || nil
# # behavior_size = blockData[key][:behavior_size] || nil
# # vars = blockData[key][:vars] || {}
# #end
#
# #@@lastTranslation = nil
# #generate_control = _can_translate?
#
# #puts "\nLLOOCCAALLEE:\t#{locale.to_s}"
# #translation = _do_translate(key, vars, behavior, behavior_size, locale)
#
# #if block_given?
# # html = capture(&block)
# #end
#
# #if html
# # translation['html'] = html.gsub('%' + key + '%', translation['untranslated'])
# #end
#
# #if generate_control
# # @@lastTranslation = translation
# # @@allTranslations ||= Hash.new
# # @@allTranslations[key] = key
#
# # result = _translate_me(translation)
# #end
#
# #result ||= translation['html'] || (behavior.to_s == 'strict' ? nil : translation['untranslated'])
#
# #if queued_keys
# # return _ queued_keys, behavior, behavior_size, vars: vars, html: result, blockData: blockData
# #end
#
#return result
# end
def _translate_me(translation) def _translate_me(translation)
@@translationsOnThisPage = true @@translationsOnThisPage = true
datakeys = '' datakeys = ''
@ -263,17 +185,20 @@ module ApplicationHelper
false false
end end
#def _!() def url_for_locale(locale)
# if @@keyQueue url_for(params
# return '%' + @@keyQueue.shift + '%' .merge({action: (params[:_original_action] || params[:action])}
# end .merge(url_params(locale)))
#end .delete(:_original_action)
)
end
#def _?() def registration_steps(conference = @conference)
# if @@keyQueue {
# return '%' + @@keyQueue[0] + '%' pre: [:policy, :basic_info, :workshops],
# end open: [:policy, :basic_info, :questions, :payment, :workshops]
#end }[@this_conference.registration_status]
end
def sortable(objects, id = 'id', url: nil, &block) def sortable(objects, id = 'id', url: nil, &block)
result = '<ul class="sortable sortable-' + objects[0].class.name.underscore.gsub('_', '-') + (url ? ('" data-url="' + url) : '') + '" data-id="' + id + '">' result = '<ul class="sortable sortable-' + objects[0].class.name.underscore.gsub('_', '-') + (url ? ('" data-url="' + url) : '') + '" data-id="' + id + '">'
@ -640,7 +565,15 @@ module ApplicationHelper
return hash.length > 1 ? _("geography.formats.#{hash.keys.join('_')}", vars: hash) : hash.values.first return hash.length > 1 ? _("geography.formats.#{hash.keys.join('_')}", vars: hash) : hash.values.first
end end
def nav_link(link, title, class_name = nil) def nav_link(link, title = nil, class_name = nil)
if title.nil? && link.is_a?(Symbol)
title = link
link = send("#{link.to_s}_path")
end
if class_name.nil? && title.is_a?(Symbol)
class_name = title
title = _"page_titles.#{title.to_s.titlecase}"
end
classes = [] classes = []
classes << class_name if class_name.present? classes << class_name if class_name.present?
classes << 'current' if current_page?(link.gsub(/(^.*)\/$/, '\1')) classes << 'current' if current_page?(link.gsub(/(^.*)\/$/, '\1'))

10
app/models/conference_registration_form_field.rb

@ -1,6 +1,4 @@
class ConferenceRegistrationFormField < ActiveRecord::Base class ConferenceRegistrationFormField < ActiveRecord::Base
belongs_to :conference belongs_to :conference
belongs_to :registration_form_field belongs_to :registration_form_field
end
acts_as_list
end

2
app/views/shared/_footer.html.haml

@ -14,7 +14,7 @@
- if locale.to_s != I18n.locale.to_s # don't show the current locale - if locale.to_s != I18n.locale.to_s # don't show the current locale
%li %li
- locale_translation = _("languages.#{locale}", locale: locale) - locale_translation = _("languages.#{locale}", locale: locale)
%a{href: url_for(params.merge(url_params(locale)))} %a{href: url_for_locale(locale)}
=_'translate.content.change_locale', "Read in #{locale_translation}", vars: {language: locale_translation}, locale: locale =_'translate.content.change_locale', "Read in #{locale_translation}", vars: {language: locale_translation}, locale: locale
.copy .copy
=_'links.footer.help_text.contributors', 'Who contributed to building this website' do |title| =_'links.footer.help_text.contributors', 'Who contributed to building this website' do |title|

3
config/initializers/sorcery.rb

@ -203,19 +203,16 @@ Rails.application.config.sorcery.configure do |config|
# use an external encryption class. # use an external encryption class.
# Default: `nil` # Default: `nil`
# #
user.custom_encryption_provider = Sorcery::CryptoProviders::DrupalPassword
# encryption algorithm name. See 'encryption_algorithm=' for available options. # encryption algorithm name. See 'encryption_algorithm=' for available options.
# Default: `:bcrypt` # Default: `:bcrypt`
# #
user.encryption_algorithm = :custom#:sha512
# make this configuration inheritable for subclasses. Useful for ActiveRecord's STI. # make this configuration inheritable for subclasses. Useful for ActiveRecord's STI.
# Default: `false` # Default: `false`
# #
user.subclasses_inherit_config = true
# -- remember_me -- # -- remember_me --

4
config/locales/es.yml

@ -1010,8 +1010,8 @@ es:
Please_Confirm_Email: Página no encontrada Please_Confirm_Email: Página no encontrada
'404': '404':
Page_Not_Found: Crear un taller Page_Not_Found: Crear un taller
Policy: 'Policy' Policy: 'Política'
About: 'About' About: 'Acerca de'
actions: actions:
workshops: workshops:
create: Crear create: Crear

Loading…
Cancel
Save