From be9689dfac0ff0bd8741d3890a30a2db3fd6013e Mon Sep 17 00:00:00 2001 From: tjcouch-sil Date: Fri, 13 Sep 2024 14:14:13 -0500 Subject: [PATCH] Support RTL for OHEBGRK --- .../src/platform-scripture-editor.web-view.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/src/platform-scripture-editor/src/platform-scripture-editor.web-view.tsx b/extensions/src/platform-scripture-editor/src/platform-scripture-editor.web-view.tsx index 7f58803db6..f3aaa7d2c6 100644 --- a/extensions/src/platform-scripture-editor/src/platform-scripture-editor.web-view.tsx +++ b/extensions/src/platform-scripture-editor/src/platform-scripture-editor.web-view.tsx @@ -6,11 +6,11 @@ import { MarginalRef, } from '@biblionexus-foundation/platform-editor'; import { Usj } from '@biblionexus-foundation/scripture-utilities'; -import { VerseRef } from '@sillsdev/scripture'; +import { Canon, VerseRef } from '@sillsdev/scripture'; import { JSX, useCallback, useEffect, useMemo, useRef } from 'react'; import type { WebViewProps } from '@papi/core'; import { logger } from '@papi/frontend'; -import { useProjectData } from '@papi/frontend/react'; +import { useProjectData, useProjectSetting } from '@papi/frontend/react'; import { ScriptureReference, debounce } from 'platform-bible-utils'; import { Button } from 'platform-bible-react'; @@ -172,13 +172,15 @@ globalThis.webViewComponent = function PlatformScriptureEditor({ }; }, [scrRef]); + const [projectName] = useProjectSetting(projectId, 'platform.name', ''); + const options = useMemo( () => ({ isReadonly: isReadOnly, hasSpellCheck: false, - textDirection: 'ltr', + textDirection: projectName === 'OHEBGRK' && Canon.isBookOT(scrRef.bookNum) ? 'rtl' : 'ltr', }), - [isReadOnly], + [isReadOnly, projectName, scrRef], ); return (