From 1ebf6fc0c23dd2d2b8af916c09d5addd078da7c3 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Tue, 5 Feb 2019 19:15:31 -0300 Subject: [PATCH] MM-13974 Missing translations (#2549) * Missing translations * update snapshots --- .../sidebars/main/channels_list/list/list.js | 17 +++++------ app/screens/edit_profile/edit_profile.js | 4 +-- .../advanced_settings/advanced_settings.js | 5 ++-- .../theme/__snapshots__/theme.test.js.snap | 28 ++++++++----------- app/screens/theme/theme.js | 11 ++++---- assets/base/i18n/en.json | 3 -- 6 files changed, 31 insertions(+), 37 deletions(-) diff --git a/app/components/sidebars/main/channels_list/list/list.js b/app/components/sidebars/main/channels_list/list/list.js index 190af7a7c..eda71271a 100644 --- a/app/components/sidebars/main/channels_list/list/list.js +++ b/app/components/sidebars/main/channels_list/list/list.js @@ -19,6 +19,7 @@ import {debounce} from 'mattermost-redux/actions/helpers'; import ChannelItem from 'app/components/sidebars/main/channels_list/channel_item'; import {ListTypes} from 'app/constants'; import {SidebarSectionTypes} from 'app/constants/view'; +import {t} from 'app/utils/i18n'; import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity} from 'app/utils/theme'; @@ -88,48 +89,48 @@ export default class List extends PureComponent { switch (sectionType) { case SidebarSectionTypes.UNREADS: return { - id: 'mobile.channel_list.unreads', + id: t('mobile.channel_list.unreads'), defaultMessage: 'UNREADS', }; case SidebarSectionTypes.FAVORITE: return { - id: 'sidebar.favorite', + id: t('sidebar.favorite'), defaultMessage: 'FAVORITES', }; case SidebarSectionTypes.PUBLIC: return { action: this.goToMoreChannels, - id: 'sidebar.channels', + id: t('sidebar.channels'), defaultMessage: 'PUBLIC CHANNELS', }; case SidebarSectionTypes.PRIVATE: return { action: canCreatePrivateChannels ? this.goToCreatePrivateChannel : null, - id: 'sidebar.pg', + id: t('sidebar.pg'), defaultMessage: 'PRIVATE CHANNELS', }; case SidebarSectionTypes.DIRECT: return { action: this.goToDirectMessages, - id: 'sidebar.direct', + id: t('sidebar.direct'), defaultMessage: 'DIRECT MESSAGES', }; case SidebarSectionTypes.RECENT_ACTIVITY: return { action: this.showCreateChannelOptions, - id: 'sidebar.types.recent', + id: t('sidebar.types.recent'), defaultMessage: 'RECENT ACTIVITY', }; case SidebarSectionTypes.ALPHA: return { action: this.showCreateChannelOptions, - id: 'mobile.channel_list.channels', + id: t('mobile.channel_list.channels'), defaultMessage: 'CHANNELS', }; default: return { action: this.showCreateChannelOptions, - id: 'mobile.channel_list.channels', + id: t('mobile.channel_list.channels'), defaultMessage: 'CHANNELS', }; } diff --git a/app/screens/edit_profile/edit_profile.js b/app/screens/edit_profile/edit_profile.js index 21674b5df..8c8edf6d9 100644 --- a/app/screens/edit_profile/edit_profile.js +++ b/app/screens/edit_profile/edit_profile.js @@ -91,8 +91,8 @@ export default class EditProfile extends PureComponent { rightButtons: [this.rightButton], }; - this.leftButton.title = context.intl.formatMessage({id: 'mobile.account.settings.cancel', defaultMessage: 'Cancel'}); - this.rightButton.title = context.intl.formatMessage({id: 'mobile.account.settings.save', defaultMessage: 'Save'}); + this.leftButton.title = context.intl.formatMessage({id: t('mobile.account.settings.cancel'), defaultMessage: 'Cancel'}); + this.rightButton.title = context.intl.formatMessage({id: t('mobile.account.settings.save'), defaultMessage: 'Save'}); props.navigator.setOnNavigatorEvent(this.onNavigatorEvent); props.navigator.setButtons(buttons); diff --git a/app/screens/settings/advanced_settings/advanced_settings.js b/app/screens/settings/advanced_settings/advanced_settings.js index 9f23d3012..b53839b64 100644 --- a/app/screens/settings/advanced_settings/advanced_settings.js +++ b/app/screens/settings/advanced_settings/advanced_settings.js @@ -18,6 +18,7 @@ import {getFormattedFileSize} from 'mattermost-redux/utils/file_utils'; import SettingsItem from 'app/screens/settings/settings_item'; import StatusBar from 'app/components/status_bar'; +import {t} from 'app/utils/i18n'; import {deleteFileCache, getFileCacheSize} from 'app/utils/file'; import {preventDoubleTap} from 'app/utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; @@ -46,8 +47,8 @@ class AdvancedSettings extends PureComponent { const {formatMessage} = this.props.intl; Alert.alert( - formatMessage({id: 'mobile.advanced_settings.delete_title', defaultMessage: 'Delete Documents & Data'}), - formatMessage({id: 'mobile.advanced_settings.delete_message', defaultMessage: '\nThis will reset all offline data and restart the app. You will be automatically logged back in once the app restarts.\n'}), + formatMessage({id: t('mobile.advanced_settings.delete_title'), defaultMessage: 'Delete Documents & Data'}), + formatMessage({id: t('mobile.advanced_settings.delete_message'), defaultMessage: '\nThis will reset all offline data and restart the app. You will be automatically logged back in once the app restarts.\n'}), [{ text: formatMessage({id: 'channel_modal.cancel', defaultMessage: 'Cancel'}), style: 'cancel', diff --git a/app/screens/theme/__snapshots__/theme.test.js.snap b/app/screens/theme/__snapshots__/theme.test.js.snap index 1836adba6..9aaff6908 100644 --- a/app/screens/theme/__snapshots__/theme.test.js.snap +++ b/app/screens/theme/__snapshots__/theme.test.js.snap @@ -45,10 +45,9 @@ exports[`Theme should match snapshot 1`] = ` isLandscape={false} isTablet={false} label={ - + + Mattermost + } selected={true} theme={ @@ -91,10 +90,9 @@ exports[`Theme should match snapshot 1`] = ` isLandscape={false} isTablet={false} label={ - + + Organization + } selected={false} theme={ @@ -137,10 +135,9 @@ exports[`Theme should match snapshot 1`] = ` isLandscape={false} isTablet={false} label={ - + + Mattermost Dark + } selected={false} theme={ @@ -183,10 +180,9 @@ exports[`Theme should match snapshot 1`] = ` isLandscape={false} isTablet={false} label={ - + + Windows Dark + } selected={false} theme={ diff --git a/app/screens/theme/theme.js b/app/screens/theme/theme.js index 326ce1e98..a2a37d43f 100644 --- a/app/screens/theme/theme.js +++ b/app/screens/theme/theme.js @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import React from 'react'; -import {View} from 'react-native'; +import {Text, View} from 'react-native'; import PropTypes from 'prop-types'; import {intlShape} from 'react-intl'; @@ -80,10 +80,9 @@ export default class Theme extends React.PureComponent { + + {allowedTheme.type} + )} action={this.setTheme} actionValue={allowedTheme.key} @@ -103,7 +102,7 @@ export default class Theme extends React.PureComponent { )} diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index d8e478a06..e837666d5 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -127,7 +127,6 @@ "mobile.account.settings.save": "Save", "mobile.account.settings.cancel": "Cancel", "mobile.action_menu.select": "Select an option", - "mobile.action_menu.submitted": "Submitted", "mobile.advanced_settings.clockDisplay": "Clock display", "mobile.advanced_settings.delete": "Delete", "mobile.advanced_settings.delete_message": "\nThis will reset all offline data and restart the app. You will be automatically logged back in once the app restarts.\n", @@ -273,7 +272,6 @@ "mobile.managed.secured_by": "Secured by {vendor}", "mobile.markdown.code.copy_code": "Copy Code", "mobile.markdown.code.plusMoreLines": "+{count, number} more {count, plural, one {line} other {lines}}", - "mobile.markdown.image.error": "Image failed to load:", "mobile.markdown.image.too_large": "Image exceeds max dimensions of {maxWidth} by {maxHeight}:", "mobile.markdown.link.copy_url": "Copy URL", "mobile.mention.copy_mention": "Copy Mention", @@ -356,7 +354,6 @@ "mobile.post.failed_title": "Unable to send your message", "mobile.post.retry": "Refresh", "mobile.posts_view.moreMsg": "More New Messages Above", - "mobile.reaction_list.title": "Reactions", "mobile.recent_mentions.empty_description": "Messages containing your username and other words that trigger mentions will appear here.", "mobile.recent_mentions.empty_title": "No Recent Mentions", "mobile.rename_channel.display_name_maxLength": "Channel name must be less than {maxLength, number} characters",