Skip to content

Commit a8a8ead

Browse files
committed
feat: 🌐 add some common strings for i18n
1 parent 6ab62f0 commit a8a8ead

File tree

6 files changed

+25
-3
lines changed

6 files changed

+25
-3
lines changed

packages/core/src/i18n/screens/common/en-US.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
import {Common} from './model';
2020

2121
export const common: Common = {
22+
'common.title': 'Sign In',
2223
copyright: '© {{currentYear}} WSO2 LLC.',
2324
error: 'Something went wrong. Please try again.',
25+
'multiple.options.prefix': 'Sign in with',
2426
or: 'OR',
2527
'prefix.register': "Don't have an account?",
2628
'privacy.policy': 'Privacy Policy',

packages/core/src/i18n/screens/common/fr-FR.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
import {Common} from './model';
2020

2121
export const common: Common = {
22+
'common.title': "S'identifier",
2223
copyright: '© {{currentYear}} WSO2 LLC.',
2324
error: "Quelque chose s'est mal passé. Veuillez réessayer.",
25+
'multiple.options.prefix': 'Se connecter avec',
2426
or: 'OU',
2527
'prefix.register': "Vous n'avez pas de compte?",
2628
'privacy.policy': 'Politique de confidentialité',

packages/core/src/i18n/screens/common/model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
* Interface for the common text.
2121
*/
2222
export interface Common {
23+
'common.title': string;
2324
copyright: string;
2425
error: string;
26+
'multiple.options.prefix': string;
2527
or: string;
2628
'prefix.register': string;
2729
'privacy.policy': string;

packages/core/src/i18n/screens/keys.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@
2121
*/
2222
interface Keys {
2323
common: {
24+
common: {
25+
title: string;
26+
};
2427
copyright: string;
2528
error: string;
29+
multiple: {
30+
options: {
31+
prefix: string;
32+
};
33+
};
2634
or: string;
2735
prefix: {
2836
register: string;
@@ -121,8 +129,16 @@ interface Keys {
121129

122130
export const keys: Keys = {
123131
common: {
132+
common: {
133+
title: 'common.common.title',
134+
},
124135
copyright: 'common.copyright',
125136
error: 'common.error',
137+
multiple: {
138+
options: {
139+
prefix: 'common.multiple.options.prefix',
140+
},
141+
},
126142
or: 'common.or',
127143
prefix: {
128144
register: 'common.prefix.register',

packages/react/src/components/SignIn/SignIn.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
200200
<LoginOptionsBox
201201
isAuthLoading={authContext.isAuthLoading}
202202
socialName={authenticator.authenticator}
203-
displayName={displayName}
203+
displayName={`${t(keys.common.multiple.options.prefix)} ${displayName}`}
204204
handleOnClick={(): Promise<void> => handleAuthenticate(authenticator.authenticatorId)}
205205
key={authenticator.authenticatorId}
206206
/>,
@@ -286,7 +286,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
286286
return (
287287
<UISignIn.Paper className="asgardeo-multiple-options-paper">
288288
<UISignIn.Typography title className="multiple-otions-title">
289-
Sign In
289+
{t(keys.common.common.title)}
290290
</UISignIn.Typography>
291291
{!usernamePasswordAuthenticator && alert && (
292292
<UISignIn.Alert className="asgardeo-sign-in-alert" {...alert?.alertType}>

packages/react/src/components/SignIn/fragments/LoginOptionsBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const LoginOptionsBox = ({
5858
onClick={handleOnClick}
5959
disabled={isAuthLoading}
6060
>
61-
Sign In with {displayName}
61+
{displayName}
6262
</UISignIn.Button>
6363
);
6464

0 commit comments

Comments
 (0)