Add support for RTL languages (#264)

This commit is contained in:
yinonburgansky 2021-03-08 13:51:36 +02:00 committed by GitHub
parent 6eb9159506
commit 6612e49710
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View file

@ -195,10 +195,10 @@ export default class TranslatePanel extends Component {
<div className="simple-translate-result-wrapper" ref="wrapper" style={wrapperStyles}> <div className="simple-translate-result-wrapper" ref="wrapper" style={wrapperStyles}>
<div className="simple-translate-move" draggable="true" ref="move"></div> <div className="simple-translate-move" draggable="true" ref="move"></div>
<div className="simple-translate-result-contents"> <div className="simple-translate-result-contents">
<p className="simple-translate-result" style={resultStyles}> <p className="simple-translate-result" style={resultStyles} dir="auto">
{splitLine(resultText)} {splitLine(resultText)}
</p> </p>
<p className="simple-translate-candidate" style={candidateStyles}> <p className="simple-translate-candidate" style={candidateStyles} dir="auto">
{splitLine(candidateText)} {splitLine(candidateText)}
</p> </p>
{isError && ( {isError && (

View file

@ -45,7 +45,6 @@
margin: 0; margin: 0;
font-family: "Segoe UI", "San Francisco", "Ubuntu", "Fira Sans", "Roboto", "Arial", font-family: "Segoe UI", "San Francisco", "Ubuntu", "Fira Sans", "Roboto", "Arial",
"Helvetica", sans-serif !important; "Helvetica", sans-serif !important;
text-align: left;
word-wrap: break-word; word-wrap: break-word;
font-size: inherit; font-size: inherit;
line-height: 150%; line-height: 150%;

View file

@ -38,6 +38,7 @@ export default class InputArea extends Component {
onChange={this.handleInputText} onChange={this.handleInputText}
autoFocus autoFocus
spellCheck={false} spellCheck={false}
dir="auto"
/> />
<div className="listen"> <div className="listen">
{sourceLang && <ListenButton text={inputText} lang={sourceLang} />} {sourceLang && <ListenButton text={inputText} lang={sourceLang} />}

View file

@ -26,8 +26,8 @@ export default props => {
return ( return (
<div id="resultArea"> <div id="resultArea">
<p className="resultText">{splitLine(resultText)}</p> <p className="resultText" dir="auto">{splitLine(resultText)}</p>
{shouldShowCandidate && <p className="candidateText">{splitLine(candidateText)}</p>} {shouldShowCandidate && <p className="candidateText" dir="auto">{splitLine(candidateText)}</p>}
{isError && <p className="error">{getErrorMessage(statusText)}</p>} {isError && <p className="error">{getErrorMessage(statusText)}</p>}
{isError && ( {isError && (
<p className="translateLink"> <p className="translateLink">

View file

@ -40,6 +40,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-end; justify-content: flex-end;
margin-top: 1em;
margin-right: 5px; margin-right: 5px;
& > * { & > * {
margin-left: 10px; margin-left: 10px;