Error using locale 'es': I18n.locale = :es

767 views
Skip to first unread message

Iñaki Baz Castillo

unread,
May 1, 2010, 5:28:23 PM5/1/10
to actives...@googlegroups.com
Hi, I've realized that ActiveScaffold includes some locales under the
directory lib/active_scaffold/locale/.

In my SubscriberController I've added:

I18n.locale = :es

so the language is shown in Spanish. However I get a 500 error when I
press "Crear Nuevo" ("Create New"):


-----------------------------------------------------------------------------------------------------------------------------------
Sat May 01 23:22:43 +0200 2010#<NoMethodError: undefined method `-'
for "translation missing: es, date, order":String> -- on the
ActiveScaffold column = :start_date in SubscribersController

ActionView::TemplateError (undefined method `-' for "translation
missing: es, date, order":String) on line #7 of
vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb:
4: <label for="<%= active_scaffold_input_options(column,
scope)[:id] %>"><%= column.label %></label>
5: </dt>
6: <dd>
7: <%= active_scaffold_input_for column, scope %>
8: <% if column.options.is_a?(Hash) && column.options[:update_column] -%>
9: <%= loading_indicator_tag(:action => :render_field, :id =>
params[:id]) %>
10: <% end -%>

vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb:7
vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb:14
vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb:2
vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb:41
-----------------------------------------------------------------------------------------------------------------------------------


Do I miss something? Thanks.



--
Iñaki Baz Castillo
<i...@aliax.net>

--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to actives...@googlegroups.com.
To unsubscribe from this group, send email to activescaffol...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.

Sergio Cambra .:: entreCables S.L. ::.

unread,
May 3, 2010, 3:58:58 AM5/3/10
to actives...@googlegroups.com
Backtrace is not full, remove backtrace silencers uncommenting the last line
in config/initializers/backtrace_silencers.rb

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Iñaki Baz Castillo

unread,
May 3, 2010, 8:25:55 AM5/3/10
to actives...@googlegroups.com
2010/5/3 Sergio Cambra .:: entreCables S.L. ::. <ser...@entrecables.com>:
> Backtrace is not full, remove backtrace silencers uncommenting the last line
> in config/initializers/backtrace_silencers.rb


Done, this is what I get when I press "Create new" or "Edit" in my
ClientsController:

-----------------
Mon May 03 14:22:54 +0200 2010#<NoMethodError: undefined method `-'
for "translation missing: es, date, order":String> -- on the
ActiveScaffold column = :start_date in ClientsController

ActionView::TemplateError (undefined method `-' for "translation
missing: es, date, order":String) on line #7 of
vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb:
4: <label for="<%= active_scaffold_input_options(column,
scope)[:id] %>"><%= column.label %></label>
5: </dt>
6: <dd>
7: <%= active_scaffold_input_for column, scope %>
8: <% if column.options.is_a?(Hash) &&
column.options[:update_column] -%>
9: <%= loading_indicator_tag(:action => :render_field, :id =>
params[:id]) %>
10: <% end -%>

actionpack (2.3.4) lib/action_view/helpers/date_helper.rb:588:in
`select_datetime'
actionpack (2.3.4) lib/action_view/helpers/date_helper.rb:915:in
`to_datetime_select_tag_without_error_wrapping'
actionpack (2.3.4)
lib/action_view/helpers/active_record_helper.rb:277:in
`to_datetime_select_tag'
actionpack (2.3.4)
lib/action_view/helpers/active_record_helper.rb:239:in `to_tag'
actionpack (2.3.4)
lib/action_view/helpers/active_record_helper.rb:22:in `input'
vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb:40:in
`active_scaffold_input_for'
vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb:7
actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
actionpack (2.3.4) lib/action_view/renderable.rb:34:in
`render_without_active_scaffold'
actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
actionpack (2.3.4) lib/action_view/renderable.rb:30:in
`render_without_active_scaffold'
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:in
`render'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:20:in
`render'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:19:in
`render'
actionpack (2.3.4) lib/action_view/template.rb:199:in
`render_template'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:44:in
`render_partial'
actionpack (2.3.4) lib/action_view/partials.rb:184:in
`render_partial'
actionpack (2.3.4) lib/action_view/base.rb:262:in
`render_without_active_scaffold'
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:61:in
`render'
vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb:14
vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_columns.rb:77:in
`each'
vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_columns.rb:64:in
`each'
vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb:2
actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
actionpack (2.3.4) lib/action_view/renderable.rb:34:in
`render_without_active_scaffold'
actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
actionpack (2.3.4) lib/action_view/renderable.rb:30:in
`render_without_active_scaffold'
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:in
`render'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:20:in
`render'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:19:in
`render'
actionpack (2.3.4) lib/action_view/template.rb:199:in
`render_template'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:44:in
`render_partial'
actionpack (2.3.4) lib/action_view/partials.rb:184:in
`render_partial'
actionpack (2.3.4) lib/action_view/base.rb:262:in
`render_without_active_scaffold'
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:61:in
`render'
vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb:41
actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
actionpack (2.3.4) lib/action_view/renderable.rb:34:in
`render_without_active_scaffold'
actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
actionpack (2.3.4) lib/action_view/renderable.rb:30:in
`render_without_active_scaffold'
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:in
`render'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:20:in
`render'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
`benchmark'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:19:in
`render'
actionpack (2.3.4) lib/action_view/template.rb:199:in
`render_template'
actionpack (2.3.4) lib/action_view/renderable_partial.rb:44:in
`render_partial'
actionpack (2.3.4) lib/action_view/partials.rb:184:in
`render_partial'
actionpack (2.3.4) lib/action_view/base.rb:262:in
`render_without_active_scaffold'
vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:61:in
`render'
actionpack (2.3.4) lib/action_controller/base.rb:973:in
`render_without_benchmark'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:51:in
`render_without_active_scaffold'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:51:in
`render_without_active_scaffold'
vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb:13:in
`render'
actionpack (2.3.4) lib/action_controller/base.rb:995:in
`render_to_string'
vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb:9:in
`render'
vendor/plugins/active_scaffold/lib/active_scaffold/actions/create.rb:36:in
`new_respond_to_js'
vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb:130:in
`send'
vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb:130:in
`respond_to_action'
actionpack (2.3.4) lib/action_controller/mime_responds.rb:135:in
`call'
actionpack (2.3.4) lib/action_controller/mime_responds.rb:135:in
`custom'
actionpack (2.3.4) lib/action_controller/mime_responds.rb:179:in
`call'
actionpack (2.3.4) lib/action_controller/mime_responds.rb:179:in
`respond'
actionpack (2.3.4) lib/action_controller/mime_responds.rb:173:in
`each'
actionpack (2.3.4) lib/action_controller/mime_responds.rb:173:in
`respond'
actionpack (2.3.4) lib/action_controller/mime_responds.rb:107:in
`respond_to'
vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb:128:in
`respond_to_action'
vendor/plugins/active_scaffold/lib/active_scaffold/actions/create.rb:13:in
`new'
actionpack (2.3.4) lib/action_controller/base.rb:1331:in `send'
actionpack (2.3.4) lib/action_controller/base.rb:1331:in
`perform_action_without_filters'
actionpack (2.3.4) lib/action_controller/filters.rb:617:in
`call_filters'
actionpack (2.3.4) lib/action_controller/filters.rb:610:in
`perform_action_without_benchmark'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
activesupport (2.3.4)
lib/active_support/core_ext/benchmark.rb:17:in `ms'
actionpack (2.3.4) lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
actionpack (2.3.4) lib/action_controller/rescue.rb:160:in
`perform_action_without_flash'
actionpack (2.3.4) lib/action_controller/flash.rb:146:in
`perform_action_without_render_component'
vendor/plugins/render_component/lib/components.rb:39:in
`perform_action'
actionpack (2.3.4) lib/action_controller/base.rb:532:in `send'
actionpack (2.3.4) lib/action_controller/base.rb:532:in
`process_without_filters'
actionpack (2.3.4) lib/action_controller/filters.rb:606:in
`process'
actionpack (2.3.4) lib/action_controller/base.rb:391:in `process'
actionpack (2.3.4) lib/action_controller/base.rb:386:in `call'
actionpack (2.3.4)
lib/action_controller/routing/route_set.rb:437:in `call'
actionpack (2.3.4) lib/action_controller/dispatcher.rb:87:in
`dispatch'
actionpack (2.3.4) lib/action_controller/dispatcher.rb:121:in
`_call'
actionpack (2.3.4) lib/action_controller/dispatcher.rb:130:in
`build_middleware_stack'
activerecord (2.3.4) lib/active_record/query_cache.rb:29:in `call'
activerecord (2.3.4) lib/active_record/query_cache.rb:29:in `call'
activerecord (2.3.4)
lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
`cache'
activerecord (2.3.4) lib/active_record/query_cache.rb:9:in `cache'
activerecord (2.3.4) lib/active_record/query_cache.rb:28:in `call'
activerecord (2.3.4)
lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
`call'
warden (0.10.3) lib/warden/manager.rb:35:in `call'
warden (0.10.3) lib/warden/manager.rb:34:in `catch'
warden (0.10.3) lib/warden/manager.rb:34:in `call'
rack (1.0.1) lib/rack/head.rb:9:in `call'
rack (1.0.1) lib/rack/methodoverride.rb:24:in `call'
actionpack (2.3.4) lib/action_controller/params_parser.rb:15:in `call'
actionpack (2.3.4)
lib/action_controller/session/cookie_store.rb:93:in `call'
actionpack (2.3.4) lib/action_controller/failsafe.rb:26:in `call'
rack (1.0.1) lib/rack/lock.rb:11:in `call'
rack (1.0.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.0.1) lib/rack/lock.rb:11:in `call'
actionpack (2.3.4) lib/action_controller/dispatcher.rb:114:in `call'
actionpack (2.3.4) lib/action_controller/reloader.rb:34:in `run'
actionpack (2.3.4) lib/action_controller/dispatcher.rb:108:in `call'
passenger (2.2.11)
lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.11)
lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.11)
lib/phusion_passenger/railz/application_spawner.rb:418:in
`start_request_handler'
passenger (2.2.11)
lib/phusion_passenger/railz/application_spawner.rb:358:in
`handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.11)
lib/phusion_passenger/railz/application_spawner.rb:354:in
`handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.11)
lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:262:in
`spawn_rails_application'
passenger (2.2.11)
lib/phusion_passenger/abstract_server_collection.rb:126:in
`lookup_or_add'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:256:in
`spawn_rails_application'
passenger (2.2.11)
lib/phusion_passenger/abstract_server_collection.rb:80:in
`synchronize'
passenger (2.2.11)
lib/phusion_passenger/abstract_server_collection.rb:79:in
`synchronize'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in
`spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in
`spawn_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in
`handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
passenger (2.2.11) bin/passenger-spawn-server:61

Rendered rescues/_trace (238.0ms)
Rendered rescues/_request_and_response (1.9ms)
Rendering rescues/layout (internal_server_error)
----------------



Note however that it doesn't occur in other controller (simpler, with
no nested data, neither subforms).



--
Iñaki Baz Castillo
<i...@aliax.net>

Sergio Cambra .:: entreCables S.L. ::.

unread,
May 4, 2010, 3:31:34 AM5/4/10
to actives...@googlegroups.com
On Lunes, 3 de Mayo de 2010 14:25:55 Iñaki Baz Castillo escribió:
> 2010/5/3 Sergio Cambra .:: entreCables S.L. ::. <ser...@entrecables.com>:
> > Backtrace is not full, remove backtrace silencers uncommenting the last
> > line in config/initializers/backtrace_silencers.rb
>
> Done, this is what I get when I press "Create new" or "Edit" in my
> ClientsController:

The problem is you don't have a translation for date order. Have you
downloaded rails spanish translation? It's in svenfuchs' rails-i18n
repository:
http://github.com/svenfuchs/rails-i18n
> vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.er
>b:41 actionpack (2.3.4) lib/action_view/renderable.rb:34:in `send'
> actionpack (2.3.4) lib/action_view/renderable.rb:34:in
> `render_without_active_scaffold'
> actionpack (2.3.4) lib/action_view/base.rb:301:in `with_template'
> actionpack (2.3.4) lib/action_view/renderable.rb:30:in
> `render_without_active_scaffold'
>
> vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:94:i
>n `render'
> actionpack (2.3.4) lib/action_view/renderable_partial.rb:20:in
> `render'
> actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
> `benchmark'
> activesupport (2.3.4)
> lib/active_support/core_ext/benchmark.rb:17:in `ms'
> /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
> activesupport (2.3.4)
> lib/active_support/core_ext/benchmark.rb:17:in `ms'
> actionpack (2.3.4) lib/action_controller/benchmarking.rb:26:in
> `benchmark'
> actionpack (2.3.4) lib/action_view/renderable_partial.rb:19:in
> `render'
> actionpack (2.3.4) lib/action_view/template.rb:199:in
> `render_template'
> actionpack (2.3.4) lib/action_view/renderable_partial.rb:44:in
> `render_partial'
> actionpack (2.3.4) lib/action_view/partials.rb:184:in
> `render_partial'
> actionpack (2.3.4) lib/action_view/base.rb:262:in
> `render_without_active_scaffold'
>
> vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb:61:i
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Iñaki Baz Castillo

unread,
May 4, 2010, 5:35:31 AM5/4/10
to actives...@googlegroups.com
2010/5/4 Sergio Cambra .:: entreCables S.L. ::. <ser...@entrecables.com>:

> The problem is you don't have a translation for date order. Have you
> downloaded rails spanish translation? It's in svenfuchs' rails-i18n
> repository:
> http://github.com/svenfuchs/rails-i18n

Thanks for pointing it out :)

I know this is a Rails related question, or perhaps I miss something
again, but I find impossible to make svenfuchs-i18n working with Rails
2.3.4 and 2.3.5.
I've updated to 2.3.5 to avoid the "gem 'i18n', '~> 0.1.3'" in
activesupport/lib/active_support/vendor.rb:

http://github.com/rails/rails/blob/v2.3.4/activesupport/lib/active_support/vendor.rb#L23-28
http://github.com/rails/rails/blob/v2.3.5/activesupport/lib/active_support/vendor.rb#L23-28

Then I've installed svenfuchs-i18n gem and loaded it in my Rail
project environment.rb:

require "rubygems"
gem "svenfuchs-i18n", :version => '0.2.0', :lib => 'i18n'

Still the same issue. I know this is a pure Rails question (I've never
used i18n) but perhaps I miss something "easy"...

Thanks for any help (again). :)



--
Iñaki Baz Castillo
<i...@aliax.net>

--

Sergio Cambra .:: entreCables S.L. ::.

unread,
May 4, 2010, 5:45:56 AM5/4/10
to actives...@googlegroups.com
On Martes, 4 de Mayo de 2010 11:35:31 Iñaki Baz Castillo escribió:
> 2010/5/4 Sergio Cambra .:: entreCables S.L. ::. <ser...@entrecables.com>:
> > The problem is you don't have a translation for date order. Have you
> > downloaded rails spanish translation? It's in svenfuchs' rails-i18n
> > repository:
> > http://github.com/svenfuchs/rails-i18n
>
> Thanks for pointing it out :)
>
> I know this is a Rails related question, or perhaps I miss something
> again, but I find impossible to make svenfuchs-i18n working with Rails
> 2.3.4 and 2.3.5.
> I've updated to 2.3.5 to avoid the "gem 'i18n', '~> 0.1.3'" in
> activesupport/lib/active_support/vendor.rb:
>
>
> http://github.com/rails/rails/blob/v2.3.4/activesupport/lib/active_support/
>vendor.rb#L23-28
> http://github.com/rails/rails/blob/v2.3.5/activesupport/lib/active_support/
>vendor.rb#L23-28
>
> Then I've installed svenfuchs-i18n gem and loaded it in my Rail
> project environment.rb:
>
> require "rubygems"
> gem "svenfuchs-i18n", :version => '0.2.0', :lib => 'i18n'
>
> Still the same issue. I know this is a pure Rails question (I've never
> used i18n) but perhaps I miss something "easy"...

I have never tried to use svenfuchs-i18n gem, I download the spanish
translation file (es.yml) from the repository and put it in my config/locales
directory


--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Iñaki Baz Castillo

unread,
May 4, 2010, 6:03:03 AM5/4/10
to actives...@googlegroups.com
2010/5/4 Sergio Cambra .:: entreCables S.L. ::. <ser...@entrecables.com>:
> I have never tried to use svenfuchs-i18n gem, I download the spanish
> translation file (es.yml) from the repository and put it in my config/locales
> directory

And that just works :)
Thanks.


--
Iñaki Baz Castillo
<i...@aliax.net>

Reply all
Reply to author
Forward
0 new messages