samvera-deprecated / curation_concerns

A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on Hydra::Works) and providing a generator for defining object types with custom workflows, views, access controls, etc.
Other
15 stars 27 forks source link

Reverted i18n gem to version 0.8.1 #1184

Closed smithjp closed 2 years ago

smithjp commented 7 years ago

Fixes test failures due to missing translations.

It appears that the curation_concerns gem is not compatible with i18n gem >= 0.8.3, so an explicit dependency for i18n version 0.8.1 is being added.

@samvera/sufia-code-reviewers

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 0484443eb42abd081bd59c334d0f7e71d52ff220 on smithjp:1-7-7-release into on samvera:1-7-7-release.

jcoyne commented 7 years ago

Can you provide a replication case for the bug? Have you filed an issue with the maintainers of the i18n gem?

jcoyne commented 7 years ago

Was it this issue? https://github.com/CanCanCommunity/cancancan/issues/415

smithjp commented 7 years ago

The test failures look like this:

 ActionView::Template::Error:
   translation missing: en.false
 # ./app/renderers/curation_concerns/renderers/configured_microdata.rb:13:in `microdata_object?'
 # ./app/renderers/curation_concerns/renderers/configured_microdata.rb:17:in `microdata_object_attributes'
 # ./app/renderers/curation_concerns/renderers/attribute_renderer.rb:28:in `render'
 # ./app/presenters/curation_concerns/presents_attributes.rb:20:in `attribute_to_html'
 # ./app/views/curation_concerns/base/_attributes.html.erb:8:in `__home_travis_build_samvera_curation_concerns_app_views_curation_concerns_base__attributes_html_erb__2674987801978955349_140047760'
 # ./app/views/curation_concerns/base/show.html.erb:19:in `__home_travis_build_samvera_curation_concerns_app_views_curation_concerns_base_show_html_erb___168103936029684779_140777240'
 # ./spec/features/add_file_spec.rb:18:in `block (2 levels) in <top (required)>'
 # ------------------
 # --- Caused by: ---
 # I18n::MissingTranslationData:
 #   translation missing: en.curation_concerns.schema_org.permission_badge.type
 #   ./app/renderers/curation_concerns/renderers/configured_microdata.rb:13:in `microdata_object?'

Which can be seen in the automated tests for previous pull request at: https://travis-ci.org/samvera/curation_concerns/jobs/240798479.

jcoyne commented 7 years ago

@smithjp to me it looks like the problem is on this line: https://github.com/samvera/curation_concerns/blob/master/app/renderers/curation_concerns/renderers/configured_microdata.rb#L13

The default probably shouldn't be false. Maybe empty string or nil?

jcoyne commented 7 years ago

I think I see what is happening here:

When you say t('foo', default: false) the TranslationHelper in rails actually calls: I18n.translate('foo', default: [false], raise: true). I think this was broken by this change: https://github.com/svenfuchs/i18n/commit/1641e5fefebf53435bcc45eacf1e4659d46dece9

I made an upstream issue: https://github.com/svenfuchs/i18n/issues/379

Please add a comment next to your change that points to that issue. That way we can back out your change when the issue is resolved upstream.

smithjp commented 7 years ago

I have added a comment in the Gemfile.extra file. Is this ok?

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 594d84e9e1326b154f0091f16bcddbc799ab905c on smithjp:1-7-7-release into on samvera:1-7-7-release.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 594d84e9e1326b154f0091f16bcddbc799ab905c on smithjp:1-7-7-release into on samvera:1-7-7-release.