mirror of
				https://github.com/elyby/accounts-frontend.git
				synced 2025-05-31 14:11:58 +05:30 
			
		
		
		
	Переводы профиля
This commit is contained in:
		| @@ -1,12 +1,13 @@ | |||||||
| import React, { Component } from 'react'; | import React, { Component } from 'react'; | ||||||
|  |  | ||||||
| import { FormattedMessage as Message, FormattedRelative as Relative } from 'react-intl'; | import { FormattedMessage as Message, FormattedRelative as Relative, FormattedHTMLMessage as HTMLMessage } from 'react-intl'; | ||||||
| import Helmet from 'react-helmet'; | import Helmet from 'react-helmet'; | ||||||
|  |  | ||||||
| import { userShape } from 'components/user/User'; | import { userShape } from 'components/user/User'; | ||||||
|  |  | ||||||
| import ProfileField from './ProfileField'; | import ProfileField from './ProfileField'; | ||||||
| import styles from './profile.scss'; | import styles from './profile.scss'; | ||||||
|  | import messages from './Profile.messages'; | ||||||
|  |  | ||||||
| export class Profile extends Component { | export class Profile extends Component { | ||||||
|     static displayName = 'Profile'; |     static displayName = 'Profile'; | ||||||
| @@ -17,36 +18,36 @@ export class Profile extends Component { | |||||||
|     render() { |     render() { | ||||||
|         const { user } = this.props; |         const { user } = this.props; | ||||||
|  |  | ||||||
|         const pageTitle = 'Настройки аккаунта Ely.by'; |  | ||||||
|  |  | ||||||
|         return ( |         return ( | ||||||
|             <div className={styles.container}> |             <div className={styles.container}> | ||||||
|                 <Helmet title={pageTitle} /> |                 <Message {...messages.accountPreferencesTitle}> | ||||||
|                 <h2 className={styles.title}> |                     {(pageTitle) => ( | ||||||
|                     {pageTitle} |                         <h2 className={styles.title}> | ||||||
|                 </h2> |                             <Helmet title={pageTitle} /> | ||||||
|  |                             {pageTitle} | ||||||
|  |                         </h2> | ||||||
|  |                     )} | ||||||
|  |                 </Message> | ||||||
|  |  | ||||||
|                 <div className={styles.content}> |                 <div className={styles.content}> | ||||||
|                     <div className={styles.description}> |                     <div className={styles.description}> | ||||||
|                         Благодаря аккаунту Ely.by вы можете получить доступ ко многим ресурсам, связанным с Minecraft. |                         <Message {...messages.accountDescription} /> | ||||||
|                         Берегите свой аккаунт, используйте надёжный пароль и регулярно его меняйте. |  | ||||||
|                     </div> |                     </div> | ||||||
|  |  | ||||||
|                     <div className={styles.options}> |                     <div className={styles.options}> | ||||||
|                         <div className={styles.item}> |                         <div className={styles.item}> | ||||||
|                             <h3 className={styles.optionsTitle}> |                             <h3 className={styles.optionsTitle}> | ||||||
|                                 Персональные данные |                                 <Message {...messages.personalData} /> | ||||||
|                             </h3> |                             </h3> | ||||||
|                             <p className={styles.optionsDescription}> |                             <p className={styles.optionsDescription}> | ||||||
|                                 Здесь вы можете сменить ключевые параметры вашего аккаунта. Обратите внимание, что для |                                 <Message {...messages.preferencesDescription} /> | ||||||
|                                 всех действий необходимо подтверждение при помощи ввода пароля. |  | ||||||
|                             </p> |                             </p> | ||||||
|                         </div> |                         </div> | ||||||
|  |  | ||||||
|                         <ProfileField |                         <ProfileField | ||||||
|                             label={'Ник'} |                             label={<Message {...messages.nickname} />} | ||||||
|                             value={user.username} |                             value={user.username} | ||||||
|                             warningMessage={'Найден аккаунт Mojang с таким же ником и, по правилам проекта, его владелец вправе потребовать восстановления контроля над ником.'} |                             warningMessage={<Message {...messages.mojangPriorityWarning} />} | ||||||
|                         /> |                         /> | ||||||
|  |  | ||||||
|                         <ProfileField |                         <ProfileField | ||||||
| @@ -55,19 +56,18 @@ export class Profile extends Component { | |||||||
|                         /> |                         /> | ||||||
|  |  | ||||||
|                         <ProfileField |                         <ProfileField | ||||||
|                             label={'Пароль'} |                             label={<Message {...messages.password} />} | ||||||
|                             value={<span>Изменён <Relative value={user.passwordChangedAt * 1000} /></span>} |                             value={<Message {...messages.changedAt} values={{ | ||||||
|  |                                 at: (<Relative value={user.passwordChangedAt * 1000} />) | ||||||
|  |                             }} />} | ||||||
|                             warningMessage={user.shouldChangePassword ? ( |                             warningMessage={user.shouldChangePassword ? ( | ||||||
|                                 <span> |                                 <HTMLMessage {...messages.oldHashingAlgoWarning} /> | ||||||
|                                     Для пароля применяется старый алгоритм хэширования<br /> |  | ||||||
|                                     Пожалуйста, смените пароль. |  | ||||||
|                                 </span> |  | ||||||
|                             ) : ''} |                             ) : ''} | ||||||
|                         /> |                         /> | ||||||
|  |  | ||||||
|                         <ProfileField |                         <ProfileField | ||||||
|                             label={'Двухфакторная аутентификация'} |                             label={<Message {...messages.twoFactorAuth} />} | ||||||
|                             value={'Не включена'} |                             value={<Message {...messages.disabled} />} | ||||||
|                         /> |                         /> | ||||||
|  |  | ||||||
|                         <ProfileField |                         <ProfileField | ||||||
|   | |||||||
							
								
								
									
										59
									
								
								src/components/profile/Profile.messages.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								src/components/profile/Profile.messages.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | |||||||
|  | import { defineMessages } from 'react-intl'; | ||||||
|  |  | ||||||
|  | export default defineMessages({ | ||||||
|  |     accountPreferencesTitle: { | ||||||
|  |         id: 'accountPreferencesTitle', | ||||||
|  |         defaultMessage: 'Ely.by account preferences' | ||||||
|  |         // defaultMessage: 'Настройки аккаунта Ely.by' | ||||||
|  |     }, | ||||||
|  |     personalData: { | ||||||
|  |         id: 'personalData', | ||||||
|  |         defaultMessage: 'Personal data' | ||||||
|  |         // defaultMessage: 'Персональные данные' | ||||||
|  |     }, | ||||||
|  |     accountDescription: { | ||||||
|  |         id: 'accountDescription', | ||||||
|  |         defaultMessage: 'Ely.by account allows you to get access to many Minecraft resources. Please, take care of your account safety. Use secure password and change it regularly.' | ||||||
|  |         // defaultMessage: 'Благодаря аккаунту Ely.by вы можете получить доступ ко многим ресурсам, связанным с Minecraft. Берегите свой аккаунт, используйте надёжный пароль и регулярно его меняйте.' | ||||||
|  |     }, | ||||||
|  |     preferencesDescription: { | ||||||
|  |         id: 'preferencesDescription', | ||||||
|  |         defaultMessage: 'Here you can change the key preferences of your account. Please note that all actions must be confirmed by entering a password.' | ||||||
|  |         // defaultMessage: 'Здесь вы можете сменить ключевые параметры вашего аккаунта. Обратите внимание, что для всех действий необходимо подтверждение при помощи ввода пароля.' | ||||||
|  |     }, | ||||||
|  |     mojangPriorityWarning: { | ||||||
|  |         id: 'mojangPriorityWarning', | ||||||
|  |         defaultMessage: 'A Mojang account with the same nickname was found. According to project rules, account owner has the right to demand the restoration of control over nickname.' | ||||||
|  |         // defaultMessage: 'Найден аккаунт Mojang с таким же ником и, по правилам проекта, его владелец вправе потребовать восстановления контроля над ником.' | ||||||
|  |     }, | ||||||
|  |     oldHashingAlgoWarning: { | ||||||
|  |         id: 'oldHashingAlgoWarning', | ||||||
|  |         defaultMessage: 'Your was hashed with an old hashing algorithm.<br />Please, change password.' | ||||||
|  |         // defaultMessage: 'Для пароля применяется старый алгоритм хэширования<br />Пожалуйста, смените пароль.' | ||||||
|  |     }, | ||||||
|  |     changedAt: { | ||||||
|  |         id: 'changedAt', | ||||||
|  |         defaultMessage: 'Changed {at}' | ||||||
|  |         // defaultMessage: 'Изменен {at}' | ||||||
|  |     }, | ||||||
|  |     disabled: { | ||||||
|  |         id: 'disabled', | ||||||
|  |         defaultMessage: 'Disabled' | ||||||
|  |         // defaultMessage: 'Не включена' | ||||||
|  |     }, | ||||||
|  |     nickname: { | ||||||
|  |         id: 'nickname', | ||||||
|  |         defaultMessage: 'Nickname' | ||||||
|  |         // defaultMessage: 'Ник' | ||||||
|  |     }, | ||||||
|  |     password: { | ||||||
|  |         id: 'password', | ||||||
|  |         defaultMessage: 'Password' | ||||||
|  |         // defaultMessage: 'Пароль' | ||||||
|  |     }, | ||||||
|  |     twoFactorAuth: { | ||||||
|  |         id: 'twoFactorAuth', | ||||||
|  |         defaultMessage: 'Two factor auth' | ||||||
|  |         // defaultMessage: 'Двухфакторная аутентификация' | ||||||
|  |     } | ||||||
|  | }); | ||||||
| @@ -5,7 +5,7 @@ import styles from './profile.scss'; | |||||||
| export default class ProfileField extends Component { | export default class ProfileField extends Component { | ||||||
|     static displayName = 'ProfileField'; |     static displayName = 'ProfileField'; | ||||||
|     static propTypes = { |     static propTypes = { | ||||||
|         label: PropTypes.string.isRequired, |         label: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired, | ||||||
|         value: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired, |         value: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired, | ||||||
|         warningMessage: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]), |         warningMessage: React.PropTypes.oneOfType([PropTypes.string, PropTypes.element]), | ||||||
|         readonly: PropTypes.bool |         readonly: PropTypes.bool | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user