Replace static message with internationalized message by translation file

auto_join_3.3
mi4aux 2020-04-20 21:09:57 +02:00
parent b46e608022
commit 9df750d7aa
1 changed files with 13 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import DOMPurify from 'dompurify';
import marked from 'marked'; import marked from 'marked';
import Paper from '@material-ui/core/Paper'; import Paper from '@material-ui/core/Paper';
import Typography from '@material-ui/core/Typography'; import Typography from '@material-ui/core/Typography';
import { useIntl } from 'react-intl';
const linkRenderer = new marked.Renderer(); const linkRenderer = new marked.Renderer();
@ -55,6 +56,8 @@ const styles = (theme) =>
const Message = (props) => const Message = (props) =>
{ {
const intl = useIntl();
const { const {
self, self,
picture, 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> </div>
</Paper> </Paper>
); );