i18n #80

Merged
akinwale merged 12 commits from i18n into master 2019-12-05 13:16:45 +01:00
14 changed files with 89 additions and 96 deletions
Showing only changes of commit cdfd1f99d0 - Show all commits

View file

@ -214,7 +214,11 @@ export default class ChannelSelector extends React.PureComponent {
onValueChange={this.handlePickerValueChange} onValueChange={this.handlePickerValueChange}
> >
{pickerItems.map(item => ( {pickerItems.map(item => (
<Picker.Item label={item} value={item} key={item} /> <Picker.Item
label={[Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL].includes(item) ? __(item) : item}
value={item}
key={item}
/>
))} ))}
</Picker> </Picker>

View file

@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { DrawerItems, SafeAreaView } from 'react-navigation'; import { DrawerItems, SafeAreaView } from 'react-navigation';
import { Image, ScrollView, Text, TouchableOpacity, View } from 'react-native'; import { Image, ScrollView, Text, TouchableOpacity, View } from 'react-native';
import { __ } from 'i18n';
import Button from 'component/button'; import Button from 'component/button';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import Icon from 'react-native-vector-icons/FontAwesome5'; import Icon from 'react-native-vector-icons/FontAwesome5';
@ -10,23 +9,23 @@ import discoverStyle from 'styles/discover';
const groupedMenuItems = { const groupedMenuItems = {
'Find content': [ 'Find content': [
{ icon: 'hashtag', label: __('Your Tags'), route: Constants.DRAWER_ROUTE_DISCOVER }, { icon: 'hashtag', label: 'Your Tags', route: Constants.DRAWER_ROUTE_DISCOVER },
{ icon: 'heart', solid: true, label: __('Subscriptions'), route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS }, { icon: 'heart', solid: true, label: 'Subscriptions', route: Constants.DRAWER_ROUTE_SUBSCRIPTIONS },
{ icon: 'globe-americas', label: __('All Content'), route: Constants.DRAWER_ROUTE_TRENDING }, { icon: 'globe-americas', label: 'All Content', route: Constants.DRAWER_ROUTE_TRENDING },
], ],
'Your content': [ 'Your content': [
{ icon: 'at', label: __('Channels'), route: Constants.DRAWER_ROUTE_CHANNEL_CREATOR }, { icon: 'at', label: 'Channels', route: Constants.DRAWER_ROUTE_CHANNEL_CREATOR },
{ icon: 'download', label: __('Library'), route: Constants.DRAWER_ROUTE_MY_LBRY }, { icon: 'download', label: 'Library', route: Constants.DRAWER_ROUTE_MY_LBRY },
{ icon: 'cloud-upload-alt', label: __('Publishes'), route: Constants.DRAWER_ROUTE_PUBLISHES }, { icon: 'cloud-upload-alt', label: 'Publishes', route: Constants.DRAWER_ROUTE_PUBLISHES },
{ icon: 'upload', label: __('New Publish'), route: Constants.DRAWER_ROUTE_PUBLISH }, { icon: 'upload', label: 'New Publish', route: Constants.DRAWER_ROUTE_PUBLISH },
], ],
Wallet: [ Wallet: [
{ icon: 'wallet', label: __('Wallet'), route: Constants.DRAWER_ROUTE_WALLET }, { icon: 'wallet', label: 'Wallet', route: Constants.DRAWER_ROUTE_WALLET },
{ icon: 'award', label: __('Rewards'), route: Constants.DRAWER_ROUTE_REWARDS }, { icon: 'award', label: 'Rewards', route: Constants.DRAWER_ROUTE_REWARDS },
], ],
Settings: [ Settings: [
{ icon: 'cog', label: __('Settings'), route: Constants.DRAWER_ROUTE_SETTINGS }, { icon: 'cog', label: 'Settings', route: Constants.DRAWER_ROUTE_SETTINGS },
{ icon: 'info', label: __('About'), route: Constants.DRAWER_ROUTE_ABOUT }, { icon: 'info', label: 'About', route: Constants.DRAWER_ROUTE_ABOUT },
], ],
}; };
@ -151,7 +150,7 @@ class DrawerContent extends React.PureComponent {
return ( return (
<TouchableOpacity <TouchableOpacity
accessible accessible
accessibilityLabel={item.label} accessibilityLabel={__(item.label)}
style={[ style={[
discoverStyle.menuItemTouchArea, discoverStyle.menuItemTouchArea,
focused ? discoverStyle.menuItemTouchAreaFocused : null, focused ? discoverStyle.menuItemTouchAreaFocused : null,
@ -169,7 +168,7 @@ class DrawerContent extends React.PureComponent {
/> />
</View> </View>
<Text style={[discoverStyle.menuItem, focused ? discoverStyle.menuItemFocused : null]}> <Text style={[discoverStyle.menuItem, focused ? discoverStyle.menuItemFocused : null]}>
{item.label} {__(item.label)}
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
); );

View file

@ -46,7 +46,7 @@ export default class ModalPicker extends React.PureComponent {
onPress={() => onItemSelected(item)} onPress={() => onItemSelected(item)}
> >
{item.icon && <Icon style={modalPickerStyle.itemIcon} name={item.icon} size={16} />} {item.icon && <Icon style={modalPickerStyle.itemIcon} name={item.icon} size={16} />}
<Text style={modalPickerStyle.itemLabel}>{item.label}</Text> <Text style={modalPickerStyle.itemLabel}>{__(item.label)}</Text>
{selectedItem && selectedItem.name === item.name && ( {selectedItem && selectedItem.name === item.name && (
<Icon style={modalPickerStyle.itemSelected} name={'check'} color={Colors.LbryGreen} size={16} /> <Icon style={modalPickerStyle.itemSelected} name={'check'} color={Colors.LbryGreen} size={16} />
)} )}

View file

@ -256,7 +256,7 @@ class UriBar extends React.PureComponent {
this.setSelection(); this.setSelection();
}} }}
selectTextOnFocus selectTextOnFocus
placeholder={'Search movies, music, and more'} placeholder={__('Search movies, music, and more')}
underlineColorAndroid={'transparent'} underlineColorAndroid={'transparent'}
numberOfLines={1} numberOfLines={1}
clearButtonMode={'while-editing'} clearButtonMode={'while-editing'}

View file

@ -1,5 +1,3 @@
import { __ } from 'i18n';
const SORT_BY_NEW = 'new'; const SORT_BY_NEW = 'new';
const SORT_BY_HOT = 'hot'; const SORT_BY_HOT = 'hot';
const SORT_BY_TOP = 'top'; const SORT_BY_TOP = 'top';
@ -98,8 +96,8 @@ const Constants = {
ROUTE_FILE: 'File', ROUTE_FILE: 'File',
ITEM_CREATE_A_CHANNEL: __('Create a channel...'), ITEM_CREATE_A_CHANNEL: 'Create a channel...',
ITEM_ANONYMOUS: __('Publish anonymously'), ITEM_ANONYMOUS: 'Publish anonymously',
SUBSCRIPTIONS_VIEW_ALL: 'view_all', SUBSCRIPTIONS_VIEW_ALL: 'view_all',
SUBSCRIPTIONS_VIEW_LATEST_FIRST: 'view_latest_first', SUBSCRIPTIONS_VIEW_LATEST_FIRST: 'view_latest_first',
@ -118,17 +116,17 @@ const Constants = {
TIME_ALL, TIME_ALL,
CLAIM_SEARCH_SORT_BY_ITEMS: [ CLAIM_SEARCH_SORT_BY_ITEMS: [
{ icon: 'fire-alt', name: SORT_BY_HOT, label: __('Trending content') }, { icon: 'fire-alt', name: SORT_BY_HOT, label: 'Trending content' },
{ icon: 'certificate', name: SORT_BY_NEW, label: __('New content') }, { icon: 'certificate', name: SORT_BY_NEW, label: 'New content' },
{ icon: 'chart-line', name: SORT_BY_TOP, label: __('Top content') }, { icon: 'chart-line', name: SORT_BY_TOP, label: 'Top content' },
], ],
CLAIM_SEARCH_TIME_ITEMS: [ CLAIM_SEARCH_TIME_ITEMS: [
{ name: TIME_DAY, label: __('Past 24 hours') }, { name: TIME_DAY, label: 'Past 24 hours' },
{ name: TIME_WEEK, label: __('Past week') }, { name: TIME_WEEK, label: 'Past week' },
{ name: TIME_MONTH, label: __('Past month') }, { name: TIME_MONTH, label: 'Past month' },
{ name: TIME_YEAR, label: __('Past year') }, { name: TIME_YEAR, label: 'Past year' },
{ name: TIME_ALL, label: __('All time') }, { name: TIME_ALL, label: 'All time' },
], ],
DEFAULT_ORDER_BY: ['trending_group', 'trending_mixed'], DEFAULT_ORDER_BY: ['trending_group', 'trending_mixed'],

View file

@ -60,7 +60,6 @@ function checkMessageAndSave(message, messagesFilePath) {
kauffj commented 2019-12-03 18:26:17 +01:00 (Migrated from github.com)
Review

do you want this here?

do you want this here?
akinwale commented 2019-12-04 08:12:52 +01:00 (Migrated from github.com)
Review

No, the commented code can be removed.

No, the commented code can be removed.
kauffj commented 2019-12-03 18:26:17 +01:00 (Migrated from github.com)
Review

do you want this here?

do you want this here?
akinwale commented 2019-12-04 08:12:52 +01:00 (Migrated from github.com)
Review

No, the commented code can be removed.

No, the commented code can be removed.
export function __(message, tokens) { export function __(message, tokens) {
const w = global.window ? global.window : window; const w = global.window ? global.window : window;
let language = w.language ? w.language : 'en'; let language = w.language ? w.language : 'en';
console.log('w.language=' + language + '; message=' + message);
kauffj commented 2019-12-03 18:26:17 +01:00 (Migrated from github.com)
Review

do you want this here?

do you want this here?
akinwale commented 2019-12-04 08:12:52 +01:00 (Migrated from github.com)
Review

No, the commented code can be removed.

No, the commented code can be removed.
if (!isProduction) { if (!isProduction) {
saveMessage(message); saveMessage(message);

kauffj commented 2019-12-03 18:26:17 +01:00 (Migrated from github.com)
Review

do you want this here?

do you want this here?
akinwale commented 2019-12-04 08:12:52 +01:00 (Migrated from github.com)
Review

No, the commented code can be removed.

No, the commented code can be removed.
kauffj commented 2019-12-03 18:26:17 +01:00 (Migrated from github.com)
Review

do you want this here?

do you want this here?
akinwale commented 2019-12-04 08:12:52 +01:00 (Migrated from github.com)
Review

No, the commented code can be removed.

No, the commented code can be removed.

View file

@ -74,12 +74,12 @@ class ChannelPage extends React.PureComponent {
<View style={discoverStyle.pickerRow}> <View style={discoverStyle.pickerRow}>
<View style={discoverStyle.leftPickerRow}> <View style={discoverStyle.leftPickerRow}>
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}> <TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text> <Text style={discoverStyle.tagSortText}>{__(sortByItem.label.split(' ')[0])}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
{Constants.SORT_BY_TOP === sortByItem.name && ( {Constants.SORT_BY_TOP === sortByItem.name && (
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}> <TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text> <Text style={discoverStyle.tagSortText}>{__(timeItem.label)}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
)} )}

View file

@ -261,13 +261,13 @@ class DiscoverPage extends React.PureComponent {
<View style={discoverStyle.pickerRow}> <View style={discoverStyle.pickerRow}>
<View style={discoverStyle.leftPickerRow}> <View style={discoverStyle.leftPickerRow}>
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}> <TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text> <Text style={discoverStyle.tagSortText}>{__(sortByItem.label.split(' ')[0])}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
{Constants.SORT_BY_TOP === sortByItem.name && ( {Constants.SORT_BY_TOP === sortByItem.name && (
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}> <TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text> <Text style={discoverStyle.tagSortText}>{__(timeItem.label)}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
)} )}

View file

@ -46,34 +46,33 @@ import TagSearch from 'component/tagSearch';
import UriBar from 'component/uriBar'; import UriBar from 'component/uriBar';
import publishStyle from 'styles/publish'; import publishStyle from 'styles/publish';
import { navigateToUri, logPublish, uploadImageAsset } from 'utils/helper'; import { navigateToUri, logPublish, uploadImageAsset } from 'utils/helper';
import { __ } from 'i18n';
const languages = { const languages = {
en: __('English'), en: 'English',
zh: __('Chinese'), zh: 'Chinese',
fr: __('French'), fr: 'French',
de: __('German'), de: 'German',
jp: __('Japanese'), jp: 'Japanese',
ru: __('Russian'), ru: 'Russian',
es: __('Spanish'), es: 'Spanish',
id: __('Indonesian'), id: 'Indonesian',
it: __('Italian'), it: 'Italian',
nl: __('Dutch'), nl: 'Dutch',
tr: __('Turkish'), tr: 'Turkish',
pl: __('Polish'), pl: 'Polish',
ms: __('Malay'), ms: 'Malay',
pt: __('Portuguese'), pt: 'Portuguese',
vi: __('Vietnamese'), vi: 'Vietnamese',
th: __('Thai'), th: 'Thai',
ar: __('Arabic'), ar: 'Arabic',
cs: __('Czech'), cs: 'Czech',
hr: __('Croatian'), hr: 'Croatian',
km: __('Cambodian'), km: 'Cambodian',
ko: __('Korean'), ko: 'Korean',
no: __('Norwegian'), no: 'Norwegian',
ro: __('Romanian'), ro: 'Romanian',
hi: __('Hindi'), hi: 'Hindi',
el: __('Greek'), el: 'Greek',
}; };
class PublishPage extends React.PureComponent { class PublishPage extends React.PureComponent {
@ -1155,7 +1154,7 @@ class PublishPage extends React.PureComponent {
onValueChange={this.handleLanguageValueChange} onValueChange={this.handleLanguageValueChange}
> >
{Object.keys(languages).map(lang => ( {Object.keys(languages).map(lang => (
<Picker.Item label={languages[lang]} value={lang} key={lang} /> <Picker.Item label={__(languages[lang])} value={lang} key={lang} />
))} ))}
</Picker> </Picker>
</View> </View>

View file

@ -2,7 +2,6 @@ import React from 'react';
import { SETTINGS } from 'lbry-redux'; import { SETTINGS } from 'lbry-redux';
import { ActivityIndicator, Picker, Platform, Text, View, ScrollView, Switch, NativeModules } from 'react-native'; import { ActivityIndicator, Picker, Platform, Text, View, ScrollView, Switch, NativeModules } from 'react-native';
import { navigateBack } from 'utils/helper'; import { navigateBack } from 'utils/helper';
import { __ } from 'i18n';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import Colors from 'styles/colors'; import Colors from 'styles/colors';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
@ -11,17 +10,17 @@ import RNFS from 'react-native-fs';
import settingsStyle from 'styles/settings'; import settingsStyle from 'styles/settings';
const languageOptions = [ const languageOptions = [
{ code: 'default', name: __('Use device language') }, { code: 'default', name: 'Use device language' },
{ code: 'en', name: __('English') }, { code: 'en', name: 'English' },
{ code: 'gu', name: __('Gujarati') }, { code: 'gu', name: 'Gujarati' },
{ code: 'hi', name: __('Hindi') }, { code: 'hi', name: 'Hindi' },
{ code: 'id', name: __('Indonesian') }, { code: 'id', name: 'Indonesian' },
{ code: 'it', name: __('Italian') }, { code: 'it', name: 'Italian' },
{ code: 'ms', name: __('Malay') }, { code: 'ms', name: 'Malay' },
{ code: 'tr', name: __('Turkish') }, { code: 'tr', name: 'Turkish' },
{ code: 'pl', name: __('Polish') }, { code: 'pl', name: 'Polish' },
{ code: 'pt', name: __('Portuguese') }, { code: 'pt', name: 'Portuguese' },
{ code: 'es', name: __('Spanish') }, { code: 'es', name: 'Spanish' },
]; ];
class SettingsPage extends React.PureComponent { class SettingsPage extends React.PureComponent {
@ -186,7 +185,7 @@ class SettingsPage extends React.PureComponent {
onValueChange={this.handleLanguageValueChange} onValueChange={this.handleLanguageValueChange}
> >
{languageOptions.map(option => ( {languageOptions.map(option => (
<Picker.Item label={option.name} value={option.code} key={option.code} /> <Picker.Item label={__(option.name)} value={option.code} key={option.code} />
))} ))}
</Picker> </Picker>
</View> </View>

View file

@ -5,7 +5,6 @@ import { ActivityIndicator, DeviceEventEmitter, Linking, NativeModules, Platform
import { NavigationActions, StackActions } from 'react-navigation'; import { NavigationActions, StackActions } from 'react-navigation';
import { decode as atob } from 'base-64'; import { decode as atob } from 'base-64';
import { navigateToUri, transformUrl } from 'utils/helper'; import { navigateToUri, transformUrl } from 'utils/helper';
import { __ } from 'i18n';
import moment from 'moment'; import moment from 'moment';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import Button from 'component/button'; import Button from 'component/button';
@ -18,9 +17,6 @@ import RNFS from 'react-native-fs';
const BLOCK_HEIGHT_INTERVAL = 1000 * 60 * 2.5; // every 2.5 minutes const BLOCK_HEIGHT_INTERVAL = 1000 * 60 * 2.5; // every 2.5 minutes
const testingNetwork = __('Testing network');
const waitingForResolution = __('Waiting for name resolution');
class SplashScreen extends React.PureComponent { class SplashScreen extends React.PureComponent {
static navigationOptions = { static navigationOptions = {
title: 'Splash', title: 'Splash',
@ -205,8 +201,8 @@ class SplashScreen extends React.PureComponent {
Lbry.wallet_unlock({ password: password || '' }).then(unlocked => { Lbry.wallet_unlock({ password: password || '' }).then(unlocked => {
if (unlocked) { if (unlocked) {
this.setState({ this.setState({
message: testingNetwork, message: __('Testing network'),
details: waitingForResolution, details: __('Waiting for name resolution'),
}); });
this.finishSplashScreen(); this.finishSplashScreen();
} else { } else {
@ -215,8 +211,8 @@ class SplashScreen extends React.PureComponent {
}); });
} else { } else {
this.setState({ this.setState({
message: testingNetwork, message: __('Testing network'),
details: waitingForResolution, details: __('Waiting for name resolution'),
}); });
this.finishSplashScreen(); this.finishSplashScreen();
} }
@ -318,8 +314,8 @@ class SplashScreen extends React.PureComponent {
this.setState( this.setState(
{ {
accountUnlockFailed: false, accountUnlockFailed: false,
message: testingNetwork, message: __('Testing network'),
details: waitingForResolution, details: __('Waiting for name resolution'),
}, },
() => this.finishSplashScreen() () => this.finishSplashScreen()
); );

View file

@ -158,7 +158,7 @@ class SubscriptionsPage extends React.PureComponent {
style={subscriptionsStyle.tagSortBy} style={subscriptionsStyle.tagSortBy}
onPress={() => this.setState({ showSortPicker: true })} onPress={() => this.setState({ showSortPicker: true })}
> >
<Text style={subscriptionsStyle.tagSortText}>{currentSortByItem.label.split(' ')[0]}</Text> <Text style={subscriptionsStyle.tagSortText}>{__(currentSortByItem.label.split(' ')[0])}</Text>
<Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
@ -167,7 +167,7 @@ class SubscriptionsPage extends React.PureComponent {
style={subscriptionsStyle.tagSortBy} style={subscriptionsStyle.tagSortBy}
onPress={() => this.setState({ showTimePicker: true })} onPress={() => this.setState({ showTimePicker: true })}
> >
<Text style={subscriptionsStyle.tagSortText}>{timeItem.label}</Text> <Text style={subscriptionsStyle.tagSortText}>{__(timeItem.label)}</Text>
<Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={subscriptionsStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
)} )}

View file

@ -105,12 +105,12 @@ class TagPage extends React.PureComponent {
<View style={discoverStyle.pickerRow}> <View style={discoverStyle.pickerRow}>
<View style={discoverStyle.leftPickerRow}> <View style={discoverStyle.leftPickerRow}>
<TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}> <TouchableOpacity style={discoverStyle.tagSortBy} onPress={() => this.setState({ showSortPicker: true })}>
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text> <Text style={discoverStyle.tagSortText}>{__(sortByItem.label.split(' ')[0])}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
{Constants.SORT_BY_TOP === sortByItem.name && ( {Constants.SORT_BY_TOP === sortByItem.name && (
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}> <TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text> <Text style={discoverStyle.tagSortText}>{__(timeItem.label)}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
)} )}

View file

@ -15,11 +15,10 @@ import FloatingWalletBalance from 'component/floatingWalletBalance';
import Icon from 'react-native-vector-icons/FontAwesome5'; import Icon from 'react-native-vector-icons/FontAwesome5';
import UriBar from 'component/uriBar'; import UriBar from 'component/uriBar';
import discoverStyle from 'styles/discover'; import discoverStyle from 'styles/discover';
import { __ } from 'i18n';
const TRENDING_FOR_ITEMS = [ const TRENDING_FOR_ITEMS = [
{ icon: 'globe-americas', name: 'everyone', label: __('Everyone') }, { icon: 'globe-americas', name: 'everyone', label: 'Everyone' },
{ icon: 'hashtag', name: 'tags', label: __('Tags you follow') }, { icon: 'hashtag', name: 'tags', label: 'Tags you follow' },
]; ];
class TrendingPage extends React.PureComponent { class TrendingPage extends React.PureComponent {
@ -101,24 +100,24 @@ class TrendingPage extends React.PureComponent {
style={discoverStyle.allTagSortBy} style={discoverStyle.allTagSortBy}
onPress={() => this.setState({ showSortPicker: true })} onPress={() => this.setState({ showSortPicker: true })}
> >
<Text style={discoverStyle.tagSortText}>{sortByItem.label.split(' ')[0]}</Text> <Text style={discoverStyle.tagSortText}>{__(sortByItem.label.split(' ')[0])}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
<Text style={discoverStyle.pickerLabel}>for</Text> <Text style={discoverStyle.pickerLabel}>{__('for')}</Text>
<TouchableOpacity <TouchableOpacity
style={discoverStyle.allTagSortBy} style={discoverStyle.allTagSortBy}
onPress={() => this.setState({ showTrendingForPicker: true })} onPress={() => this.setState({ showTrendingForPicker: true })}
> >
<Text style={discoverStyle.tagSortText}>{currentTrendingForItem.label.split(' ')[0]}</Text> <Text style={discoverStyle.tagSortText}>{__(currentTrendingForItem.label.split(' ')[0])}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
{sortByTop && <Text style={discoverStyle.pickerLabel}>from</Text>} {sortByTop && <Text style={discoverStyle.pickerLabel}>{__('from')}</Text>}
{sortByTop && ( {sortByTop && (
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}> <TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>
<Text style={discoverStyle.tagSortText}>{timeItem.label}</Text> <Text style={discoverStyle.tagSortText}>{__(timeItem.label)}</Text>
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
)} )}