Skip to content

Commit

Permalink
Add more functions to IntelliSense
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Jun 6, 2024
1 parent cc5bc41 commit 0aa6759
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 29 deletions.
29 changes: 24 additions & 5 deletions application/calculator/functiondatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FunctionDatabase::FunctionDatabase(QObject* parent) :
d->functions.insert("sqrt", {
"sqrt", {
{tr("Calculates the square root of a number"),
{{"x", tr("Number to calculate the square root of")}}},
{{"", tr("Number to calculate the square root of")}}},
}
});
d->functions.insert("cbrt", {
Expand All @@ -20,37 +20,56 @@ FunctionDatabase::FunctionDatabase(QObject* parent) :
{{"x", tr("Number to calculate the cube root of")}}},
}
});
d->functions.insert("root", {
"root", {
{tr("Calculates the nth root of a number"),
{{"x", tr("Number to calculate the nth root of")},
{tr("degree", "Polynomial degree"), tr("Degree of root to calculate")}}},
}
});
d->functions.insert("sin", {
"sin", {
{tr("Calculates the sine of an angle"),
{{"angle", tr("Angle to calculate the sine of")}}},
{{tr("angle"), tr("Angle to calculate the sine of")}}},
}
});
d->functions.insert("cos", {
"cos", {
{tr("Calculates the cosine of an angle"),
{{"angle", tr("Angle to calculate the cosine of")}}},
{{tr("angle"), tr("Angle to calculate the cosine of")}}},
}
});
d->functions.insert("tan", {
"tan", {
{tr("Calculates the tangent of an angle"),
{{"angle", tr("Angle to calculate the tangent of")}}},
{{tr("angle"), tr("Angle to calculate the tangent of")}}},
}
});
d->functions.insert("log", {
"log", {{tr("Calculates the logarithm (base 10) of a number"),
{{"x", tr("Number to take the logarithm of")}}},
{tr("Calculates the logarithm of a number, specifying a base"),
{{"x", tr("Number to take the logarithm of")},
{"base", tr("Base of the logarithm")}}}}
{tr("base"), tr("Base of the logarithm")}}}}
});
d->functions.insert("ln", {
"ln", {
{tr("Calculates the natural logarithm (base e) of a number"),
{{"x", tr("Number to take the natural logarithm of")}}},
}
});
d->functions.insert("abs", {
"abs", {
{tr("Calculates the absolute value of a number"),
{{"x", tr("Number to take the absolute value of")}}},
}
});
d->functions.insert("exp", {
"exp", {
{tr("Calculates e raised to the power of a number"),
{{"x", tr("Number to raise e to the power of")}}},
}
});
}

FunctionDatabase::~FunctionDatabase() {
Expand Down
77 changes: 65 additions & 12 deletions application/translations/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,65 +394,118 @@
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="25"/>
<source>Calculates the sine of an angle</source>
<source>Calculates the nth root of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="26"/>
<source>Number to calculate the nth root of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="27"/>
<source>degree</source>
<comment>Polynomial degree</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="27"/>
<source>Degree of root to calculate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="32"/>
<source>Calculates the sine of an angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="33"/>
<source>Angle to calculate the sine of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="31"/>
<location filename="../calculator/functiondatabase.cpp" line="33"/>
<location filename="../calculator/functiondatabase.cpp" line="39"/>
<location filename="../calculator/functiondatabase.cpp" line="45"/>
<source>angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="38"/>
<source>Calculates the cosine of an angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="32"/>
<location filename="../calculator/functiondatabase.cpp" line="39"/>
<source>Angle to calculate the cosine of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="37"/>
<location filename="../calculator/functiondatabase.cpp" line="44"/>
<source>Calculates the tangent of an angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="38"/>
<location filename="../calculator/functiondatabase.cpp" line="45"/>
<source>Angle to calculate the tangent of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="42"/>
<location filename="../calculator/functiondatabase.cpp" line="49"/>
<source>Calculates the logarithm (base 10) of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="43"/>
<location filename="../calculator/functiondatabase.cpp" line="45"/>
<location filename="../calculator/functiondatabase.cpp" line="50"/>
<location filename="../calculator/functiondatabase.cpp" line="52"/>
<source>Number to take the logarithm of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="44"/>
<location filename="../calculator/functiondatabase.cpp" line="51"/>
<source>Calculates the logarithm of a number, specifying a base</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="46"/>
<location filename="../calculator/functiondatabase.cpp" line="53"/>
<source>Base of the logarithm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="50"/>
<location filename="../calculator/functiondatabase.cpp" line="53"/>
<source>base</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="57"/>
<source>Calculates the natural logarithm (base e) of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="51"/>
<location filename="../calculator/functiondatabase.cpp" line="58"/>
<source>Number to take the natural logarithm of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="63"/>
<source>Calculates the absolute value of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="64"/>
<source>Number to take the absolute value of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="69"/>
<source>Calculates e raised to the power of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="70"/>
<source>Number to raise e to the power of</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Main</name>
Expand Down
77 changes: 65 additions & 12 deletions application/translations/vi_VN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,65 +394,118 @@
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="25"/>
<source>Calculates the sine of an angle</source>
<source>Calculates the nth root of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="26"/>
<source>Number to calculate the nth root of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="27"/>
<source>degree</source>
<comment>Polynomial degree</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="27"/>
<source>Degree of root to calculate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="32"/>
<source>Calculates the sine of an angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="33"/>
<source>Angle to calculate the sine of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="31"/>
<location filename="../calculator/functiondatabase.cpp" line="33"/>
<location filename="../calculator/functiondatabase.cpp" line="39"/>
<location filename="../calculator/functiondatabase.cpp" line="45"/>
<source>angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="38"/>
<source>Calculates the cosine of an angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="32"/>
<location filename="../calculator/functiondatabase.cpp" line="39"/>
<source>Angle to calculate the cosine of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="37"/>
<location filename="../calculator/functiondatabase.cpp" line="44"/>
<source>Calculates the tangent of an angle</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="38"/>
<location filename="../calculator/functiondatabase.cpp" line="45"/>
<source>Angle to calculate the tangent of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="42"/>
<location filename="../calculator/functiondatabase.cpp" line="49"/>
<source>Calculates the logarithm (base 10) of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="43"/>
<location filename="../calculator/functiondatabase.cpp" line="45"/>
<location filename="../calculator/functiondatabase.cpp" line="50"/>
<location filename="../calculator/functiondatabase.cpp" line="52"/>
<source>Number to take the logarithm of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="44"/>
<location filename="../calculator/functiondatabase.cpp" line="51"/>
<source>Calculates the logarithm of a number, specifying a base</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="46"/>
<location filename="../calculator/functiondatabase.cpp" line="53"/>
<source>Base of the logarithm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="50"/>
<location filename="../calculator/functiondatabase.cpp" line="53"/>
<source>base</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="57"/>
<source>Calculates the natural logarithm (base e) of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="51"/>
<location filename="../calculator/functiondatabase.cpp" line="58"/>
<source>Number to take the natural logarithm of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="63"/>
<source>Calculates the absolute value of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="64"/>
<source>Number to take the absolute value of</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="69"/>
<source>Calculates e raised to the power of a number</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../calculator/functiondatabase.cpp" line="70"/>
<source>Number to raise e to the power of</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Main</name>
Expand Down

0 comments on commit 0aa6759

Please sign in to comment.