Replace static message with internationalized message by translation file
parent
b46e608022
commit
9df750d7aa
|
|
@ -6,6 +6,7 @@ import DOMPurify from 'dompurify';
|
|||
import marked from 'marked';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { useIntl } from 'react-intl';
|
||||
|
||||
const linkRenderer = new marked.Renderer();
|
||||
|
||||
|
|
@ -55,6 +56,8 @@ const styles = (theme) =>
|
|||
|
||||
const Message = (props) =>
|
||||
{
|
||||
const intl = useIntl();
|
||||
|
||||
const {
|
||||
self,
|
||||
picture,
|
||||
|
|
@ -88,7 +91,16 @@ const Message = (props) =>
|
|||
}
|
||||
) }}
|
||||
/>
|
||||
<Typography variant='caption'>{self ? 'Me' : name} - {time}</Typography>
|
||||
<Typography variant='caption'>
|
||||
{ self ?
|
||||
intl.formatMessage({
|
||||
id : 'room.me',
|
||||
defaultMessage : 'Me'
|
||||
})
|
||||
:
|
||||
name
|
||||
} - {time}
|
||||
</Typography>
|
||||
</div>
|
||||
</Paper>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue