Islandora / controlled_access_terms

Drupal module for subject and agents
GNU General Public License v2.0
7 stars 28 forks source link

wrap the relator type with t() function #91

Closed wgilling closed 1 year ago

wgilling commented 1 year ago

GitHub Issue: https://github.com/Islandora/controlled_access_terms/issues/90

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.

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:

rosiel commented 1 year ago

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 commented 1 year ago

Oh my goodness. How could this even work? :exploding_head: 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 commented 1 year ago

This is failing due to the schema for this field -- update from string to label perhaps. See: https://github.com/Islandora/controlled_access_terms/blob/9598fcab8f727d183f2203fb4533db31d54558d7/config/schema/controlled_access_terms.schema.yml#L117

wgilling commented 1 year ago

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