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

Fix sync-i18n script throwing a compile error & added some missing translation keys #2930

Merged

Conversation

alexandrevryghem
Copy link
Member

References

Description

Currently the sync-i18n script can't be executed because of a type issue caused by the Typescript 4.4 update. Because this PR was ridiculously small I also fixed another issue at the same time. The second fix makes the DSO type in the dso-selector translatable.

Instructions for Reviewers

List of changes in this PR:

  • Added an if statement to sync-i18n-files.ts to verify that the variable returned by the catch block is of type Error
  • Added translation keys for the 3 DSO types that use the dso-selector: Community, Collection & Item

Guidance for how to test/review this PR:

  • Verify that you can run the sync-i18n script again
  • Verify that the DSO selector now show the translated community/collection/item in French/Dutch
  • Verify that it also works when a DSo selector contains multiple different types of DSO types (for example the scope selector on the search page)

Checklist

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

This is caused by the typescript 4.4 update that changed the catch type from any to unknown
@alexandrevryghem alexandrevryghem self-assigned this Apr 14, 2024
@alexandrevryghem alexandrevryghem added bug i18n / l10n Internationalisation and localisation, related to message catalogs claimed: Atmire Atmire team is working on this issue & will contribute back labels Apr 14, 2024
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Apr 15, 2024
@tdonohue tdonohue added this to the 8.0 milestone Apr 15, 2024
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks @alexandrevryghem ! Tested this locally and could reproduce the bug. This fixes it. The missing i18n keys look correct too

@tdonohue tdonohue merged commit 16c0662 into DSpace:main May 3, 2024
13 checks passed
@alexandrevryghem alexandrevryghem deleted the fix-sync-i18n-script_contribute-main branch May 9, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug claimed: Atmire Atmire team is working on this issue & will contribute back i18n / l10n Internationalisation and localisation, related to message catalogs
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

item types in dso-selector component are not getting translated
2 participants