Better supplier ember section workflow

This commit is contained in:
2014-07-02 15:44:51 +02:00
parent 8ab355460c
commit 627e0e891d
14 changed files with 115 additions and 6 deletions
@@ -4,12 +4,13 @@
attributes: <%= I18n.t('activemodel.attributes', locale: :en).to_json %>
helpers: <%= I18n.t('helpers', locale: :en).to_json %>
pagination: <%= I18n.t('views.pagination', locale: :en).to_json %>
errors: <%= I18n.t('errors', locale: :en).to_json %>
nl:
models: <%= I18n.t('activemodel.models', locale: :nl).to_json %>
attributes: <%= I18n.t('activemodel.attributes', locale: :nl).to_json %>
helpers: <%= I18n.t('helpers', locale: :nl).to_json %>
pagination: <%= I18n.t('views.pagination', locale: :nl).to_json %>
errors: <%= I18n.t('errors', locale: :nl).to_json %>
@t = (path, vars={}) ->
#result = undefined
#m = undefined
@@ -95,6 +96,17 @@
datepicker_object.pickadate(window.pickadate_options)
datepicker_object.change()
# use like
# error_message
# attribute: t('attributes.section.title')
# message: 'blank'
@error_message = (options = {})->
locale = options.locale || Qstorage.getItem('locale') || 'en'
#message = $translations[locale].errors.messages[options.message]
message = t "errors.messages.#{options.message}", options
t 'errors.format',
attribute: options.attribute
message: message
@setupTranslations = (options = {})->
locale = options.locale || Qstorage.getItem('locale') || 'en'