Basic functionality for locale change. Draft implementation of tools for working with i18n

This commit is contained in:
SleepWalker
2016-05-08 22:28:51 +03:00
parent 8db3c36261
commit 4f5f18d787
18 changed files with 491 additions and 108 deletions

View File

@@ -8,7 +8,7 @@ import buttons from 'components/ui/buttons.scss';
import { Input } from 'components/ui/form';
import BaseAuthBody from 'components/auth/BaseAuthBody';
import passwordMessages from 'components/auth/password/Password.messages';
import passwordMessages from 'components/auth/password/Password.intl.json';
import messages from './Login.messages';
class Body extends BaseAuthBody {

View File

@@ -0,0 +1,10 @@
{
"passwordTitle": "Enter password",
"signInButton": "Sign in",
"invalidPassword": "You entered wrong account password.",
"suggestResetPassword": "Are you have {link}?",
"forgotYourPassword": "forgot your password",
"forgotPassword": "Forgot password",
"accountPassword": "Account password",
"rememberMe": "Remember me on this device"
}

View File

@@ -10,7 +10,7 @@ import { Input, Checkbox } from 'components/ui/form';
import BaseAuthBody from 'components/auth/BaseAuthBody';
import styles from './password.scss';
import messages from './Password.messages';
import messages from './Password.intl.json';
class Body extends BaseAuthBody {
static displayName = 'PasswordBody';

View File

@@ -1,43 +0,0 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
passwordTitle: {
id: 'passwordTitle',
defaultMessage: 'Enter password'
},
signInButton: {
id: 'signInButton',
defaultMessage: 'Sign in'
},
invalidPassword: {
id: 'invalidPassword',
defaultMessage: 'You entered wrong account password.'
},
suggestResetPassword: {
id: 'suggestResetPassword',
defaultMessage: 'Are you have {link}?'
},
forgotYourPassword: {
id: 'forgotYourPassword',
defaultMessage: 'forgot your password'
},
forgotPassword: {
id: 'forgotPassword',
defaultMessage: 'Forgot password'
},
accountPassword: {
id: 'accountPassword',
defaultMessage: 'Account password'
},
rememberMe: {
id: 'rememberMe',
defaultMessage: 'Remember me on this device'
}
});

View File

@@ -7,6 +7,7 @@ import buttons from 'components/ui/buttons.scss';
import { Input, Checkbox } from 'components/ui/form';
import BaseAuthBody from 'components/auth/BaseAuthBody';
import passwordMessages from 'components/auth/password/Password.intl.json';
import activationMessages from 'components/auth/activation/Activation.messages';
import messages from './Register.messages';
@@ -44,7 +45,7 @@ class Body extends BaseAuthBody {
color="blue"
type="password"
required
placeholder={messages.accountPassword}
placeholder={passwordMessages.accountPassword}
/>
<Input {...this.bindField('rePassword')}

View File

@@ -0,0 +1,10 @@
{
"changePasswordTitle": "Change password",
"changePasswordDescription": "Please take a password, that will be different from your passwords on the other sites and will not be the same you are using to enter Minecraft game servers you are playing.",
"achievementLossWarning": "Are you cherish your game achievements, right?",
"passwordRequirements": "Password must contain at least 8 characters. It can be any symbols — do not limit yourself, create an unpredictable password!",
"changePasswordButton": "Change password",
"newPasswordLabel": "New password:",
"repeatNewPasswordLabel": "Repeat the password:",
"logoutOnAllDevices": "Logout on all devices"
}

View File

@@ -7,7 +7,7 @@ import Helmet from 'react-helmet';
import { Input, Button, Checkbox, Form, FormModel } from 'components/ui/form';
import styles from 'components/profile/profileForm.scss';
import messages from './ChangePassword.messages';
import messages from './ChangePassword.intl.json';
export default class ChangePassword extends Component {
static displayName = 'ChangePassword';

View File

@@ -1,43 +0,0 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
changePasswordTitle: {
id: 'changePasswordTitle',
defaultMessage: 'Change password'
// defaultMessage: 'Смена пароля'
},
changePasswordDescription: {
id: 'changePasswordDescription',
defaultMessage: 'Please take a password, that will be different from your passwords on the other sites and will not be the same you are using to enter Minecraft game servers you are playing.'
// defaultMessage: 'Придумайте пароль, который будет отличаться от ваших паролей на других сайтах и не будет совпадаеть с тем паролем, который вы используете для входа на различные игровые сервера Minecraft.'
},
achievementLossWarning: {
id: 'achievementLossWarning',
defaultMessage: 'Are you cherish your game achievements, right?'
// defaultMessage: 'Вы ведь дорожите своими игровыми достижениями?'
},
passwordRequirements: {
id: 'passwordRequirements',
defaultMessage: 'Password must contain at least 8 characters. It can be any symbols — do not limit yourself, create an unpredictable password!'
// defaultMessage: 'Пароль должен содержать не менее 8 символов. Это могут быть любым символы — не ограничивайте себя, придумайте непредсказуемый пароль!'
},
changePasswordButton: {
id: 'changePasswordButton',
defaultMessage: 'Change password'
// defaultMessage: 'Сменить пароль'
},
newPasswordLabel: {
id: 'newPasswordLabel',
defaultMessage: 'New password:'
// defaultMessage: 'Новый пароль:'
},
repeatNewPasswordLabel: {
id: 'repeatNewPasswordLabel',
defaultMessage: 'Repeat the password:'
// defaultMessage: 'Повторите указанный пароль:'
},
logoutOnAllDevices: {
id: 'logoutOnAllDevices',
defaultMessage: 'Logout on all devices'
}
});

View File

@@ -22,6 +22,7 @@ export default class User {
username: '',
email: '',
avatar: '',
lang: '',
goal: null, // the goal with wich user entered site
isGuest: true,
isActive: true,