Translation description for standard table.
--HG-- branch : develop
This commit is contained in:
parent
303d9da696
commit
eec161bee3
|
@ -170,7 +170,15 @@ void DialogStandardMeasurements::LoadStandardTables()
|
|||
}
|
||||
else
|
||||
{
|
||||
ui->comboBoxTables->addItem(m.Description(), QVariant(fi.absoluteFilePath()));
|
||||
const QString trDesc = qApp->STDescription(m.Id());
|
||||
if (trDesc.isEmpty() == false)
|
||||
{
|
||||
ui->comboBoxTables->addItem(trDesc, QVariant(fi.absoluteFilePath()));
|
||||
}
|
||||
else if (m.Description().isEmpty() == false)
|
||||
{
|
||||
ui->comboBoxTables->addItem(m.Description(), QVariant(fi.absoluteFilePath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (VException &e)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<xs:sequence>
|
||||
<xs:element name="version" type="formatVersion"></xs:element>
|
||||
<xs:element name="description" type="xs:string"></xs:element>
|
||||
<xs:element name="id" type="xs:unsignedInt" minOccurs="0" maxOccurs="1"></xs:element>
|
||||
<xs:element name="unit" type="units"></xs:element>
|
||||
<xs:element name="size">
|
||||
<xs:complexType>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<vst>
|
||||
<version>0.2.0</version>
|
||||
<version>0.3.0</version>
|
||||
<description>Типовые фигуры мужчин 1-й полнотной группы, обхват груди 100 см</description>
|
||||
<id>0</id>
|
||||
<unit>mm</unit>
|
||||
<size base="500"/>
|
||||
<height base="1760"/>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -3134,7 +3134,7 @@
|
|||
<context>
|
||||
<name>Functions</name>
|
||||
<message>
|
||||
<location filename="../../widgets/vapplication.cpp" line="+1205"/>
|
||||
<location filename="../../widgets/vapplication.cpp" line="+1207"/>
|
||||
<source>sin</source>
|
||||
<comment>sine function</comment>
|
||||
<translation>sin</translation>
|
||||
|
@ -7624,6 +7624,15 @@ Do you want to save your changes?</source>
|
|||
<translation>Переименовать лекало</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>STDescriptions</name>
|
||||
<message>
|
||||
<location filename="../../widgets/vapplication.cpp" line="+6"/>
|
||||
<source>Standard figures of men 1st group, chest 100 cm</source>
|
||||
<comment>Standard table description</comment>
|
||||
<translation>Типовые фигуры мужчин 1-й полнотной группы, обхват груди 100 см</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SaveDetailOptions</name>
|
||||
<message>
|
||||
|
@ -7836,7 +7845,7 @@ Do you want to save your changes?</source>
|
|||
<translation type="vanished">Ошибка!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../widgets/vapplication.cpp" line="-1126"/>
|
||||
<location filename="../../widgets/vapplication.cpp" line="-1132"/>
|
||||
<source>Error parsing file. Program will be terminated.</source>
|
||||
<translation>Ошибка парсинга файла. Програма будет закрыта.</translation>
|
||||
</message>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -57,7 +57,8 @@ VApplication::VApplication(int &argc, char **argv)
|
|||
_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>()),
|
||||
postfixOperators(QMap<QString, VTranslation>()), undoStack(nullptr), sceneView(nullptr), currentScene(nullptr),
|
||||
postfixOperators(QMap<QString, VTranslation>()), stDescriptions(QMap<QString, VTranslation>()),
|
||||
undoStack(nullptr), sceneView(nullptr), currentScene(nullptr),
|
||||
autoSaveTimer(nullptr), mainWindow(nullptr), openingPattern(false), settings(nullptr), doc(nullptr)
|
||||
{
|
||||
undoStack = new QUndoStack(this);
|
||||
|
@ -67,6 +68,7 @@ VApplication::VApplication(int &argc, char **argv)
|
|||
InitVariables();
|
||||
InitFunctions();
|
||||
InitPostfixOperators();
|
||||
InitSTDescriptions();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -1237,6 +1239,14 @@ void VApplication::InitPostfixOperators()
|
|||
postfixOperators.insert(in_Oprt, VTranslation::translate("PostfixOperators", "in", "inch"));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VApplication::InitSTDescriptions()
|
||||
{
|
||||
stDescriptions.insert("0", VTranslation::translate("STDescriptions",
|
||||
"Standard figures of men 1st group, chest 100 cm",
|
||||
"Standard table description"));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
||||
{
|
||||
|
@ -1767,3 +1777,17 @@ QStringList VApplication::LabelLanguages()
|
|||
};
|
||||
return list;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VApplication::STDescription(const QString &id) const
|
||||
{
|
||||
if (stDescriptions.contains(id))
|
||||
{
|
||||
return stDescriptions.value(id).translate();
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning()<<"Unknown id number. Got"<<id;
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ public:
|
|||
static void restoreOverrideCursor(const QString & pixmapPath);
|
||||
|
||||
static QStringList LabelLanguages();
|
||||
QString STDescription(const QString &id)const;
|
||||
private:
|
||||
Q_DISABLE_COPY(VApplication)
|
||||
Unit _patternUnit;
|
||||
|
@ -112,6 +113,7 @@ private:
|
|||
QMap<QString, VTranslation> variables;
|
||||
QMap<QString, VTranslation> functions;
|
||||
QMap<QString, VTranslation> postfixOperators;
|
||||
QMap<QString, VTranslation> stDescriptions;
|
||||
QUndoStack *undoStack;
|
||||
VMainGraphicsView *sceneView;
|
||||
VMainGraphicsScene *currentScene;
|
||||
|
@ -137,6 +139,7 @@ private:
|
|||
void InitVariables();
|
||||
void InitFunctions();
|
||||
void InitPostfixOperators();
|
||||
void InitSTDescriptions();
|
||||
bool MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const;
|
||||
bool VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const;
|
||||
bool PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token,
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
VIT_VERSION is (major << 16) + (minor << 8) + patch.
|
||||
*/
|
||||
// version without patch part
|
||||
#define VIT_MIN_VERSION 0x000100
|
||||
#define VIT_MIN_VERSION 0x000200
|
||||
// max support version of format
|
||||
#define VIT_VERSION 0x000100
|
||||
#define VIT_VERSION 0x000200
|
||||
|
||||
enum class SexType : char { Male, Female };
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "../widgets/vapplication.h"
|
||||
|
||||
const QString VStandardMeasurements::TagDescription = QStringLiteral("description");
|
||||
const QString VStandardMeasurements::TagId = QStringLiteral("id");
|
||||
const QString VStandardMeasurements::TagSize = QStringLiteral("size");
|
||||
const QString VStandardMeasurements::TagHeight = QStringLiteral("height");
|
||||
const QString VStandardMeasurements::AttrSize_increase = QStringLiteral("size_increase");
|
||||
|
@ -58,6 +59,17 @@ QString VStandardMeasurements::Description()
|
|||
return desc;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VStandardMeasurements::Id()
|
||||
{
|
||||
const QString id = UniqueTagText(TagId, "");
|
||||
if (id.isEmpty())
|
||||
{
|
||||
qWarning()<<"Empty id value in standard table."<<Q_FUNC_INFO;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VStandardMeasurements::ReadMeasurement(const QDomElement &domElement, const QString &tag)
|
||||
{
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
VST_VERSION is (major << 16) + (minor << 8) + patch.
|
||||
*/
|
||||
// version without patch part
|
||||
#define VST_MIN_VERSION 0x000100
|
||||
#define VST_MIN_VERSION 0x000300
|
||||
// max support version of format
|
||||
#define VST_VERSION 0x000100
|
||||
#define VST_VERSION 0x000300
|
||||
|
||||
class VStandardMeasurements:public VAbstractMeasurements
|
||||
{
|
||||
|
@ -45,10 +45,12 @@ public:
|
|||
VStandardMeasurements(VContainer *data);
|
||||
virtual ~VStandardMeasurements();
|
||||
QString Description();
|
||||
QString Id();
|
||||
void SetSize();
|
||||
void SetHeight();
|
||||
static const QString TagMeasurement;
|
||||
static const QString TagDescription;
|
||||
static const QString TagId;
|
||||
static const QString TagSize;
|
||||
static const QString TagHeight;
|
||||
static const QString AttrSize_increase;
|
||||
|
|
Loading…
Reference in New Issue
Block a user