Skip to content

Add translations for search component UI texts#1855

Merged
osma merged 3 commits intomainfrom
search-component-translations
Dec 5, 2025
Merged

Add translations for search component UI texts#1855
osma merged 3 commits intomainfrom
search-component-translations

Conversation

@osma
Copy link
Member

@osma osma commented Dec 4, 2025

Reasons for creating this PR

The search component (global & vocabulary) were missing some UI translations. This PR adds them. It also changes the text "Global search" to "Search across vocabularies", which is hopefully more user-friendly.

Link to relevant issue(s), if any

  • part of Epic: Vocabulary Search Bar #1514
    • addresses requirement "2.5 The translation component provides the translated UI messages (cypress tests for this)" though no cypress tests...
  • part of Epic: Global Search Bar #1489
    • addresses requirement "2.3 All UI text is in English (in the form of translation message IDs) (Message IDs TBD)"
    • addresses requirement "2.5 The translation component provides the translated UI messages (cypress tests for this)"

Description of the changes in this PR

  • change "Global search" message to "Search across vocabularies" in base-template.twig (twice)
  • define translations for all the search component messages in Lokalise & pull them into this PR
  • Skosmos 2 was using the message Search language: any which got translated into Any language in English. I simplified this so that the base message is Any language.
  • adjust Cypress tests for the global search bar to work with the new translations

Known problems or uncertainties in this PR

Didn't add Cypress tests for the vocab search bar. We already have some of those (e.g, the global search bar) and UI translation is such a basic mechanism that it doesn't make sense to test every single use of it.

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added this to the 3.0 milestone Dec 4, 2025
@osma osma self-assigned this Dec 4, 2025
@osma osma marked this pull request as draft December 4, 2025 14:11
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

@osma osma marked this pull request as ready for review December 4, 2025 14:40
@osma osma moved this to Needs review in Skosmos 3.x Backlog Dec 4, 2025
@osma osma requested a review from miguelvaara December 4, 2025 14:40
Copy link
Contributor

@miguelvaara miguelvaara left a comment

Choose a reason for hiding this comment

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

Everything looks really good, both the tests and syntax checks pass as well.

Hopefully we can get the Sámi terms into the global search soon, just like they are already partially implemented in the vocabulary search (the hint text in the search field). That would improve equality between users of different languages and also make the UI more consistent.

It is also a bit unfortunate thatnow we lost translations for a few important languages because of the "Search language: any" change, but on the other hand, it encourages us to motivate the translator community to contribute more.

Of course these comments are not about the implementation itself but the changes you made work really well.

I think it si ready to merge.

@osma
Copy link
Member Author

osma commented Dec 5, 2025

It is also a bit unfortunate thatnow we lost translations for a few important languages because of the "Search language: any" change, but on the other hand, it encourages us to motivate the translator community to contribute more.

I migrated the translations for this term to the new message ID in Lokalise, so they were not lost.

@osma osma merged commit 599e128 into main Dec 5, 2025
28 of 30 checks passed
@github-project-automation github-project-automation bot moved this from Needs review to Issue/PR closed in Skosmos 3.x Backlog Dec 5, 2025
@osma osma deleted the search-component-translations branch December 5, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants