fix: use translation instead of hardcoded loading string#1683
fix: use translation instead of hardcoded loading string#1683secondl1ght merged 3 commits intodevfrom
Conversation
Greptile SummaryThis PR replaces a hardcoded Confidence Score: 5/5Safe to merge — the change is a minimal, correct i18n substitution with no behavioral or structural risks. No P0 or P1 findings. The No files require special attention.
|
| Filename | Overview |
|---|---|
| src/components/molecules/InputField/InputField.tsx | Added 'use client' directive and useTranslations('common') hook to resolve loadingText via translation fallback; no logic changes beyond the hardcoded string removal. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[InputField render] --> B{loadingText prop provided?}
B -- Yes --> C[Use provided loadingText]
B -- No --> D[Lookup common.loading via t]
C --> E[resolvedLoadingText]
D --> E
E --> F{loading === true?}
F -- Yes --> G[Display resolvedLoadingText in input]
F -- No --> H[Display value prop in input]
Reviews (1): Last reviewed commit: "fix: use translation instead of hardcode..." | Re-trigger Greptile
🚀 Preview DeploymentURL: https://franky-preview-pr-1683-fzxmjul7ya-oa.a.run.app
|
🌐 Replace hardcoded loading text with i18n translation in InputField
Summary
Replaced the hardcoded
'Loading...'default value for theloadingTextprop in theInputFieldmolecule with a propernext-intltranslation using the existingcommon.loadingkey fromen.json.Changes
src/components/molecules/InputField/InputField.tsx'use client'directive (required for theuseTranslationshook, consistent with other molecules)useTranslationsfromnext-intl'Loading...'default from theloadingTextpropuseTranslations('common')hook and resolved loading text vialoadingText ?? t('loading')loadingTextexplicitly if neededNo Test Changes Required ✅
The global
next-intlmock insrc/config/test.tsalready uses the actualen.jsonmessages, so all 12 existing tests pass without modification. Snapshots updated cleanly since the translated value matches the previous hardcoded string.Related
Screenshots
Notes
This pull request summary was generated, for full implementation details please reference the file changes.