-
Notifications
You must be signed in to change notification settings - Fork 1
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
[no-Jira] Localize labels and use static translation strings #856
Conversation
...ents/Contacts/ContactFlow/ContactFlowSetup/DragPreview/ContactFlowSetupDragPreviewStatus.tsx
Outdated
Show resolved
Hide resolved
src/components/Contacts/ContactFlow/ContactFlowSetup/Row/ContactFlowSetupStatusRow.tsx
Outdated
Show resolved
Hide resolved
@@ -134,7 +135,7 @@ const SearchMenu = (): ReactElement => { | |||
{ | |||
name: t('Reports - Donations'), | |||
icon: <CompassIcon />, | |||
link: `/accountLists/${accountListId}/reports/PartnerGivingAnalysis`, |
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.
The old link 404s.
@@ -44,8 +42,8 @@ export const Item: React.FC<Props> = ({ | |||
variant: 'subtitle1', | |||
color: 'textPrimary', | |||
}} | |||
primary={t(item.title)} |
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.
Localization is done in MultiPageMenuItems.ts
26a45f1
to
63d00d7
Compare
This pull request is automatically being deployed by Amplify Hosting (learn more). |
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.
This looks great! I left a few remarks but nothing crazy. I've requested some changes, but feel free to talk or disagree.
...onents/Contacts/ContactDetails/ContactTasksTab/DeleteTaskIconButton/DeleteTaskIconButton.tsx
Show resolved
Hide resolved
src/components/Contacts/ContactFlow/ContactFlowSetup/Row/ContactFlowSetupStatusRow.tsx
Outdated
Show resolved
Hide resolved
...ents/Contacts/ContactFlow/ContactFlowSetup/DragPreview/ContactFlowSetupDragPreviewStatus.tsx
Outdated
Show resolved
Hide resolved
return ( | ||
<DragLayerStatusBox width={width}> | ||
<Typography>{t(status)}</Typography> | ||
<Typography>{status}</Typography> |
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.
I haven't tried this one, but if it's anything like ContactFlowSetupStatusRow it needs to be wrapped in the t function.
<Typography>{status}</Typography> | |
<Typography>{t(status)}</Typography> |
@@ -58,7 +56,7 @@ export const ContactFlowSetupStatusRow: React.FC<Props> = ({ | |||
}, []); | |||
return ( | |||
<StatusRow {...{ ref: drag }} data-testid={status.id}> | |||
<Typography>{t(status.value)}</Typography> | |||
<Typography>{status.value}</Typography> |
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.
<Typography>{status.value}</Typography> | |
<Typography>{t(status.value)}</Typography> |
@@ -82,7 +82,7 @@ export const AddMenuPanel = (): ReactElement => { | |||
<LeafListItem key={index} disableGutters onClick={onClick}> | |||
<LeafButton style={style}> | |||
<Icon size={18} style={iconStyle} /> | |||
<Title>{t(text)}</Title> | |||
<Title>{text}</Title> |
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.
I guess this is so react i18 can pick up the phases to send to OneSky.
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.
While you're editing this file, is it worth to cleaning up lines 23, 24, 25 & 26 imports. Removing ../../../../../../
63d00d7
to
67042ae
Compare
@dr-bizz You are right about my changes to the navigation items and flows breaking things, so I went ahead and reverted them. Somehow those labels are manually in the translation files. While it would be ideal for all of our labels to be static strings, I don't want to break anything or spend too much more time on this. |
67042ae
to
061d682
Compare
codeCov is failing, but try merging main into this branch. that might help with the scores. |
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.
Awesome work! 🔥🔥
4920b5b
to
594621f
Compare
594621f
to
4305d6c
Compare
Description
Translation labels need to be static strings so that i18next can reliably extract them from our source code. We can't do
t(status)
,t(condition ? 'label1' : 'label2')
, ort(`Interpolated label with ${value}`)
.Checklist: