-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Issue #1937] Translate Loading component text #2186
base: main
Are you sure you want to change the base?
Conversation
…al for non-search loading translation as well Fixes #1937
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Statements | 90.6% | 790/872 |
🟡 | Branches | 71.79% | 224/312 |
🟢 | Functions | 87.89% | 167/190 |
🟢 | Lines | 91.27% | 742/813 |
Test suite run success
178 tests passing in 54 suites.
Report generated by 🧪jest coverage report action from 7316673
import React from "react"; | ||
|
||
import Spinner from "src/components/Spinner"; | ||
|
||
export default function Loading() { | ||
// TODO (Issue #1937): Use translation utility for strings in this file | ||
const t = useTranslations("Loading"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const t = useTranslations("Loading"); | |
unstable_setRequestLocale("en"); | |
const t = useTranslations("Loading"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making these changes causes the following error in Storybook:
Looks like this might not be needed at the component level?
https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#add-unstable_setrequestlocale-to-all-layouts-and-pages
@@ -1,14 +1,16 @@ | |||
import { useTranslations } from "next-intl"; | |||
import React from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import React from "react"; | |
import { unstable_setRequestLocale } from "next-intl/server"; | |
import React from "react"; |
Looks good, think you need to add |
Summary
Fixes #1937
Time to review: 5 mins
Changes proposed
Implemented the translation library for the text on the Search loading spinner
Context for reviewers
This component is currently under the Search page, but seems like we'd likely reuse it elsewhere. Since file moves are weird to PR and revert I wanted to get more input before moving stuff around.
Additional information
Tested by implementing Storybook for this component