Skip to content

Commit

Permalink
chore(l10n): Migrated login
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Oct 28, 2023
1 parent ce9604e commit 07da9ef
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/locales/en-US/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ about-Page--available = Available in:
# Components that related to Account such as profile, hover card.

-edit-profile = Edit profile
account-Action--login = Sign in
account-Badge--admin = Admin
account-Badge--bot = Bot
account-Badge--moderator = Moderator
Expand Down
9 changes: 6 additions & 3 deletions src/soapbox/features/ui/components/cta-banner.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Localized } from '@fluent/react';
import React from 'react';
import { FormattedMessage } from 'react-intl';

Expand Down Expand Up @@ -27,9 +28,11 @@ const CtaBanner = () => {
</Stack>

<HStack space={2} alignItems='center'>
<Button theme='secondary' to='/login'>
<FormattedMessage id='account.login' defaultMessage='Log in' />
</Button>
<Localized id='account-Action--login'>
<Button theme='secondary' to='/login'>
Sign in
</Button>
</Localized>

<Button theme='accent' to='/signup'>
<FormattedMessage id='account.register' defaultMessage='Sign up' />
Expand Down
13 changes: 11 additions & 2 deletions src/soapbox/features/ui/components/modals/unauthorized-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Localized } from '@fluent/react';
import React, { useState } from 'react';
import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
import { useHistory } from 'react-router-dom';
Expand Down Expand Up @@ -103,7 +104,11 @@ const UnauthorizedModal: React.FC<IUnauthorizedModal> = ({ action, onClose, acco
title={header}
onClose={onClickClose}
confirmationAction={onLogin}
confirmationText={<FormattedMessage id='account.login' defaultMessage='Log in' />}
confirmationText={
<Localized id='account-Action--login'>
<span>Sign in</span>
</Localized>
}
secondaryAction={isOpen ? onRegister : undefined}
secondaryText={isOpen ? <FormattedMessage id='account.register' defaultMessage='Sign up' /> : undefined}
>
Expand Down Expand Up @@ -144,7 +149,11 @@ const UnauthorizedModal: React.FC<IUnauthorizedModal> = ({ action, onClose, acco
title={<FormattedMessage id='unauthorized_modal.title' defaultMessage='Sign up for {site_title}' values={{ site_title: instance.title }} />}
onClose={onClickClose}
confirmationAction={onLogin}
confirmationText={<FormattedMessage id='account.login' defaultMessage='Log in' />}
confirmationText={
<Localized id='account-Action--login'>
<span>Sign in</span>
</Localized>
}
secondaryAction={isOpen ? onRegister : undefined}
secondaryText={isOpen ? <FormattedMessage id='account.register' defaultMessage='Sign up' /> : undefined}
>
Expand Down
9 changes: 6 additions & 3 deletions src/soapbox/features/ui/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Localized } from '@fluent/react';
import clsx from 'clsx';
import React, { useRef, useState } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
Expand Down Expand Up @@ -146,9 +147,11 @@ const Navbar = () => {
</Form>

<div className='space-x-1.5 lg:hidden'>
<Button theme='tertiary' to='/login' size='sm'>
<FormattedMessage id='account.login' defaultMessage='Log In' />
</Button>
<Localized id='account-Action--login'>
<Button theme='tertiary' to='/login' size='sm'>
Sign in
</Button>
</Localized>

{isOpen && (
<Button theme='primary' to='/signup' size='sm'>
Expand Down
1 change: 0 additions & 1 deletion src/soapbox/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"account.login": "Log in",
"account.media": "Media",
"account.member_since": "Joined {date}",
"account.mention": "Mention",
Expand Down

0 comments on commit 07da9ef

Please sign in to comment.