Adding %{repository} instead of hardcoded GitHub repo in en.yml - #1346
Adding %{repository} instead of hardcoded GitHub repo in en.yml#1346kennethrioja wants to merge 2 commits into
%{repository} instead of hardcoded GitHub repo in en.yml#1346Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes repository links in the developer-facing “license/contributions” strings configurable by introducing a %{repository} interpolation value, allowing the same TeSS instance to point at different upstream repositories without editing locale text.
Changes:
- Replaced hardcoded GitHub URLs in
config/locales/en.ymlwith%{repository}. - Added
repositoryto the global I18n default interpolation options viaconfig/initializers/i18n_defaults.rb.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| config/locales/en.yml | Switches LICENSE/CONTRIBUTING links to use %{repository} interpolation. |
| config/initializers/i18n_defaults.rb | Adds a default repository interpolation value sourced from TeSS::Config.site. |
Comments suppressed due to low confidence (1)
config/locales/en.yml:194
- The
<a>tag has an extra comma between attributes (href="...", target=...), which is invalid HTML and may be parsed inconsistently. Since this link opens a new tab, it should also includerel="noopener noreferrer"to prevent reverse-tabnabbing.
<a href="%{repository}/blob/master/CONTRIBUTING.md", target="_blank">contributions<i class="icon icon-md arrow-top-right-icon"></i></a>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| and widgets. The %{site_name} codebase is also available to re-use under the BSD Licence, and can be found on GitHub. | ||
| code_license: > | ||
| <a href="https://github.com/ElixirTeSS/TeSS/blob/master/LICENSE", target="_blank">BSD 3-Clause<i class="icon icon-md arrow-top-right-icon"></i></a> | ||
| <a href="%{repository}/blob/master/LICENSE", target="_blank">BSD 3-Clause<i class="icon icon-md arrow-top-right-icon"></i></a> |
fbacall
left a comment
There was a problem hiding this comment.
I think if this field is now configurable, then the licenses should also be configurable (both on the code and content), since a different instance may not use BSD 3-Clause.
The BSD 3-Clause must remain on each and every TeSS instance, so no one must not change it. However for the data, as it is currently CC-BY 4.0, we can. I've made |
|
Not really true, people are free to re-license their fork under whatever license they want (or have no license at all), provided they include our original license text somewhere. |
Summary of changes
%{repository}to not have a hardcoded URL inen.ymlMotivation and context
As I will now have different repos for HEP Training and EVERSE Training, I needed the URLs to be interchangeable easily.
Screenshots
N/A
Checklist