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

Feature/cxspa 9278 fix cds translations #19939

Merged
merged 7 commits into from
Jan 29, 2025

Conversation

lasoh
Copy link
Contributor

@lasoh lasoh commented Jan 27, 2025

Fix cds translation

@lasoh lasoh requested review from a team as code owners January 27, 2025 15:50
@github-actions github-actions bot marked this pull request as draft January 27, 2025 15:50
@lasoh lasoh marked this pull request as ready for review January 27, 2025 15:51
Copy link

cypress bot commented Jan 27, 2025

spartacus    Run #46899

Run Properties:  status check passed Passed #46899  •  git commit e688153326 ℹ️: Merge c0df1309047942c7f98dce48e0f2b2391e4e1297 into 86031890c07b9a3619068807c376...
Project spartacus
Branch Review feature/CXSPA-9278-fix-cds-translations
Run status status check passed Passed #46899
Run duration 14m 32s
Commit git commit e688153326 ℹ️: Merge c0df1309047942c7f98dce48e0f2b2391e4e1297 into 86031890c07b9a3619068807c376...
Committer lasoh
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 4
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 125
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@@ -1,6 +1,5 @@
{
"cdsTrendingSearches": {
"trendingSearches": "Popularne wyszukiwania",
"ariaTrendingSearches": "wpisywanie popularnych wyszukiwań"
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels unnatural to split the keys trendingSearches and ariaTrendingSearches into different files (cds.json and common.json).
So to keep them together, I'd suggest to even delete the cds-related i18n files, and move all keys both the trendingSearches and ariaTrendingSearches to the common.json file. Same for recentSearches.

What do you think about it?

--
Side note: A general issue we had, even before this PR: we had unnecesarily two i18n files for CDS, each having only 1-2 translation keys. Instead we could have just one cdc.json file. Why: when customer configures i18n to be lazy loaded, we would lazy load 2 separate files cdsTrendingSearches.json and cdsRecentSearches.json with just 1-2 keys each, which is suboptimal.

Copy link
Contributor Author

@lasoh lasoh Jan 28, 2025

Choose a reason for hiding this comment

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

I think this is a good solution, but on the other hand if we need to add something in these modules (texts) the translation structure would already be ready. We wouldn't have to restore them back. That's why I would leave it as it is in PR for the future.
If we decided to moge recentSearches & trendigSearches translation object to common.json i would prefere add objects to searchBox f.e.
searchBox:{ recentSearches:{ header: 'Recent searches', ariaLabel: 'Aria sth' } }
@Platonn what do You think about ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps I'm missing something obvious.
I just thought that trendingSearches and ariaTrendingSearches are tightly coupled.

PS. In the future, if we want to leave any i18n JSON file related to cds, I would not use the current 2 ones (but rather drop them now), and use one file e.g. cds.json instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the translations that were in many files of the cds module to one file. (They are used only in this module). However, due to the structure of the SearchComponent in common.json I left the translations only for the headers.

@lasoh lasoh requested a review from Platonn January 28, 2025 15:05
@github-actions github-actions bot marked this pull request as draft January 29, 2025 08:29
@lasoh lasoh marked this pull request as ready for review January 29, 2025 09:33
@github-actions github-actions bot marked this pull request as draft January 29, 2025 12:29
@pawelfras pawelfras marked this pull request as ready for review January 29, 2025 12:34
@github-actions github-actions bot marked this pull request as draft January 29, 2025 13:21
@lasoh lasoh marked this pull request as ready for review January 29, 2025 13:37
@lasoh lasoh merged commit 7875cc7 into develop Jan 29, 2025
28 checks passed
@lasoh lasoh deleted the feature/CXSPA-9278-fix-cds-translations branch January 29, 2025 14:12
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.

4 participants