Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Commit

Permalink
fix(text direction): display arabic in RTL
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-arn committed Jan 6, 2020
1 parent 35c214a commit e93a394
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions views/demo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ export default class Demo extends Component {
const {
ssml, ssml_voice, voice, loading, hasAudio, ssmlLabel, error, text,
} = this.state;

const textDirection = (voice && voice.language === 'ar-AR') ? 'rtl' : 'ltr';

return (
<section className="_container _container_large">
<div className="row">
Expand Down Expand Up @@ -249,13 +252,13 @@ export default class Demo extends Component {

<Tabs selected={0} onChange={this.onTabChange}>
<Pane label="Text">
<textarea onChange={this.onTextChange} className="base--textarea textarea" spellCheck="false" value={text || ''} />
<textarea onChange={this.onTextChange} className="base--textarea textarea" dir={textDirection} spellCheck="false" value={text || ''} />
</Pane>
<Pane label={ssmlLabel}>
<textarea onChange={this.onSsmlChange} className="base--textarea textarea" spellCheck="false" value={ssml || ''} />
<textarea onChange={this.onSsmlChange} className="base--textarea textarea" dir={textDirection} spellCheck="false" value={ssml || ''} />
</Pane>
<Pane label="Voice Transformation SSML">
<textarea readOnly={!ssml_voice} onChange={this.onVoiceSsmlChange} className="base--textarea textarea" spellCheck="false" value={ssml_voice || 'Voice Transformation not currently supported for this voice.'} />
<textarea readOnly={!ssml_voice} onChange={this.onVoiceSsmlChange} dir={textDirection} className="base--textarea textarea" spellCheck="false" value={ssml_voice || 'Voice Transformation not currently supported for this voice.'} />
</Pane>
</Tabs>
<div className="output-container">
Expand Down

0 comments on commit e93a394

Please sign in to comment.