Do not translate formulas, but localize decimal character.

This commit is contained in:
Roman Telezhynskyi 2024-01-06 15:47:59 +02:00
parent cb5b85435f
commit 3f5371321b

View File

@ -704,12 +704,6 @@ auto VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator) c
return formula;
}
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
if (!settings->IsTranslateFormula())
{
return formula;
}
// Eval formula
QScopedPointer<qmu::QmuTokenParser> cal(
new qmu::QmuTokenParser(formula, osSeparator, true, GetTranslatedFunctions()));
@ -719,7 +713,12 @@ auto VTranslateVars::FormulaFromUser(const QString &formula, bool osSeparator) c
QString newFormula = formula; // Local copy for making changes
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
if (settings->IsTranslateFormula())
{
TranslateVarsFromUser(newFormula, tokens, numbers);
}
TranslateNumbersFromUser(newFormula, tokens, numbers, osSeparator);
return newFormula;
@ -754,12 +753,6 @@ auto VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator) con
return formula;
}
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
if (!settings->IsTranslateFormula())
{
return formula;
}
QString newFormula = formula; // Local copy for making changes
QMap<vsizetype, QString> tokens;
@ -780,7 +773,12 @@ auto VTranslateVars::FormulaToUser(const QString &formula, bool osSeparator) con
return newFormula;
}
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
if (settings->IsTranslateFormula())
{
TranslateVarsToUser(newFormula, tokens, numbers);
}
TranslateNumbersToUser(newFormula, tokens, numbers, osSeparator);
return newFormula;