Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added translations for "edited" label in chats #4776

Merged
merged 8 commits into from
Aug 27, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import ThumbnailImage from '../ThumbnailImage';
import variables from '../../styles/variables';
import themeColors from '../../styles/themes/default';
import Text from '../Text';
import {translateLocal} from '../../libs/translate';

const propTypes = {
/** Whether text elements should be selectable */
Expand Down Expand Up @@ -132,7 +133,7 @@ function EditedRenderer(props) {
>
{/* Native devices do not support margin between nested text */}
<Text style={styles.w1}>{' '}</Text>
(edited)
{translateLocal('reportActionCompose.edited')}
</Text>
);
}
Expand Down Expand Up @@ -229,6 +230,7 @@ const defaultViewProps = {style: {alignItems: 'flex-start'}};
const BaseHTMLEngineProvider = ({children, textSelectable}) => {
// We need to memoize this prop to make it referentially stable.
const defaultTextProps = useMemo(() => ({selectable: textSelectable}), [textSelectable]);

return (
<TRenderEngineProvider
customHTMLElementModels={customHTMLElementModels}
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default {
fileUploadFailed: 'Upload Failed. File is not supported.',
roomIsArchived: 'This chat room has been deleted',
localTime: ({user, time}) => `It's ${time} for ${user}`,
edited: '(edited)',
},
reportActionContextMenu: {
copyToClipboard: 'Copy to Clipboard',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default {
fileUploadFailed: 'Subida fallida. El archivo no es compatible.',
roomIsArchived: 'Esta sala de chat ha sido eliminada',
localTime: ({user, time}) => `Son las ${time} para ${user}`,
edited: '(editar)',
Copy link
Contributor

@aldo-expensify aldo-expensify Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be (editado), not (editar).

Edit -> Editar
Edited -> Editado/a (depending on the gender of what we edited).

},
reportActionContextMenu: {
copyToClipboard: 'Copiar al Portapapeles',
Expand Down
12 changes: 10 additions & 2 deletions src/pages/home/report/ReportActionItemFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import Text from '../../../components/Text';
import Tooltip from '../../../components/Tooltip';
import {isSingleEmoji} from '../../../libs/ValidationUtils';
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import canUseTouchScreen from '../../../libs/canUseTouchscreen';
import compose from '../../../libs/compose';

const propTypes = {
/** The message fragment needing to be displayed */
Expand All @@ -30,6 +32,9 @@ const propTypes = {
isSingleLine: PropTypes.bool,

...windowDimensionsPropTypes,

/** localization props */
...withLocalizePropTypes,
};

const defaultProps = {
Expand Down Expand Up @@ -76,7 +81,7 @@ class ReportActionItemFragment extends React.PureComponent {
>
{/* Native devices do not support margin between nested text */}
<Text style={styles.w1}>{' '}</Text>
(edited)
{this.props.translate('reportActionCompose.edited')}
</Text>
)}
</Text>
Expand Down Expand Up @@ -117,4 +122,7 @@ ReportActionItemFragment.propTypes = propTypes;
ReportActionItemFragment.defaultProps = defaultProps;
ReportActionItemFragment.displayName = 'ReportActionItemFragment';

export default withWindowDimensions(ReportActionItemFragment);
export default compose(
withWindowDimensions,
withLocalize,
)(ReportActionItemFragment);