Initialization translation for postfix operators.

--HG--
branch : feature
This commit is contained in:
dismine 2014-05-23 10:14:21 +03:00
parent ccde48e3bf
commit b94ab9bda6
2 changed files with 14 additions and 2 deletions

View File

@ -46,12 +46,14 @@ VApplication::VApplication(int &argc, char **argv)
: QApplication(argc, argv), _patternUnit(Valentina::Cm), _patternType(Pattern::Individual),
_widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), measurements(QMap<QString, VTranslation>()),
guiTexts(QMap<QString, VTranslation>()), descriptions(QMap<QString, VTranslation>()),
variables(QMap<QString, VTranslation>()), functions(QMap<QString, VTranslation>())
variables(QMap<QString, VTranslation>()), functions(QMap<QString, VTranslation>()),
postfixOperators(QMap<QString, VTranslation>())
{
InitLineWidth();
InitMeasurements();
InitVariables();
InitFunctions();
InitPostfixOperators();
}
//---------------------------------------------------------------------------------------------------------------------
@ -630,6 +632,15 @@ void VApplication::InitFunctions()
functions.insert(avg_F, VTranslation::translate(context, avg_F, QStringLiteral("mean value of all arguments")));
}
void VApplication::InitPostfixOperators()
{
const QString context = QStringLiteral("PostfixOperators");
postfixOperators.insert(cm_Oprt, VTranslation::translate(context, cm_Oprt, QStringLiteral("centimeter")));
postfixOperators.insert(mm_Oprt, VTranslation::translate(context, mm_Oprt, QStringLiteral("millimeter")));
postfixOperators.insert(in_Oprt, VTranslation::translate(context, in_Oprt, QStringLiteral("inch")));
}
//---------------------------------------------------------------------------------------------------------------------
void VApplication::setPatternUnit(const Valentina::Units &patternUnit)
{

View File

@ -87,12 +87,13 @@ private:
QMap<QString, VTranslation> descriptions;
QMap<QString, VTranslation> variables;
QMap<QString, VTranslation> functions;
QMap<QString, VTranslation> postfixOperators;
void InitLineWidth();
void InitMeasurements();
void InitMeasurement(const QString &measurement, const QString &guiText, const QString & desc);
void InitVariables();
void InitFunctions();
void InitPostfixOperators();
};
inline Valentina::Units VApplication::patternUnit() const