Skip to content

Commit

Permalink
regression: auto translate not working (#6134)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Feb 14, 2025
1 parent 1ad5e06 commit c9b474f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/containers/markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ const Markdown: React.FC<IMarkdownProps> = ({
onLinkPress,
isTranslated
}: IMarkdownProps) => {
if (!msg || isTranslated) return null;
if (!msg) return null;

const tokens = md ?? parse(msg);
const tokens = !isTranslated && md ? md : parse(msg);

if (isEmpty(tokens)) return null;

Expand Down
17 changes: 15 additions & 2 deletions app/containers/message/Message.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,21 @@ export const Pinned = () => (

export const Translated = () => (
<>
<Message msg='Message header' isTranslated />
<Message msg='Message without header' isTranslated isHeader={false} />
<Message
msg='Message translated'
md={[
{
type: 'PARAGRAPH',
value: [
{
type: 'PLAIN_TEXT',
value: 'md is never translated'
}
]
}
]}
isTranslated
/>
</>
);

Expand Down

0 comments on commit c9b474f

Please sign in to comment.