Skip to content
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

wrap the relator type with t() function #91

Merged
merged 2 commits into from
Feb 1, 2023
Merged

wrap the relator type with t() function #91

merged 2 commits into from
Feb 1, 2023

Conversation

wgilling
Copy link
Contributor

@wgilling wgilling commented Dec 1, 2022

GitHub Issue: #90

  • Other Relevant Links (Google Groups discussion, related pull requests,
    Release pull requests, etc.) - internal issue with one of our client's sites

What does this Pull Request do?

It wraps the relator type in the t() function.

This allows the agent relator type and the three digit code to be translated via the User Interface translation configurations.

What's new?

A in-depth description of the changes made by this PR. Technical details and
possible side effects.

  • Does this change require documentation to be updated? I really do not think so -- this likely is providing expected functionality.
  • Does this change add any new dependencies? no
  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? no
  • Could this change impact execution of existing code? no

How should this be tested?

  1. Pull this branch of controlled_access_terms into any working islandora site
  2. Configure that site for multiple languages.
  3. Add or edit any Islandora object to have at least one Linked Agent field.
  4. Provide a translation value for that relator type and three digit code, for example "Author (aut)" to French would be "Auteur (aut)". NOTE: attempting to provide a translation ONLY for the relator type without the three digit code does not seem to work.
  5. Select the secondary language to view that item and see that it is translated as configured.

A description of what steps someone could take to:

  • Reproduce the problem you are fixing (if applicable) -- simply view any Islandora Object that has a linked agent in a secondary language -- and attempt to provide a User Interface translation for the relator name at /admin/config/regional/translate.

@rosiel
Copy link
Member

rosiel commented Dec 2, 2022

Oh wow is it hard to sort through docs about drupal 7, 8, and 9.

OK, i think this will do it. (🤯 ). You need the third translation module, "Configuration Translation," enabled. And you have to do it on a new site (e.g. branch of the starter site)

Screen Shot 2022-12-02 at 12 12 36 AM

Screen Shot 2022-12-02 at 12 21 21 AM

(I didn't translate the content, sorry, ignore the title)

But for existing sites, I'm not sure what kind of schema updates are necessary. @adam-vessey might know?

btw i found the "cheatsheet" and this page really interesting: https://www.drupal.org/node/1905070

@wgilling
Copy link
Contributor Author

wgilling commented Dec 2, 2022

Oh my goodness. How could this even work? 🤯 Seems that it is using a different kind of magic by addressing configs somehow, but I won't be able to test this approach for a little while.

@wgilling
Copy link
Contributor Author

wgilling commented Dec 8, 2022

This is failing due to the schema for this field -- update from string to label perhaps. See:

@wgilling
Copy link
Contributor Author

Thanks to Rosie's PR, this pull request should be revisited and potentially change the commit message at least.

@adam-vessey adam-vessey merged commit 7f33294 into 2.x Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants