mirror of
https://github.com/ruilisi/fortune-sheet.git
synced 2025-01-08 11:47:38 +08:00
fix: formula hint translation
This commit is contained in:
parent
06ac237bb3
commit
4d2a308367
@ -11961,8 +11961,8 @@ export default {
|
|||||||
execfunctionSelfErrorResult:
|
execfunctionSelfErrorResult:
|
||||||
"The formula cannot refer to its own cell, which will lead to inaccurate calculation results",
|
"The formula cannot refer to its own cell, which will lead to inaccurate calculation results",
|
||||||
|
|
||||||
allowRepeatText: "Repeat",
|
allowRepeatText: "Repeatable",
|
||||||
allowOptionText: "Option",
|
allowOptionText: "Optional",
|
||||||
|
|
||||||
selectCategory: "Or select a category",
|
selectCategory: "Or select a category",
|
||||||
},
|
},
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
import { locale } from "@fortune-sheet/core";
|
||||||
import React, { useContext } from "react";
|
import React, { useContext } from "react";
|
||||||
import WorkbookContext from "../../../context";
|
import WorkbookContext from "../../../context";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
|
const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
|
||||||
const { context } = useContext(WorkbookContext);
|
const { context } = useContext(WorkbookContext);
|
||||||
|
const { formulaMore } = locale(context);
|
||||||
if (!context.functionHint) return null;
|
if (!context.functionHint) return null;
|
||||||
|
|
||||||
const fn = context.formulaCache.functionlistMap[context.functionHint];
|
const fn = context.formulaCache.functionlistMap[context.functionHint];
|
||||||
@ -53,7 +55,9 @@ const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="luckysheet-formula-help-content">
|
<div className="luckysheet-formula-help-content">
|
||||||
<div className="luckysheet-formula-help-content-example">
|
<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">
|
<div className="luckysheet-arguments-help-formula">
|
||||||
<span className="luckysheet-arguments-help-function-name">
|
<span className="luckysheet-arguments-help-function-name">
|
||||||
{fn.n}
|
{fn.n}
|
||||||
@ -77,7 +81,7 @@ const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
|
|||||||
<div className="luckysheet-formula-help-content-detail">
|
<div className="luckysheet-formula-help-content-detail">
|
||||||
<div className="luckysheet-arguments-help-section">
|
<div className="luckysheet-arguments-help-section">
|
||||||
<div className="luckysheet-arguments-help-section-title luckysheet-arguments-help-parameter-name">
|
<div className="luckysheet-arguments-help-section-title luckysheet-arguments-help-parameter-name">
|
||||||
摘要
|
{formulaMore.helpAbstract}
|
||||||
</div>
|
</div>
|
||||||
<span className="luckysheet-arguments-help-parameter-content">
|
<span className="luckysheet-arguments-help-parameter-content">
|
||||||
{fn.d}
|
{fn.d}
|
||||||
@ -91,12 +95,12 @@ const FormulaHint: React.FC<React.HTMLAttributes<HTMLDivElement>> = (props) => {
|
|||||||
{param.name}
|
{param.name}
|
||||||
{param.repeat === "y" && (
|
{param.repeat === "y" && (
|
||||||
<span className="luckysheet-arguments-help-argument-info">
|
<span className="luckysheet-arguments-help-argument-info">
|
||||||
...-可重复
|
...-{formulaMore.allowRepeatText}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{param.require === "o" && (
|
{param.require === "o" && (
|
||||||
<span className="luckysheet-arguments-help-argument-info">
|
<span className="luckysheet-arguments-help-argument-info">
|
||||||
-[可选]
|
-[{formulaMore.allowOptionText}]
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user