From 85d1b74ac3bbd563c35a7212069b84f8d3a6bd99 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 18 Nov 2016 15:36:16 +0100 Subject: Adding german localization --- .../features/account/components/action_bar.jsx | 26 +++++++++++++++------- .../features/account/components/header.jsx | 3 ++- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'app/assets/javascripts/components/features/account') diff --git a/app/assets/javascripts/components/features/account/components/action_bar.jsx b/app/assets/javascripts/components/features/account/components/action_bar.jsx index f8d051439..cd01de2e2 100644 --- a/app/assets/javascripts/components/features/account/components/action_bar.jsx +++ b/app/assets/javascripts/components/features/account/components/action_bar.jsx @@ -2,7 +2,17 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; import ImmutablePropTypes from 'react-immutable-proptypes'; import DropdownMenu from '../../../components/dropdown_menu'; import { Link } from 'react-router'; -import { injectIntl, FormattedMessage, FormattedNumber } from 'react-intl'; +import { defineMessages, injectIntl, FormattedMessage, FormattedNumber } from 'react-intl'; + +const messages = defineMessages({ + mention: { id: 'account.mention', defaultMessage: 'Mention' }, + edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' }, + unblock: { id: 'account.unblock', defaultMessage: 'Unblock' }, + unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, + block: { id: 'account.block', defaultMessage: 'Block' }, + follow: { id: 'account.follow', defaultMessage: 'Follow' }, + block: { id: 'account.block', defaultMessage: 'Block' } +}); const outerStyle = { borderTop: '1px solid #363c4b', @@ -41,18 +51,18 @@ const ActionBar = React.createClass({ let menu = []; - menu.push({ text: intl.formatMessage({ id: 'account.mention', defaultMessage: 'Mention' }), action: this.props.onMention }); + menu.push({ text: intl.formatMessage(messages.mention), action: this.props.onMention }); if (account.get('id') === me) { - menu.push({ text: intl.formatMessage({ id: 'account.edit_profile', defaultMessage: 'Edit profile' }), href: '/settings/profile' }); + menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' }); } else if (account.getIn(['relationship', 'blocking'])) { - menu.push({ text: intl.formatMessage({ id: 'account.unblock', defaultMessage: 'Unblock' }), action: this.props.onBlock }); + menu.push({ text: intl.formatMessage(messages.unblock), action: this.props.onBlock }); } else if (account.getIn(['relationship', 'following'])) { - menu.push({ text: intl.formatMessage({ id: 'account.unfollow', defaultMessage: 'Unfollow' }), action: this.props.onFollow }); - menu.push({ text: intl.formatMessage({ id: 'account.block', defaultMessage: 'Block' }), action: this.props.onBlock }); + menu.push({ text: intl.formatMessage(messages.unfollow), action: this.props.onFollow }); + menu.push({ text: intl.formatMessage(messages.block), action: this.props.onBlock }); } else { - menu.push({ text: intl.formatMessage({ id: 'account.follow', defaultMessage: 'Follow' }), action: this.props.onFollow }); - menu.push({ text: intl.formatMessage({ id: 'account.block', defaultMessage: 'Block' }), action: this.props.onBlock }); + menu.push({ text: intl.formatMessage(messages.follow), action: this.props.onFollow }); + menu.push({ text: intl.formatMessage(messages.block), action: this.props.onBlock }); } return ( diff --git a/app/assets/javascripts/components/features/account/components/header.jsx b/app/assets/javascripts/components/features/account/components/header.jsx index 7a086c99a..b3e9e2a9f 100644 --- a/app/assets/javascripts/components/features/account/components/header.jsx +++ b/app/assets/javascripts/components/features/account/components/header.jsx @@ -2,6 +2,7 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; import ImmutablePropTypes from 'react-immutable-proptypes'; import emojify from '../../../emoji'; import escapeTextContentForBrowser from 'react/lib/escapeTextContentForBrowser'; +import { FormattedMessage } from 'react-intl'; const Header = React.createClass({ @@ -23,7 +24,7 @@ const Header = React.createClass({ } if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) { - info = Follows you + info = } const content = { __html: emojify(account.get('note')) }; -- cgit