localize filters

This commit is contained in:
feruz 2019-12-16 15:14:30 +02:00
parent 1aba4ea315
commit 2b6124dcc1
3 changed files with 17 additions and 5 deletions

View File

@ -158,7 +158,7 @@ class NotificationView extends PureComponent {
);
render() {
const { readAllNotification, getActivities, isNotificationRefreshing } = this.props;
const { readAllNotification, getActivities, isNotificationRefreshing, intl } = this.props;
const { filters, selectedFilter, selectedIndex } = this.state;
const _notifications = this._getNotificationsArrays();
@ -166,7 +166,9 @@ class NotificationView extends PureComponent {
<View style={styles.container}>
<FilterBar
dropdownIconName="arrow-drop-down"
options={filters.map(item => item.value)}
options={filters.map(item =>
intl.formatMessage({ id: `notification.${item.key}` }).toUpperCase(),
)}
defaultText="ALL"
onDropdownSelect={this._handleOnDropdownSelect}
rightIconName="playlist-add-check"

View File

@ -351,7 +351,10 @@ const PostsView = ({
{filterOptions && isShowFilterBar && (
<FilterBar
dropdownIconName="arrow-drop-down"
options={filterOptions}
//options={filterOptions}
options={filterOptions.map(item =>
intl.formatMessage({ id: `home.${item.toLowerCase()}` }).toUpperCase(),
)}
selectedOptionIndex={selectedFilterIndex}
defaultText={filterOptions[selectedOptionIndex]}
rightIconName="view-module"

View File

@ -120,7 +120,11 @@
"yesterday": "Yesterday",
"this_week": "This Week",
"this_month": "This Month",
"older_then": "Older Than A Month"
"older_then": "Older Than A Month",
"activities": "All",
"replies": "Replies",
"mentions": "Mentions",
"reblogs": "Reblogs"
},
"leaderboard": {
"daily": "DAILY",
@ -209,7 +213,10 @@
},
"home": {
"feed": "Feed",
"popular": "Popular"
"popular": "Popular",
"top": "Top",
"hot": "Hot",
"new": "New"
},
"side_menu": {
"profile": "Profile",