Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Fixes search results page translations. #244

Merged
merged 2 commits into from
Jan 30, 2023

Conversation

DeonFranklin
Copy link
Contributor

@DeonFranklin DeonFranklin commented Jan 30, 2023

Prior to this change, the applications specific translations were not loaded. Dogbiscuits were assuming the translations were already loaded.

Ref: scientist-softserv/adventist_knapsack#469

image

Prior to this change, the applications specific translations were not loaded. Dogbiscuits were assuming the translations were already loaded.

Ref: #227
@DeonFranklin DeonFranklin merged commit 14037e6 into main Jan 30, 2023
@DeonFranklin DeonFranklin deleted the i227-fix-metadata-on-search-page branch January 30, 2023 21:38
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this pull request Oct 5, 2023
Prior to this change, assuming my default translation was "en" when I
called the following—`I18n.t('dog_biscuits.fields.date_issued')`—I would
get `Translation missing: en.dog_biscuits.fields.date_issued`.

We had added DogBiscuits into that path but we had not reloaded the
back-end.

Further, the catalog controller was no longer doing useful work.  The
`Rails.root` is `hyrax-webapp`; which would already be working.  For
more on this anti-pattern, see [Potential Issues Around Knapsack and Rails.root][1].

With this change, I have a small test to verify that dog biscuits
translations are in fact loaded.

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/611
- https://github.com/scientist-softserv/adventist-dl/issues/227
- scientist-softserv/adventist-dl#244

[1]: #60)
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this pull request Oct 5, 2023
Prior to this change, assuming my default translation was "en" when I
called the following—`I18n.t('dog_biscuits.fields.date_issued')`—I would
get `Translation missing: en.dog_biscuits.fields.date_issued`.

We had added DogBiscuits into that path but we had not reloaded the
back-end.

Further, the catalog controller was no longer doing useful work.  The
`Rails.root` is `hyrax-webapp`; which would already be working.  For
more on this anti-pattern, see [Potential Issues Around Knapsack and Rails.root][1].

With this change, I have a small test to verify that dog biscuits
translations are in fact loaded.

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/611
- https://github.com/scientist-softserv/adventist-dl/issues/227
- scientist-softserv/adventist-dl#244

[1]: #60)
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this pull request Oct 5, 2023
Prior to this change, assuming my default translation was "en" when I
called the following—`I18n.t('dog_biscuits.fields.date_issued')`—I would
get `Translation missing: en.dog_biscuits.fields.date_issued`.

We had added DogBiscuits into that path but we had not reloaded the
back-end.

Further, the catalog controller was no longer doing useful work.  The
`Rails.root` is `hyrax-webapp`; which would already be working.  For
more on this anti-pattern, see [Potential Issues Around Knapsack and Rails.root][1].

With this change, I have a small test to verify that dog biscuits
translations are in fact loaded.

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/611
- https://github.com/scientist-softserv/adventist-dl/issues/227
- scientist-softserv/adventist-dl#244

[1]: #60)
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this pull request Oct 5, 2023
Prior to this change, assuming my default translation was "en" when I
called the following—`I18n.t('dog_biscuits.fields.date_issued')`—I would
get `Translation missing: en.dog_biscuits.fields.date_issued`.

We had added DogBiscuits into that path but we had not reloaded the
back-end.

Further, the catalog controller was no longer doing useful work.  The
`Rails.root` is `hyrax-webapp`; which would already be working.  For
more on this anti-pattern, see [Potential Issues Around Knapsack and
Rails.root][1].

With this change, I have a small test to verify that dog biscuits
translations are in fact loaded.

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/611
- https://github.com/scientist-softserv/adventist-dl/issues/227
- scientist-softserv/adventist-dl#244

[1]: #60)
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this pull request Oct 6, 2023
Prior to this change, we had ensured knapsack's translations took
precedence over Hyku's.  However, that ensuring occurred at the
after_initialize.  We had missed the CatalogController's translation
moment as well.

When we specify the index fields in the CatalogController, blacklight
caches those translations.  However, in the case of dogbiscuits, those
are not yet loaded.  Which results in a translation error; even though
we later load the dog biscuits translations.

With this change, I have added two tests to:

1. verify that translations are correct for the catalog controller
2. that when the app boots, the Knapsack translations take precedence
   over Hyku.

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/611
- https://github.com/scientist-softserv/adventist-dl/issues/227
- scientist-softserv/adventist-dl#244
- #63

[1]: #60)
jeremyf added a commit to scientist-softserv/adventist_knapsack that referenced this pull request Oct 6, 2023
Prior to this change, we had ensured knapsack's translations took
precedence over Hyku's.  However, that ensuring occurred at the
after_initialize.  We had missed the CatalogController's translation
moment as well.

When we specify the index fields in the CatalogController, blacklight
caches those translations.  However, in the case of dogbiscuits, those
are not yet loaded.  Which results in a translation error; even though
we later load the dog biscuits translations.

With this change, I have added two tests to:

1. verify that translations are correct for the catalog controller
2. that when the app boots, the Knapsack translations take precedence
   over Hyku.

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/611
- https://github.com/scientist-softserv/adventist-dl/issues/227
- scientist-softserv/adventist-dl#244
- #63

[1]: #60)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants