Merge pull request #354 from esteemapp/bugfix/ru-lang

General update added ru language
This commit is contained in:
uğur erdal 2019-01-07 11:15:50 +03:00 committed by GitHub
commit c69a48dca1
15 changed files with 57 additions and 34 deletions

View File

@ -1,6 +1,6 @@
import React, { Component, Fragment } from 'react';
import {
View, Text, TextInput, ActivityIndicator, SafeAreaView,
View, Text, ActivityIndicator, SafeAreaView,
} from 'react-native';
import { injectIntl } from 'react-intl';
@ -8,6 +8,7 @@ import { injectIntl } from 'react-intl';
import { TextButton } from '../..';
import { IconButton } from '../../iconButton';
import { DropdownButton } from '../../dropdownButton';
import { TextInput } from '../../textInput';
// Constants
// Styles
@ -153,6 +154,7 @@ class BasicHeaderView extends Component {
placeholder={intl.formatMessage({
id: 'basic_header.search',
})}
placeholderTextColor="#c1c5c7"
autoCapitalize="none"
style={styles.textInput}
/>
@ -161,10 +163,11 @@ class BasicHeaderView extends Component {
{isHasSearch && (
<IconButton
style={styles.rightIcon}
size={25}
size={22}
onPress={() => this._handleSearchButtonPress()}
iconStyle={styles.rightIcon}
name={rightIconName}
iconType="MaterialIcons"
name={isInputVisible ? 'close' : 'search'}
/>
)}
</View>

View File

@ -12,7 +12,7 @@ import { default as ROUTES } from '../../../constants/routeNames';
// Utilities
// Component
import LeaderboardView from '../view/leaderboardView';
import LeaderboardView from '../view/leaderBoardView';
/*
* Props Name Description Value

View File

@ -2,16 +2,15 @@ import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
container: {
flex: 1,
padding: 8,
flexDirection: 'row',
height: '$deviceHeight - 100',
backgroundColor: '$primaryBackgroundColor',
},
title: {
color: '$iconColor',
text: {
color: '$primaryDarkGray',
fontSize: 14,
fontFamily: '$primaryFont',
fontWeight: 'bold',
marginLeft: 16,
marginLeft: 20,
fontFamily: '$primaryFont',
paddingBottom: 10,
},
});

View File

@ -1,5 +1,6 @@
import React, { PureComponent } from 'react';
import { View, FlatList } from 'react-native';
import { View, FlatList, Text } from 'react-native';
import { injectIntl } from 'react-intl';
// Constants
@ -35,10 +36,15 @@ class LeaderboardView extends PureComponent {
};
render() {
const { users } = this.props;
const { users, intl } = this.props;
return (
<View style={styles.container}>
<Text style={styles.text}>
{intl.formatMessage({
id: 'notification.leaderboard_title',
})}
</Text>
<FlatList
data={users}
keyExtractor={item => item.voter}
@ -50,4 +56,4 @@ class LeaderboardView extends PureComponent {
}
}
export default LeaderboardView;
export default injectIntl(LeaderboardView);

View File

@ -25,6 +25,13 @@ class NotificationLineView extends PureComponent {
}
// Component Life Cycles
componentWillReceiveProps(nextProps) {
const { isRead } = this.props;
if (isRead !== nextProps.isRead) {
this.setState({ isRead: nextProps.isRead });
}
}
// Component Functions
_handleOnNotificationPress = () => {

View File

@ -18,10 +18,19 @@ const DEFAULT_IMAGE = require('../../../../assets/esteem.png');
class PostHeaderDescription extends PureComponent {
constructor(props) {
super(props);
this.state = {};
this.state = {
reblogedBy: props.reblogedBy || null,
};
}
// Component Life Cycles
componentWillReceiveProps(nextProps) {
const { reblogedBy } = this.props;
if (reblogedBy !== nextProps.reblogedBy && !nextProps.reblogedBy) {
this.setState({ reblogedBy });
}
}
// Component Functions
_handleOnUserPress = (username) => {
@ -43,16 +52,9 @@ class PostHeaderDescription extends PureComponent {
render() {
const {
avatar,
date,
isHideImage,
name,
reblogedBy,
reputation,
size,
tag,
tagOnPress,
avatar, date, isHideImage, name, reputation, size, tag, tagOnPress,
} = this.props;
const { reblogedBy } = this.state;
const _reputationText = `(${reputation})`;
let _avatar;
@ -85,7 +87,9 @@ class PostHeaderDescription extends PureComponent {
</TouchableOpacity>
)}
<Text style={styles.date}>{date}</Text>
{!!reblogedBy && <TextWithIcon text={reblogedBy} iconType="MaterialIcons" iconName="repeat" />}
{!!reblogedBy && (
<TextWithIcon text={reblogedBy} iconType="MaterialIcons" iconName="repeat" />
)}
</View>
);
}

View File

@ -134,6 +134,8 @@ class UpvoteView extends Component {
const _percent = `${(sliderValue * 100).toFixed(0)}%`;
const _amount = `$${amount}`;
const _totalPayout = totalPayout ? totalPayout : '0.000';
return (
<PopoverController>
{({
@ -167,8 +169,8 @@ class UpvoteView extends Component {
name={iconName}
/>
)}
{isShowPayoutValue && totalPayout && (
<Text style={[styles.payoutValue, isDecinedPayout && styles.declinedPayout]}>{`$${totalPayout}`}</Text>
{isShowPayoutValue && (
<Text style={[styles.payoutValue, isDecinedPayout && styles.declinedPayout]}>{`$${_totalPayout}`}</Text>
)}
</Fragment>
</TouchableOpacity>

View File

@ -22,6 +22,7 @@
"comingsoon": "Leaderboard feature is coming soon!",
"notification": "Notifications",
"leaderboard": "Leaderboard",
"leaderboard_title": "Daily Top User",
"recent": "Recent",
"yesterday": "Yesterday",
"this_week": "This Week",

View File

@ -21,7 +21,8 @@
"reblog": "сделал репост",
"comingsoon": "Доска Лидерства будет здесь!",
"notification": "Уведомления",
"leaderboard": "Доска Лидерства",
"leaderboard": "Лидеры",
"leaderboard_title": "Доска Лидерства",
"recent": "Недавно",
"yesterday": "Вчера",
"this_week": "На неделе",

View File

@ -24,6 +24,7 @@
"comingsoon": "Liderler tablosu yakında burada!",
"notification": "Bildirimler",
"leaderboard": "Liderler Tablosu",
"leaderboard_title": "Günlük lider kullanıcılar",
"recent": "Geçen",
"yesterday": "Dün",
"this_week": "Bu Hafta",

View File

@ -1,5 +1,5 @@
// export default ['English', 'Turkish', 'German', 'Spanish', 'Italian', 'Duch', 'Russian'];
export default ['English', 'Turkish'];
export default ['English', 'Turkish', 'Russian'];
export const VALUE = ['en-US', 'tr-TR'];
export const VALUE = ['en-US', 'tr-TR', 'ru-RU'];
// export const VALUE = ['en-US', 'tr-TR', 'gr', 'sp', 'it', 'dc', 'rs'];

View File

@ -9,6 +9,7 @@ import { NavigationActions } from 'react-navigation';
// Constants
import en from 'react-intl/locale-data/en';
import tr from 'react-intl/locale-data/tr';
import ru from 'react-intl/locale-data/ru';
// Services
import {
@ -50,7 +51,7 @@ import {
import ApplicationScreen from '../screen/applicationScreen';
import { Launch } from '../..';
addLocaleData([...en, ...tr]);
addLocaleData([...en, ...tr, ...ru]);
class ApplicationContainer extends Component {
constructor() {

View File

@ -69,7 +69,6 @@ class FollowsScreen extends PureComponent {
<View style={styles.container}>
<BasicHeader
title={headerTitle}
rightIconName="ios-search"
isHasSearch
handleOnSearch={handleSearch}
/>

View File

@ -77,7 +77,6 @@ class VotersScreen extends PureComponent {
<View style={globalStyles.container}>
<BasicHeader
title={`${headerTitle} (${data && data.length})`}
rightIconName="ios-search"
isHasSearch
handleOnSearch={this._handleSearch}
/>

View File

@ -45,7 +45,7 @@ export const parsePost = (post, currentUserName, isSummary = false) => {
for (const i in _post.active_votes) {
_post.vote_perecent =
post.active_votes[i].voter === currentUserName ? post.active_votes[i].percent : null;
_post.active_votes[i].value = (post.active_votes[i].rshares * ratio).toFixed(2);
_post.active_votes[i].value = (post.active_votes[i].rshares * ratio).toFixed(3);
_post.active_votes[i].reputation = getReputation(post.active_votes[i].reputation);
_post.active_votes[i].percent = post.active_votes[i].percent / 100;
_post.active_votes[i].created = getTimeFromNow(post.active_votes[i].time);