fixed translation on blocks

This commit is contained in:
lingdocs 2022-06-28 12:30:53 -05:00
parent d4d8da58ce
commit 2719005a0f
1 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import {
renderAPSelection,
NPBlock,
APBlock,
getEnglishFromRendered,
} from "@lingdocs/pashto-inflector";
function BlockDiagram({ opts, children }: {
@ -14,11 +15,12 @@ function BlockDiagram({ opts, children }: {
const rendered = children.type === "AP"
? renderAPSelection(children)
: renderNPSelection(children, false, false, "subject", "none");
const english = getEnglishFromRendered(rendered);
return <div className="mb-3">
<div className="d-flex flex-row justify-content-center text-center" style={{ maxWidth: "100%" }}>
{rendered.type === "NP"
? <NPBlock script="f" opts={opts} english={rendered.selection.e}>{rendered}</NPBlock>
: <APBlock script="f" opts={opts} english={rendered.selection.e}>{rendered}</APBlock>}
? <NPBlock script="f" opts={opts} english={english}>{rendered}</NPBlock>
: <APBlock script="f" opts={opts} english={english}>{rendered}</APBlock>}
</div>
</div>;
} catch(e) {