fix: formula hint translation

This commit is contained in:
zyc9012 2022-05-18 14:35:49 +08:00
parent 06ac237bb3
commit 4d2a308367
2 changed files with 10 additions and 6 deletions

View File

@ -11961,8 +11961,8 @@ export default {
execfunctionSelfErrorResult:
"The formula cannot refer to its own cell, which will lead to inaccurate calculation results",
allowRepeatText: "Repeat",
allowOptionText: "Option",
allowRepeatText: "Repeatable",
allowOptionText: "Optional",
selectCategory: "Or select a category",
},

View File

@ -1,9 +1,11 @@
import { locale } from "@fortune-sheet/core";
import React, { useContext } from "react";
import WorkbookContext from "../../../context";
import "./index.css";
const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
const { context } = useContext(WorkbookContext);
const { formulaMore } = locale(context);
if (!context.functionHint) return null;
const fn = context.formulaCache.functionlistMap[context.functionHint];
@ -53,7 +55,9 @@ const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
</div>
<div className="luckysheet-formula-help-content">
<div className="luckysheet-formula-help-content-example">
<div className="luckysheet-arguments-help-section-title"></div>
<div className="luckysheet-arguments-help-section-title">
{formulaMore.helpExample}
</div>
<div className="luckysheet-arguments-help-formula">
<span className="luckysheet-arguments-help-function-name">
{fn.n}
@ -77,7 +81,7 @@ const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
<div className="luckysheet-formula-help-content-detail">
<div className="luckysheet-arguments-help-section">
<div className="luckysheet-arguments-help-section-title luckysheet-arguments-help-parameter-name">
{formulaMore.helpAbstract}
</div>
<span className="luckysheet-arguments-help-parameter-content">
{fn.d}
@ -91,12 +95,12 @@ const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
{param.name}
{param.repeat === "y" && (
<span className="luckysheet-arguments-help-argument-info">
...-
...-{formulaMore.allowRepeatText}
</span>
)}
{param.require === "o" && (
<span className="luckysheet-arguments-help-argument-info">
-[]
-[{formulaMore.allowOptionText}]
</span>
)}
</div>