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