mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Remove all *.intl.json files. Move strings to the corresponding views. Implement custom command to build i18n/en.json file
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
{
|
||||
"accountsForDevelopers": "Ely.by Accounts for developers",
|
||||
"accountsAllowsYouYoUseOauth2": "Ely.by Accounts service provides users with a quick and easy-to-use way to login to your site, launcher or Minecraft server via OAuth2 authorization protocol. You can find more information about integration with Ely.by Accounts in {ourDocumentation}.",
|
||||
"ourDocumentation": "our documentation",
|
||||
"ifYouHaveAnyTroubles": "If you are experiencing difficulties, you can always use {feedback}. We'll surely help you.",
|
||||
"feedback": "feedback",
|
||||
"weDontKnowAnythingAboutYou": "We don't know anything about you yet.",
|
||||
"youMustAuthToBegin": "You have to authorize to start.",
|
||||
"authorization": "Authorization",
|
||||
"youDontHaveAnyApplication": "You don't have any app registered yet.",
|
||||
"shallWeStart": "Shall we start?",
|
||||
"addNew": "Add new",
|
||||
"yourApplications": "Your applications:",
|
||||
"countUsers": "{count, plural, =0 {No users} one {# user} other {# users}}",
|
||||
"ifYouSuspectingThatSecretHasBeenCompromised": "If you are suspecting that your Client Secret has been compromised, then you may want to reset it value. It'll cause recall of the all \"access\" and \"refresh\" tokens that have been issued. You can also recall all issued tokens without changing Client Secret.",
|
||||
"revokeAllTokens": "Revoke all tokens",
|
||||
"resetClientSecret": "Reset Client Secret",
|
||||
"delete": "Delete",
|
||||
"editDescription": "{icon} Edit description",
|
||||
"allRefreshTokensWillBecomeInvalid": "All \"refresh\" tokens will become invalid and after next authorization the user will get permissions prompt.",
|
||||
"appAndAllTokenWillBeDeleted": "Application and all associated tokens will be deleted.",
|
||||
"takeCareAccessTokensInvalidation": "Take care because \"access\" tokens won't be invalidated immediately.",
|
||||
"cancel": "Cancel",
|
||||
"continue": "Continue",
|
||||
"performing": "Performing…"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
import { defineMessages, FormattedMessage as Message } from 'react-intl';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
import { LinkButton } from 'app/components/ui/form';
|
||||
import { COLOR_GREEN, COLOR_BLUE } from 'app/components/ui';
|
||||
@ -8,12 +8,16 @@ import { ContactLink } from 'app/components/contact';
|
||||
import { OauthAppResponse } from 'app/services/api/oauth';
|
||||
|
||||
import styles from './applicationsIndex.scss';
|
||||
import messages from './ApplicationsIndex.intl.json';
|
||||
import cubeIcon from './icons/cube.svg';
|
||||
import loadingCubeIcon from './icons/loading-cube.svg';
|
||||
import toolsIcon from './icons/tools.svg';
|
||||
import ApplicationsList from './list';
|
||||
|
||||
const labels = defineMessages({
|
||||
addNew: 'Add new',
|
||||
authorization: 'Authorization',
|
||||
});
|
||||
|
||||
type Props = {
|
||||
clientId: string | null;
|
||||
resetClientId: () => void; // notify parent to remove clientId from current location.href
|
||||
@ -29,7 +33,7 @@ export default class ApplicationsIndex extends React.Component<Props> {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.welcomeContainer}>
|
||||
<Message {...messages.accountsForDevelopers}>
|
||||
<Message key="accountsForDevelopers" defaultMessage="Ely.by Accounts for developers">
|
||||
{(pageTitle: string) => (
|
||||
<h2 className={styles.welcomeTitle}>
|
||||
<Helmet title={pageTitle} />
|
||||
@ -40,11 +44,12 @@ export default class ApplicationsIndex extends React.Component<Props> {
|
||||
<div className={styles.welcomeTitleDelimiter} />
|
||||
<div className={styles.welcomeParagraph}>
|
||||
<Message
|
||||
{...messages.accountsAllowsYouYoUseOauth2}
|
||||
key="accountsAllowsYouYoUseOauth2"
|
||||
defaultMessage="Ely.by Accounts service provides users with a quick and easy-to-use way to login to your site, launcher or Minecraft server via OAuth2 authorization protocol. You can find more information about integration with Ely.by Accounts in {ourDocumentation}."
|
||||
values={{
|
||||
ourDocumentation: (
|
||||
<a href="https://docs.ely.by/en/oauth.html" target="_blank">
|
||||
<Message {...messages.ourDocumentation} />
|
||||
<Message key="ourDocumentation" defaultMessage="our documentation" />
|
||||
</a>
|
||||
),
|
||||
}}
|
||||
@ -52,11 +57,12 @@ export default class ApplicationsIndex extends React.Component<Props> {
|
||||
</div>
|
||||
<div className={styles.welcomeParagraph}>
|
||||
<Message
|
||||
{...messages.ifYouHaveAnyTroubles}
|
||||
key="ifYouHaveAnyTroubles"
|
||||
defaultMessage="If you are experiencing difficulties, you can always use {feedback}. We'll surely help you."
|
||||
values={{
|
||||
feedback: (
|
||||
<ContactLink>
|
||||
<Message {...messages.feedback} />
|
||||
<Message key="feedback" defaultMessage="feedback" />
|
||||
</ContactLink>
|
||||
),
|
||||
}}
|
||||
@ -104,17 +110,20 @@ function Loader({ noApps }: { noApps: boolean }) {
|
||||
>
|
||||
<div className={styles.emptyStateText}>
|
||||
<div>
|
||||
<Message {...messages.youDontHaveAnyApplication} />
|
||||
<Message
|
||||
key="youDontHaveAnyApplication"
|
||||
defaultMessage="You don't have any app registered yet."
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Message {...messages.shallWeStart} />
|
||||
<Message key="shallWeStart" defaultMessage="Shall we start?" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LinkButton
|
||||
to="/dev/applications/new"
|
||||
data-e2e="newApp"
|
||||
label={messages.addNew}
|
||||
label={labels.addNew}
|
||||
color={COLOR_GREEN}
|
||||
className={styles.emptyStateActionButton}
|
||||
/>
|
||||
@ -129,16 +138,16 @@ function Guest() {
|
||||
<img src={toolsIcon} className={styles.emptyStateIcon} />
|
||||
<div className={styles.emptyStateText}>
|
||||
<div>
|
||||
<Message {...messages.weDontKnowAnythingAboutYou} />
|
||||
<Message key="weDontKnowAnythingAboutYou" defaultMessage="We don't know anything about you yet." />
|
||||
</div>
|
||||
<div>
|
||||
<Message {...messages.youMustAuthToBegin} />
|
||||
<Message key="youMustAuthToBegin" defaultMessage="You have to authorize to start." />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LinkButton
|
||||
to="/login"
|
||||
label={messages.authorization}
|
||||
label={labels.authorization}
|
||||
color={COLOR_BLUE}
|
||||
className={styles.emptyStateActionButton}
|
||||
/>
|
||||
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"creatingApplication": "Creating an application",
|
||||
"website": "Web site",
|
||||
"minecraftServer": "Minecraft server",
|
||||
"toDisplayRegistrationFormChooseType": "To display registration form for a new application choose necessary type.",
|
||||
"applicationName": "Application name:",
|
||||
"appDescriptionWillBeAlsoVisibleOnOauthPage": "Application's description will be displayed at the authorization page too. It isn't a required field. In authorization process the value may be overridden.",
|
||||
"description": "Description:",
|
||||
"websiteLinkWillBeUsedAsAdditionalId": "Site's link is optional, but it can be used as an additional identifier of the application.",
|
||||
"websiteLink": "Website link:",
|
||||
"redirectUriLimitsAllowableBaseAddress": "Redirection URI (redirectUri) determines a base address, that user will be allowed to be redirected to after authorization. In order to improve security it's better to use the whole path instead of just a domain name. For example: https://example.com/oauth/ely.",
|
||||
"redirectUri": "Redirect URI:",
|
||||
"createApplication": "Create application",
|
||||
"serverName": "Server name:",
|
||||
"ipAddressIsOptionButPreferable": "IP address is optional, but is very preferable. It might become handy in case of we suddenly decide to play on your server with the entire band (=",
|
||||
"serverIp": "Server IP:",
|
||||
"youCanAlsoSpecifyServerSite": "You also can specify either server's site URL or its community in a social network.",
|
||||
"updatingApplication": "Updating an application",
|
||||
"updateApplication": "Update application"
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
import { FormattedMessage as Message, defineMessages } from 'react-intl';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
import { MessageDescriptor } from 'react-intl';
|
||||
import { OauthAppResponse } from 'app/services/api/oauth';
|
||||
@ -10,12 +10,22 @@ import { COLOR_GREEN } from 'app/components/ui';
|
||||
import { TYPE_APPLICATION, TYPE_MINECRAFT_SERVER } from 'app/components/dev/apps';
|
||||
import styles from 'app/components/profile/profileForm.scss';
|
||||
import logger from 'app/services/logger';
|
||||
import messages from './ApplicationForm.intl.json';
|
||||
|
||||
import ApplicationTypeSwitcher from './ApplicationTypeSwitcher';
|
||||
import WebsiteType from './WebsiteType';
|
||||
import MinecraftServerType from './MinecraftServerType';
|
||||
|
||||
const messages = defineMessages({
|
||||
website: 'Web site',
|
||||
minecraftServer: 'Minecraft server',
|
||||
|
||||
creatingApplication: 'Creating an application',
|
||||
createApplication: 'Create application',
|
||||
|
||||
updatingApplication: 'Updating an application',
|
||||
updateApplication: 'Update application',
|
||||
});
|
||||
|
||||
type TypeToForm = Record<
|
||||
ApplicationType,
|
||||
{
|
||||
@ -94,7 +104,10 @@ export default class ApplicationForm extends React.Component<{
|
||||
) : (
|
||||
<div className={styles.formRow}>
|
||||
<p className={styles.description}>
|
||||
<Message {...messages.toDisplayRegistrationFormChooseType} />
|
||||
<Message
|
||||
key="toDisplayRegistrationFormChooseType"
|
||||
defaultMessage="To display registration form for a new application choose necessary type."
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
@ -1,11 +1,18 @@
|
||||
import React, { ComponentType } from 'react';
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
import { FormattedMessage as Message, defineMessages } from 'react-intl';
|
||||
import { OauthAppResponse } from 'app/services/api/oauth';
|
||||
import { Input, FormModel } from 'app/components/ui/form';
|
||||
import { SKIN_LIGHT } from 'app/components/ui';
|
||||
import styles from 'app/components/profile/profileForm.scss';
|
||||
|
||||
import messages from './ApplicationForm.intl.json';
|
||||
const messages = defineMessages({
|
||||
serverName: 'Server name:',
|
||||
ipAddressIsOptionButPreferable:
|
||||
'IP address is optional, but is very preferable. It might become handy in case of we suddenly decide to play on your server with the entire band (=',
|
||||
serverIp: 'Server IP:',
|
||||
youCanAlsoSpecifyServerSite: "You also can specify either server's site URL or its community in a social network.",
|
||||
websiteLink: 'Website link:',
|
||||
});
|
||||
|
||||
interface Props {
|
||||
form: FormModel;
|
||||
|
@ -1,11 +1,22 @@
|
||||
import React, { ComponentType } from 'react';
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
import { defineMessages, FormattedMessage as Message } from 'react-intl';
|
||||
import { Input, TextArea, FormModel } from 'app/components/ui/form';
|
||||
import { OauthAppResponse } from 'app/services/api/oauth';
|
||||
import { SKIN_LIGHT } from 'app/components/ui';
|
||||
import styles from 'app/components/profile/profileForm.scss';
|
||||
|
||||
import messages from './ApplicationForm.intl.json';
|
||||
const messages = defineMessages({
|
||||
applicationName: 'Application name:',
|
||||
appDescriptionWillBeAlsoVisibleOnOauthPage:
|
||||
"Application's description will be displayed at the authorization page too. It isn't a required field. In authorization process the value may be overridden.",
|
||||
description: 'Description:',
|
||||
websiteLinkWillBeUsedAsAdditionalId:
|
||||
"Site's link is optional, but it can be used as an additional identifier of the application.",
|
||||
websiteLink: 'Website link:',
|
||||
redirectUriLimitsAllowableBaseAddress:
|
||||
"Redirection URI (redirectUri) determines a base address, that user will be allowed to be redirected to after authorization. In order to improve security it's better to use the whole path instead of just a domain name. For example: https://example.com/oauth/ely.",
|
||||
redirectUri: 'Redirect URI:',
|
||||
});
|
||||
|
||||
interface Props {
|
||||
form: FormModel;
|
||||
|
24
packages/app/components/dev/apps/list.intl.ts
Normal file
24
packages/app/components/dev/apps/list.intl.ts
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Extract this file to the level upper to keep the messages prefix. Will be resolved later.
|
||||
*/
|
||||
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
export default defineMessages({
|
||||
revokeAllTokens: 'Revoke all tokens',
|
||||
resetClientSecret: 'Reset Client Secret',
|
||||
delete: 'Delete',
|
||||
countUsers: '{count, plural, =0 {No users} one {# user} other {# users}}',
|
||||
editDescription: '{icon} Edit description',
|
||||
ifYouSuspectingThatSecretHasBeenCompromised:
|
||||
'If you are suspecting that your Client Secret has been compromised, then you may want to reset it value. It\'ll cause recall of the all "access" and "refresh" tokens that have been issued. You can also recall all issued tokens without changing Client Secret.',
|
||||
allRefreshTokensWillBecomeInvalid:
|
||||
'All "refresh" tokens will become invalid and after next authorization the user will get permissions prompt.',
|
||||
takeCareAccessTokensInvalidation: 'Take care because "access" tokens won\'t be invalidated immediately.',
|
||||
cancel: 'Cancel',
|
||||
performing: 'Performing…',
|
||||
continue: 'Continue',
|
||||
appAndAllTokenWillBeDeleted: 'Application and all associated tokens will be deleted.',
|
||||
yourApplications: 'Your applications:',
|
||||
addNew: 'Add new',
|
||||
});
|
@ -8,7 +8,7 @@ import { OauthAppResponse } from 'app/services/api/oauth';
|
||||
import Collapse from 'app/components/ui/collapse';
|
||||
|
||||
import styles from '../applicationsIndex.scss';
|
||||
import messages from '../ApplicationsIndex.intl.json';
|
||||
import messages from '../list.intl';
|
||||
|
||||
const ACTION_REVOKE_TOKENS = 'revoke-tokens';
|
||||
const ACTION_RESET_SECRET = 'reset-secret';
|
||||
|
@ -5,7 +5,7 @@ import { LinkButton } from 'app/components/ui/form';
|
||||
import { COLOR_GREEN } from 'app/components/ui';
|
||||
import { OauthAppResponse } from 'app/services/api/oauth';
|
||||
|
||||
import messages from '../ApplicationsIndex.intl.json';
|
||||
import messages from '../list.intl';
|
||||
import styles from '../applicationsIndex.scss';
|
||||
import ApplicationItem from './ApplicationItem';
|
||||
|
||||
|
Reference in New Issue
Block a user