Skip to content

Commit

Permalink
fix explanations and localizations - in translation box
Browse files Browse the repository at this point in the history
  • Loading branch information
saparagus committed Sep 14, 2024
1 parent a025619 commit c11ba18
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 15 deletions.
20 changes: 12 additions & 8 deletions client/components/DictionaryHelp/Lemma.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,31 @@ const Lemma = ({
}) => {
const learningLanguage = useLearningLanguage()
const { maskSymbol } = useSelector(({ translation }) => translation)

return (
<div className="flex space-between" style={getTextStyle(learningLanguage)}>
<div className="flex">
<Speaker word={lemma} />
{maskSymbol || (
<a href={userUrl} target="_blank" rel="noopener noreferrer">
{lemma}
{// ??? <Popup content={<FormattedMessage id="explain-lemma-goto-dictionary" /> }
lemma
}
</a>
)}
{inflectionRef && (
<a href={inflectionRef.url} target="_blank" rel="noopener noreferrer" className="flex">
<Icon name="external" style={{ marginLeft: '1rem' }} />
</a>
<a href={// ??? <Popup content={<FormattedMessage id="explain-goto-inflection-table" /> }
inflectionRef.url
} target="_blank" rel="noopener noreferrer" className="flex">
<Icon name="external" style={{ marginLeft: '1rem' }} />
</a>
)}
</div>
{preferred && (
<div className="flex-col" style={{ alignItems: 'center' }}>
<Popup
position="top center"
content={<FormattedHTMLMessage id="i-know-tooltip" />}
content={<FormattedHTMLMessage id="explain-i-know-word" />}
trigger={
<Icon
name="check"
Expand All @@ -51,7 +55,7 @@ const Lemma = ({
/>
<Popup
position="top center"
content={<FormattedHTMLMessage id="i-dont-know-tooltip" />}
content={<FormattedHTMLMessage id="explain-i-dont-know-word" />}
trigger={
<Icon
name="question"
Expand All @@ -66,4 +70,4 @@ const Lemma = ({
)
}

export default Lemma
export default Lemma
20 changes: 17 additions & 3 deletions client/components/DictionaryHelp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,15 @@ const DictionaryHelp = ({ minimized, inWordNestModal }) => {
{!inWordNestModal && words && words[translated.lemma]?.length > 0 &&
(learningLanguage === 'Russian' || learningLanguage === 'Finnish') &&
!clue && (
<Popup
content={intl.formatMessage({ id: 'explain-wordnest-modal' })}
trigger={
<Button basic size="mini" onClick={()=> handleNestButtonClick(translated.lemma)}
data-cy="nest-button">
<img src={images.nestIcon} alt="nest icon" width="22" />
</Button>
}
/>
)}
</div>
</div>
Expand Down Expand Up @@ -226,7 +231,10 @@ const DictionaryHelp = ({ minimized, inWordNestModal }) => {
<>
<div style={{ marginBottom: '1em', width: '100%',
...getTextStyle(learningLanguage) }}>
<Speaker word={parsedLemmas()[0]} />
<Popup
content={intl.formatMessage({ id: 'explain-speaker-lemma' })}
trigger={<Speaker word={parsedLemmas()[0]} />
} />
{maskSymbol || parsedLemmas()[0]}
</div>
<div className="additional-info">
Expand All @@ -252,7 +260,10 @@ const DictionaryHelp = ({ minimized, inWordNestModal }) => {
<List.Item style={{ color: '#555555' }}>
{!clue && !inWordNestModal && (
<div style={{ width: '100%', ...getTextStyle(learningLanguage) }}>
<Speaker word={parsedLemmas()[0]} />
<Popup
content={intl.formatMessage({ id: 'explain-speaker-lemma' })}
trigger={<Speaker word={parsedLemmas()[0]} />}
/>
{maskSymbol || parsedLemmas()[0]}
</div>
)}
Expand Down Expand Up @@ -316,7 +327,10 @@ const DictionaryHelp = ({ minimized, inWordNestModal }) => {
...getTextStyle(learningLanguage),
}}
>
<Speaker word={surfaceWord} />
<Popup
content={intl.formatMessage({ id: 'explain-speaker-surface' })}
trigger={<Speaker word={surfaceWord} />}
/>
<span style={{ color: '#2185D0' }}>{maskSymbol || surfaceWord}</span>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const FlashcardListItem = ({ card, handleEdit }) => {
</Accordion.Toggle>
<Popup
position="top center"
content={<FormattedMessage id="i-know-tooltip" />}
content={<FormattedMessage id="explain-i-know-word" />}
trigger={
<Icon
name="check"
Expand All @@ -92,7 +92,7 @@ const FlashcardListItem = ({ card, handleEdit }) => {
/>
<Popup
position="top center"
content={<FormattedMessage id="i-dont-know-tooltip" />}
content={<FormattedMessage id="explain-i-dont-know-word" />}
trigger={
<Icon
name="question"
Expand Down
6 changes: 4 additions & 2 deletions client/components/LibraryView/LibrarySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ const LibrarySearch = ({ setDisplaySearchResults, setDisplayedStories, fluid })
return (
<div style={{ position: 'relative' }}>
<Popup
content={intl.formatMessage({ id: 'explanation-library-search' })}
trigger={<Icon style={{ paddingRight: '0.5em' }} name="info circle" color="grey" />}
content={intl.formatMessage({ id: 'explain-library-search' })}
trigger={<Icon style={{ paddingRight: '0.5em' }}
name="info circle"
color="grey" />}
/>
<Input
action={{ icon: 'search', onClick: handleLibrarySearch, color: 'grey' }}
Expand Down

0 comments on commit c11ba18

Please sign in to comment.