Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QL表达式支持翻译表达式吗? #366

Open
panda0120 opened this issue Dec 18, 2024 · 1 comment
Open

QL表达式支持翻译表达式吗? #366

panda0120 opened this issue Dec 18, 2024 · 1 comment

Comments

@panda0120
Copy link

比如运算表达式配置为:a > b,但是展示的时候翻译为存款 大于 贷款

@waydnow
Copy link

waydnow commented Dec 26, 2024

你的变量名称直接使用中文也可以实现上述需求。

`替换 if then else 等关键字
runner.addOperatorWithAlias("如果", "if", null);
runner.addOperatorWithAlias("则", "then", null);
runner.addOperatorWithAlias("否则", "else", null);

express = "如果 (语文 + 数学 + 英语 > 270) 则 {return 1;} 否则 {return 0;}";
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
runner.execute(express, context, null, false, false, null);

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants