Swap order of translation restoration and service credit

Swapping them moves the "show original" link to the same location where the "translate" link was, increasing the likelihood that a user need not move the pointer to restore the original— but not guaranteeing it.

Further reasoning: As a language learner, it's educational to follow accounts posting in the language I'm learning. I use the "translate" feature to confirm my understanding or teach me vocabulary I don't know. I will sometimes swap between the original and the translated version multiple times. This small UX tweak dramatically decreases the chance that one must move their pointer at all, whereas before, the "show original" link was _always_ on the other side of the box and required pointer movement.
This commit is contained in:
Colin Dean 2025-01-16 11:30:08 -05:00 committed by GitHub
parent 3af6739f21
commit 01a5e9df36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,13 +43,13 @@ class TranslateButton extends PureComponent {
return (
<div className='translate-button'>
<div className='translate-button__meta'>
<FormattedMessage id='status.translated_from_with' defaultMessage='Translated from {lang} using {provider}' values={{ lang: languageName, provider }} />
</div>
<button className='link-button' onClick={onClick}>
<FormattedMessage id='status.show_original' defaultMessage='Show original' />
</button>
<div className='translate-button__meta'>
<FormattedMessage id='status.translated_from_with' defaultMessage='Translated from {lang} using {provider}' values={{ lang: languageName, provider }} />
</div>
</div>
);
}