Skip to content

Commit

Permalink
Improve localization of {els} string on Create Account page (#3912)
Browse files Browse the repository at this point in the history
Co-authored-by: Hailey <[email protected]>
  • Loading branch information
quiple and haileyok authored Oct 5, 2024
1 parent 1118fd6 commit 25e3c93
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 32 deletions.
83 changes: 52 additions & 31 deletions src/screens/Signup/StepInfo/Policies.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React, {ReactElement} from 'react'
import {View} from 'react-native'
import {ComAtprotoServerDescribeServer} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
Expand Down Expand Up @@ -42,43 +42,64 @@ export const Policies = ({
)
}

const els = []
if (tos) {
els.push(
<InlineLinkText
label={_(msg`Read the Bluesky Terms of Service`)}
key="tos"
to={tos}>
{_(msg`Terms of Service`)}
</InlineLinkText>,
let els: ReactElement
if (tos && pp) {
els = (
<Trans>
By creating an account you agree to the{' '}
<InlineLinkText
label={_(msg`Read the Bluesky Terms of Service`)}
key="tos"
to={tos}>
Terms of Service
</InlineLinkText>{' '}
and{' '}
<InlineLinkText
label={_(msg`Read the Bluesky Privacy Policy`)}
key="pp"
to={pp}>
Privacy Policy
</InlineLinkText>
.
</Trans>
)
}
if (pp) {
els.push(
<InlineLinkText
label={_(msg`Read the Bluesky Privacy Policy`)}
key="pp"
to={pp}>
{_(msg`Privacy Policy`)}
</InlineLinkText>,
} else if (tos) {
els = (
<Trans>
By creating an account you agree to the{' '}
<InlineLinkText
label={_(msg`Read the Bluesky Terms of Service`)}
key="tos"
to={tos}>
Terms of Service
</InlineLinkText>
.
</Trans>
)
}
if (els.length === 2) {
els.splice(
1,
0,
<Text key="and" style={[t.atoms.text_contrast_medium]}>
{' '}
and{' '}
</Text>,
} else if (pp) {
els = (
<Trans>
By creating an account you agree to the{' '}
<InlineLinkText
label={_(msg`Read the Bluesky Privacy Policy`)}
key="pp"
to={pp}>
Privacy Policy
</InlineLinkText>
.
</Trans>
)
} else {
return null
}

return (
<View style={[a.gap_sm]}>
<Text style={[a.leading_snug, t.atoms.text_contrast_medium]}>
<Trans>By creating an account you agree to the {els}.</Trans>
</Text>
{els ? (
<Text style={[a.leading_snug, t.atoms.text_contrast_medium]}>
{els}
</Text>
) : null}

{under13 ? (
<Text style={[a.font_bold, a.leading_snug, t.atoms.text_contrast_high]}>
Expand Down
3 changes: 2 additions & 1 deletion src/screens/Signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
<View
style={[a.w_full, a.py_lg, a.flex_row, a.gap_lg, a.align_center]}>
<AppLanguageDropdown />
<Text style={[t.atoms.text, !gtMobile && a.text_md]}>
<Text
style={[t.atoms.text_contrast_medium, !gtMobile && a.text_md]}>
<Trans>Having trouble?</Trans>{' '}
<InlineLinkText
label={_(msg`Contact support`)}
Expand Down

0 comments on commit 25e3c93

Please sign in to comment.