-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Ensure knapsack translations are first choice #63
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShanaLMoore
approved these changes
Oct 5, 2023
jeremyf
force-pushed
the
dog-biscuits-translations
branch
from
October 5, 2023 19:29
841e3f9
to
654bdb6
Compare
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
force-pushed
the
dog-biscuits-translations
branch
from
October 5, 2023 20:02
654bdb6
to
50dd0c7
Compare
jeremyf
added a commit
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
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
that referenced
this pull request
Oct 12, 2023
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 - #60 Co-authored-by: LaRita Robinson <larita@scientist.com>
jeremyf
added a commit
that referenced
this pull request
Oct 12, 2023
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 - #60 Co-authored-by: LaRita Robinson <larita@scientist.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this change, assuming my default translation was "en" when I
called the following—
I18n.t('dog_biscuits.fields.date_issued')
—I wouldget
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
ishyrax-webapp
; which would already be working. Formore 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:
[1]: #60)