Skip to content

Replace hard-coded English strings in views with i18n calls#7114

Open
rawOrlando wants to merge 33 commits into
mainfrom
i18n-hard-coded-fix
Open

Replace hard-coded English strings in views with i18n calls#7114
rawOrlando wants to merge 33 commits into
mainfrom
i18n-hard-coded-fix

Conversation

@rawOrlando

@rawOrlando rawOrlando commented May 23, 2025

Copy link
Copy Markdown
Contributor

Fixes

Part of #1386

Summary

Replace hard-coded English with I18n calls

Guidance for testing, such as acceptance criteria or new user interface behaviors:

View the affected pages locally

Type of change (for release notes)

notes-minor

Detailed Description

Use i15r and manual modification to remove hard-coded English from our views to have localized translations from I18n show

Changes proposed in this pull request:

Replace hard-coded English with I18n calls

Todo:

Only got through some of the view directories
Views

  • catalog
  • collections
  • hyrax
    • admin
    • base
    • batch_edits
    • batch_select
    • batch_upload
    • citations
    • collections
    • contact_form
    • contact_mailer
    • content_block
    • dashboard
    • despositors
    • embargoes
    • file_sets
    • homepage
    • leases
    • my
    • notification
    • operations
    • pages
    • permissions
    • single_use_links
    • single_use_links_viewer
    • static
    • stats
    • transfers
    • uploads
    • users
  • layouts
  • records
  • shared

Note: Content_block has some hard-coded English that looks like legal terms. Take care with the translation.

  • Translate
    The Instructions to translate require you to get a Google API key. I tried to get one for the Cloud Translation API but was told I would need a credit card and pay. I am not doing that.

@rawOrlando

Copy link
Copy Markdown
Contributor Author

Putting this down, I will try to do more when time permits.

If someone else picks this up, I found I15r to be quite zealous with what it tries to convert, often converting code. So you will have to babysit the changes it tries to make.

Also squash down the commits before sending this off to a review.

@github-actions

github-actions Bot commented May 23, 2025

Copy link
Copy Markdown

Test Results

   17 files  ±     0     17 suites  ±0   0s ⏱️ - 3h 28m 46s
1 869 tests  -  5 727  1 853 ✅  -  5 436  0 💤  - 306  0 ❌  - 1  16 🔥 +16 
1 869 runs   - 23 841  1 853 ✅  - 23 263  0 💤  - 593  0 ❌  - 1  16 🔥 +16 

For more details on these errors, see this check.

Results for commit 050e9cb. ± Comparison against base commit f62afa4.

♻️ This comment has been updated with latest results.

@randalldfloyd

Copy link
Copy Markdown
Contributor

@rawOrlando Wow this is a huge contribution on this issue! If it's okay with you, I'm going to convert this to a draft PR so that everyone knows there's still more to do in both views and the locales. But thanks for the big lift so far!

@randalldfloyd randalldfloyd marked this pull request as draft May 27, 2025 15:13
@rawOrlando

rawOrlando commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author

Thought I found a free api to tranlate instead of google translates, libretranslate. but i found out it cost money to use. nope, they tryied to swindled me. You just need to run the service locally

@rawOrlando rawOrlando force-pushed the i18n-hard-coded-fix branch 9 times, most recently from 61080f0 to e2c5193 Compare November 4, 2025 14:45
@rawOrlando

Copy link
Copy Markdown
Contributor Author

I left these two alone, I think we will need some legal folks to look over any translations of them.
app/views/hyrax/content_blocks/templates/agreement.html.erb
app/views/hyrax/content_blocks/templates/terms.html.erb

@rawOrlando

Copy link
Copy Markdown
Contributor Author

script used to create translations https://github.com/samvera-labs/translate_missing/tree/main

@rawOrlando rawOrlando marked this pull request as ready for review November 6, 2025 19:50
@rawOrlando

Copy link
Copy Markdown
Contributor Author

@randalldfloyd, is this GitHub set up so that all the commits will be squashed down to one? Should I clean up my commits?

@dlpierce dlpierce added the notes-minor Release Notes: Non-breaking features label May 22, 2026

@dlpierce dlpierce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internationalization notes-minor Release Notes: Non-breaking features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants