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

Improved schematron localisation #8665

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joachimnielandt
Copy link
Collaborator

@joachimnielandt joachimnielandt commented Feb 18, 2025

In the dcat-ap schema plugin there is a need to translate schematron strings. One of the ways is to use the loc/eng/schematron-rules-x.xml files that are loaded by iso_svrl_for_xslt2.xsl. A helper function replacePlaceholders was added that makes sure the schematron rules remain language agnostic and the translations are easily adaptable to the needs of each language.

  • English is proposed as the fallback language whenever a file cannot be found.
  • A shared schematron localisation file is introduced to prevent having to duplicate common schematron translation strings. Not having this file in place works fine.
  • Fix in iso_svrl_for_xslt2.xsl to make sure $loc is also used when wrapped in a function.

In the schema plugin a PR was created that makes use of this change: metadata101/dcat-ap#38.

@fxprunayre @CMath04

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

- added xslt helper function to replace placeholders
- made sure shared strings can be used for the schematron localisation (schematron-shared.xml)
- fix in iso_svrl_for_xslt2.xsl to make sure $loc is also used when wrapped in a function
@joachimnielandt joachimnielandt changed the title improved schematron localisation Improved schematron localisation Feb 18, 2025
@CMath04
Copy link
Collaborator

CMath04 commented Feb 19, 2025

Tested and it works fine.
I also check for regression on ISO but it all seems fine.

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.

2 participants