Skip to content

Commit

Permalink
Merge pull request #5404 from espoon-voltti/no-translation-attributes
Browse files Browse the repository at this point in the history
Lisätään ohjeistuksia olla kääntämättä automaattisesti erisnimiä
  • Loading branch information
Joosakur authored Jul 26, 2024
2 parents 58fd237 + 3370537 commit 5d5ce3b
Show file tree
Hide file tree
Showing 45 changed files with 158 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ export default React.memo(function ApplicationCreation() {
>
<H1 noMargin>{t.applications.creation.title}</H1>
<Gap size="m" />
<H2 noMargin>{childName.getOrElse('')}</H2>
<H2 noMargin translate="no">
{childName.getOrElse('')}
</H2>
<Gap size="XL" />
<ExpandingInfo
data-qa="daycare-expanding-info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,16 @@ export default React.memo(function ChildApplicationsBlock({
}
}

const hasName = childName?.trim().length > 0

return (
<ContentArea opaque paddingVertical="L" data-qa={`child-${childId}`}>
<TitleContainer>
<ChildHeading data-qa={`title-applications-child-name-${childId}`}>
{childName?.trim() ? childName : t.applicationsList.namelessChild}
<ChildHeading
translate={hasName ? 'no' : undefined}
data-qa={`title-applications-child-name-${childId}`}
>
{hasName ? childName : t.applicationsList.namelessChild}
</ChildHeading>
<AddButton
text={t.applicationsList.newApplicationLink}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default React.memo(function Heading({
{transferApplication && ` (${t.applicationsList.transferApplication})`}
</H1>

<H2 data-qa="application-child-name-title">
<H2 data-qa="application-child-name-title" translate="no">
{firstName} {lastName}
</H2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export default React.memo(function ChildSubSection({
<AdaptiveFlex breakpoint="1060px">
<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.childFirstName}</Label>
<span>{formData.childFirstName}</span>
<span translate="no">{formData.childFirstName}</span>
</FixedSpaceColumn>
<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.childLastName}</Label>
<span>{formData.childLastName}</span>
<span translate="no">{formData.childLastName}</span>
</FixedSpaceColumn>
<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.childSSN}</Label>
Expand All @@ -57,7 +57,9 @@ export default React.memo(function ChildSubSection({
<Gap size="s" />
<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.homeAddress}</Label>
<span data-qa="child-street-address">{formData.childStreet}</span>
<span data-qa="child-street-address" translate="no">
{formData.childStreet}
</span>
</FixedSpaceColumn>
<Gap size="m" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export default React.memo(function GuardianSubSection({
<AdaptiveFlex breakpoint="1060px" horizontalSpacing="XL">
<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.guardianFirstName}</Label>
<span>{formData.guardianFirstName}</span>
<span translate="no">{formData.guardianFirstName}</span>
</FixedSpaceColumn>
<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.guardianLastName}</Label>
<span>{formData.guardianLastName}</span>
<span translate="no">{formData.guardianLastName}</span>
</FixedSpaceColumn>
<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.guardianSSN}</Label>
Expand All @@ -53,7 +53,7 @@ export default React.memo(function GuardianSubSection({

<FixedSpaceColumn spacing="xs">
<Label>{t.applications.editor.contactInfo.homeAddress}</Label>
<span>{formData.guardianHomeAddress}</span>
<span translate="no">{formData.guardianHomeAddress}</span>
</FixedSpaceColumn>

<Gap size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default React.memo(function OtherChildrenSubSection({
label={`${child.firstName || ''} ${child.lastName || ''}, ${
child.socialSecurityNumber || ''
}`}
translate="no"
checked={child.selected}
onChange={(checked) =>
updateFormData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default React.memo(function SiblingBasisSubSection({
key={sibling.socialSecurityNumber}
checked={sibling.selected}
label={`${sibling.firstName} ${sibling.lastName}, ${sibling.socialSecurityNumber}`}
translate="no"
onChange={() =>
updateFormData((prev) => ({
vtjSiblings: prev.vtjSiblings.map((s) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default React.memo(function BasicsSection({

return (
<div>
<H2>
<H2 translate="no">
{formData.contactInfo.childFirstName}{' '}
{formData.contactInfo.childLastName}
</H2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default React.memo(function ContactInfoSecondGuardian({
<span>{formData.otherGuardianPhone}</span>

<Label>{tLocal.secondGuardian.email}</Label>
<span>{formData.otherGuardianEmail}</span>
<span translate="no">{formData.otherGuardianEmail}</span>
</ListGrid>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ export default React.memo(function ContactInfoSection({
columnGap="L"
>
<Label>{tLocal.child.name}</Label>
<span>
<span translate="no">
{formData.childFirstName} {formData.childLastName}
</span>

<Label>{tLocal.child.ssn}</Label>
<span>{formData.childSSN}</span>

<Label>{tLocal.child.streetAddress}</Label>
<span>{formData.childStreet}</span>
<span translate="no">{formData.childStreet}</span>

<Label>{tLocal.child.isAddressChanging}</Label>
<span>
Expand All @@ -76,7 +76,7 @@ export default React.memo(function ContactInfoSection({
<span>{formData.childMoveDate?.format()}</span>

<Label>{tLocal.child.newAddress}</Label>
<span>
<span translate="no">
{formData.childFutureStreet} {formData.childFuturePostalCode}{' '}
{formData.childFuturePostOffice}
</span>
Expand All @@ -93,13 +93,13 @@ export default React.memo(function ContactInfoSection({
columnGap="L"
>
<Label>{tLocal.guardian.name}</Label>
<span>
<span translate="no">
{formData.guardianFirstName} {formData.guardianLastName}
</span>
<Label>{tLocal.guardian.tel}</Label>
<span>{formData.guardianPhone}</span>
<Label>{tLocal.guardian.email}</Label>
<span>{formData.guardianEmail}</span>
<span translate="no">{formData.guardianEmail}</span>
<Label>{tLocal.guardian.streetAddress}</Label>
<span>{formData.guardianHomeAddress}</span>

Expand All @@ -116,7 +116,7 @@ export default React.memo(function ContactInfoSection({
<span>{formData.guardianMoveDate?.format()}</span>

<Label>{tLocal.guardian.newAddress}</Label>
<span>
<span translate="no">
{formData.guardianFutureStreet}{' '}
{formData.guardianFuturePostalCode}{' '}
{formData.guardianFuturePostOffice}
Expand Down Expand Up @@ -144,7 +144,7 @@ export default React.memo(function ContactInfoSection({
columnGap="L"
>
<Label>{tLocal.fridgePartner.name}</Label>
<span>
<span translate="no">
{formData.otherPartnerFirstName}{' '}
{formData.otherPartnerLastName}
</span>
Expand All @@ -168,7 +168,7 @@ export default React.memo(function ContactInfoSection({
columnGap="L"
>
<Label>{tLocal.fridgeChildren.name}</Label>
<span>
<span translate="no">
{firstName} {lastName}
</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default React.memo(function UnitPreferenceSection({
<span>{tLocal.siblingBasis.siblingBasisYes}</span>

<Label>{tLocal.siblingBasis.name}</Label>
<span>{sibling?.name}</span>
<span translate="no">{sibling?.name}</span>

<Label>{tLocal.siblingBasis.ssn}</Label>
<span>{sibling?.ssn}</span>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/citizen-frontend/calendar/AbsenceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export default React.memo(function AbsenceModal({
? ` ${duplicateChildInfo[child.id]}`
: ''
}`}
translate="no"
selected={selectedChildren.state.includes(child.id)}
onChange={(selected) =>
selectedChildren.update((prev) =>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/citizen-frontend/calendar/DayView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ const DayModal = React.memo(function DayModal({
spacing="zero"
justifyContent="center"
>
<H2 noMargin data-qa="child-name">
<H2 noMargin data-qa="child-name" translate="no">
{`${formatFirstName(row)} ${row.lastName}`}
</H2>
{row.duplicateInfo !== undefined && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export default React.memo(function ReservationModal({
? ` ${duplicateChildInfo[child.id]}`
: ''
}`}
translate="no"
selected={selectedChildren.state.includes(child.id)}
onChange={(selected) => {
selectedChildren.update((prev) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default React.memo(function DiscussionReservationModal({
<H2>{eventData?.title}</H2>
<p>{eventData?.description}</p>
<H3>{t.reservationChildTitle}</H3>
<StaticChip color={colors.main.m1}>
<StaticChip color={colors.main.m1} translate="no">
{childData ? formatFirstName(childData) : ''}
</StaticChip>
</WordBreakContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const DiscussionChildElement = React.memo(function DiscussionChildElement({
}: DiscussionChildElementProps) {
return (
<div data-qa={`discussion-child-${childWithSurveys.childId}`}>
<StaticChip color={colors.main.m1}>
<StaticChip color={colors.main.m1} translate="no">
{formatFirstName(childWithSurveys)}
</StaticChip>
{childWithSurveys.surveys.map((s) => {
Expand Down Expand Up @@ -313,14 +313,14 @@ const ChildSurveyElement = React.memo(function ChildSurveyElement({
<div data-qa={`reservation-${r.id}`}>
{r.date.isBefore(today) ? (
<Light>
{`${r.date.format('EEEEEE d.M.', lang)}
${i18n.calendar.discussionTimeReservation.timePreDescriptor}
{`${r.date.format('EEEEEE d.M.', lang)}
${i18n.calendar.discussionTimeReservation.timePreDescriptor}
${r.startTime.format()} - ${r.endTime.format()}`}
</Light>
) : (
<Bold>
{`${r.date.format('EEEEEE d.M.', lang)}
${i18n.calendar.discussionTimeReservation.timePreDescriptor}
{`${r.date.format('EEEEEE d.M.', lang)}
${i18n.calendar.discussionTimeReservation.timePreDescriptor}
${r.startTime.format()} - ${r.endTime.format()}`}
</Bold>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default React.memo(function FixedPeriodSelectionModal({
key={child.id}
data-qa={`holiday-section-${child.id}`}
>
<H2>
<H2 translate="no">
{formatFirstName(child)}
{duplicateChildInfo[child.id] !== undefined
? ` ${duplicateChildInfo[child.id]}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const ChildDocumentView = React.memo(function ChildDocumentView({
<FixedSpaceRow justifyContent="space-between">
<FixedSpaceColumn>
<H1 noMargin>{document.template.name}</H1>
<H2 noMargin>
<H2 noMargin translate="no">
{document.child.firstName} {document.child.lastName}
{document.child.dateOfBirth
? ` (${document.child.dateOfBirth.format()})`
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/citizen-frontend/children/ChildHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default React.memo(function ChildHeader({
alt={t.children.childPicture}
/>
<div>
<H1 noMargin data-qa="child-name">
<H1 noMargin data-qa="child-name" translate="no">
{`${firstName} ${lastName}`}
</H1>
{group && <Title>{group.name}</Title>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const ServiceNeedTableMobile = ({ serviceNeeds }: ServiceNeedTableProps) => {
(lang === 'en' && serviceNeed.option?.nameEn) ||
''}
</FixedSpaceRow>
<FixedSpaceRow data-qa="service-need-unit">
<FixedSpaceRow data-qa="service-need-unit" translate="no">
{serviceNeed.unitName}
</FixedSpaceRow>
</FixedSpaceColumn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default React.memo(function StaticInfoSubsection({
return (
<FixedSpaceColumn spacing="xxs">
<Label>{t.name}</Label>
<div>
<div translate="no">
{basics.child.firstName} {basics.child.lastName}
</div>

Expand All @@ -42,7 +42,7 @@ export default React.memo(function StaticInfoSubsection({

<Label>{t.placements[type]}</Label>
{basics.placements?.map((p) => (
<div key={p.range.start.formatIso()}>
<div key={p.range.start.formatIso()} translate="no">
{p.unitName} ({p.groupName}) {p.range.start.format()} -{' '}
{p.range.end.isAfter(templateRange.end) ? '' : p.range.end.format()}
</div>
Expand All @@ -52,7 +52,7 @@ export default React.memo(function StaticInfoSubsection({

<Label>{t.guardians}</Label>
{basics.guardians.map((g) => (
<div key={g.id}>
<div key={g.id} translate="no">
{g.firstName} {g.lastName}
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function CitizenBasicsSection({
<Gap size="m" />

<Label>{t.name}</Label>
<div>
<div translate="no">
{basics.child.firstName} {basics.child.lastName}
</div>

Expand All @@ -60,7 +60,7 @@ export function CitizenBasicsSection({

<Label>{t.placements[type]}</Label>
{basics.placements?.map((p) => (
<div key={p.range.start.formatIso()}>
<div key={p.range.start.formatIso()} translate="no">
{p.unitName} ({p.groupName}) {p.range.start.format()} -{' '}
{p.range.end.isAfter(templateRange.end) ? '' : p.range.end.format()}
</div>
Expand All @@ -70,7 +70,7 @@ export function CitizenBasicsSection({

<Label>{t.guardians}</Label>
{basics.guardians.map((g) => (
<div key={g.id}>
<div key={g.id} translate="no">
{g.firstName} {g.lastName}
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function CitizenVasuHeader({
<HeaderSection opaque>
<Titles>
<H1 data-qa="template-name">{templateName}</H1>
<H2 data-qa="title-child-name">
<H2 data-qa="title-child-name" translate="no">
{firstName} {lastName}
</H2>
</Titles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,13 @@ export default React.memo(function DecisionResponse({
<Gap size="m" />
<ListGrid labelWidth="max-content" rowGap="s" columnGap="L">
<Label>{t.decisions.applicationDecisions.childName}</Label>
<span data-qa="decision-child-name">{childName}</span>
<span data-qa="decision-child-name" translate="no">
{childName}
</span>
<Label>{t.decisions.applicationDecisions.unit}</Label>
<span data-qa="decision-unit">{getUnitName()}</span>
<span data-qa="decision-unit" translate="no">
{getUnitName()}
</span>
<Label>{t.decisions.applicationDecisions.period}</Label>
<span data-qa="decision-period">
{startDate.format()} - {endDate.format()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ export default React.memo(function AssistanceDecision({
{selectedUnit !== null && (
<>
<Label>{t.decisions.assistanceDecisions.unit}</Label>
<span data-qa="selected-unit">{selectedUnit.name}</span>
<span data-qa="selected-unit" translate="no">
{selectedUnit.name}
</span>
</>
)}
<Label>{t.decisions.assistanceDecisions.decisionMade}</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export default React.memo(function AssistancePreschoolDecision({
<Label>{t.decisions.assistanceDecisions.validityPeriod}</Label>
<span data-qa="validity-period">{validityPeriod.format()}</span>
<Label>{t.decisions.assistanceDecisions.unit}</Label>
<span data-qa="selected-unit">{unitName}</span>
<span data-qa="selected-unit" translate="no">
{unitName}
</span>
<Label>{t.decisions.assistanceDecisions.decisionMade}</Label>
<span data-qa="decision-made">{decisionMade.format()}</span>
<Label>{t.decisions.assistanceDecisions.statusLabel}</Label>
Expand Down
Loading

0 comments on commit 5d5ce3b

Please sign in to comment.