Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK-548] NLP add rtl script support #4904

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jsapp/js/components/common/textBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default function TextBox(props: TextBoxProps) {
// For `number` type we allow only positive integers
step: props.type === 'number' ? 1 : undefined,
min: props.type === 'number' ? 0 : undefined,
dir: 'auto',
};

// For now we only support one size of TextBox, but when we're going to
Expand Down
4 changes: 3 additions & 1 deletion jsapp/js/components/processing/sidebar/transxDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export default function TransxDisplay(props: TransxDisplayProps) {
{renderLanguageAndDate()}
</header>

<article className={bodyStyles.text}>{props.transx.value}</article>
<article className={bodyStyles.text} dir='auto'>
{props.transx.value}
</article>
</div>
</section>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default function StepEditor() {
setDraftValue(evt.target.value);
}}
disabled={singleProcessingStore.data.isFetchingData}
dir='auto'
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function StepViewer() {
</nav>
</header>

<article className={bodyStyles.text}>
<article className={bodyStyles.text} dir='auto'>
{singleProcessingStore.getTranscript()?.value}
</article>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default function StepEditor(props: StepEditorProps) {
setDraftValue(evt.target.value);
}}
disabled={singleProcessingStore.data.isFetchingData}
dir='auto'
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function StepSingleViewer(props: StepSingleViewerProps) {
</div>
</header>

<article className={bodyStyles.text}>
<article className={bodyStyles.text} dir='auto'>
{singleProcessingStore.getTranslation(props.selectedTranslation)?.value}
</article>
</div>
Expand Down
8 changes: 5 additions & 3 deletions jsapp/js/components/submissions/table.es6
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,9 @@ export class DataTable extends React.Component {
);

return (
<span className='trimmed-text'>{supplementalDetailsContent}</span>
<span className='trimmed-text' dir='auto'>
{supplementalDetailsContent}
</span>
);
}

Expand All @@ -942,15 +944,15 @@ export class DataTable extends React.Component {
if (repeatGroupAnswers) {
// display a list of answers from a repeat group question
return (
<span className='trimmed-text'>
<span className='trimmed-text' dir='auto'>
{repeatGroupAnswers.join(', ')}
</span>
);
} else {
return '';
}
} else {
return <span className='trimmed-text'>{row.value}</span>;
return <span className='trimmed-text' dir='auto'>{row.value}</span>;
}
},
});
Expand Down
2 changes: 1 addition & 1 deletion kpi/templates/base_simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% load static %}
<!doctype html>
<html>
<html dir="auto">
Copy link
Contributor

@LMNTL LMNTL Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this line do anything? As you noted in the PR description, dir="auto" doesn't appear to transfer down to child elements. I can't find a difference on /accounts/login/ - the layout, text direction, and input text direction appear to all stay the same as on beta, whether using an RTL or LTR language.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that although it doesn't transfer down, it does something sometimes :P I tried to find any documentation or SO question that would confirm that, but there is nothing. I removed it

<head>
<!-- Setup -->
<meta charset="utf-8">
Expand Down
Loading