From 759d3d8d86d79e281d01e0d517cb3feae74f8f12 Mon Sep 17 00:00:00 2001 From: dismine Date: Sat, 21 Dec 2013 16:21:40 +0200 Subject: [PATCH] TODO translation into English. --HG-- branch : develop --- src/container/calculator.cpp | 11 ++++--- src/container/vcontainer.cpp | 11 ++++--- src/geometry/vspline.cpp | 3 +- src/tablewindow.cpp | 38 ++++++++---------------- src/tools/drawTools/vtoollinepoint.cpp | 2 -- src/tools/drawTools/vtoolsinglepoint.cpp | 7 ++--- src/tools/vabstracttool.cpp | 13 ++++---- src/tools/vtooldetail.cpp | 3 +- src/widgets/vcontrolpointspline.cpp | 14 ++++----- src/widgets/vitem.cpp | 9 ++---- src/widgets/vtablegraphicsview.cpp | 3 +- 11 files changed, 42 insertions(+), 72 deletions(-) diff --git a/src/container/calculator.cpp b/src/container/calculator.cpp index 4807a03ce..cc625a6e6 100644 --- a/src/container/calculator.cpp +++ b/src/container/calculator.cpp @@ -217,14 +217,13 @@ qreal Calculator::find_var(QString s) void Calculator::serror(qint32 error) { - //TODO please translate text down here into english QString e[]= { - "Синтаксическая ошибка", - "Непарные круглые скобки", - "Это не выражение", - "Предполагается символ равенства", - "Не переменная" + "Syntax error", + "Parentheses do not match", + "This is not the expression", + "Assumed the equality symbol", + "Do not a variable" }; errorMsg->clear(); *errorMsg = e[error]; diff --git a/src/container/vcontainer.cpp b/src/container/vcontainer.cpp index 979b675d2..1e3f186a9 100644 --- a/src/container/vcontainer.cpp +++ b/src/container/vcontainer.cpp @@ -346,30 +346,29 @@ QPainterPath VContainer::Equidistant(QVector points, const Detail::Equi } for (qint32 i = 0; i < points.size(); ++i ) { - //TODO please translate comments into english if ( i == 0 && eqv == Detail::CloseEquidistant) - {//перша точка, ламана замкнена + {//first point, polyline closed ekvPoints<setupUi(this); - numberDetal = new QLabel("Залишилось 0 деталей.", this); - colission = new QLabel("Колізій не знайдено.", this); + numberDetal = new QLabel(tr("Left 0 details."), this); + colission = new QLabel(tr("Collisions not found."), this); ui->statusBar->addWidget(numberDetal); ui->statusBar->addWidget(colission); outItems = collidingItems = false; @@ -112,11 +110,11 @@ void TableWindow::AddDetail() ui->actionSave->setEnabled(true); } } - numberDetal->setText(QString("Залишилось %1 деталей.").arg(listDetails.count()-indexDetail)); + numberDetal->setText(QString(tr("Left %1 details.")).arg(listDetails.count()-indexDetail)); } /* - * Отримуємо деталі розрахованої моделі для подальшого укладання. + * Get details for creation layout. */ void TableWindow::ModelChosen(QVector listDetails) { @@ -169,7 +167,7 @@ void TableWindow::saveScene() QBrush *brush = new QBrush(); brush->setColor( QColor( Qt::white ) ); currentScene->setBackgroundBrush( *brush ); - currentScene->clearSelection(); // Selections would also render to the file + currentScene->clearSelection(); // Selections would also render to the file, so need delete them shadowPaper->setVisible(false); QFileInfo fi(name); if (fi.suffix() == "svg") @@ -202,7 +200,7 @@ void TableWindow::checkNext() { if (outItems == true && collidingItems == true) { - colission->setText("Колізій не знайдено."); + colission->setText(tr("Collisions not found.")); if (indexDetail==listDetails.count()) { ui->actionSave->setEnabled(true); @@ -216,7 +214,7 @@ void TableWindow::checkNext() } else { - colission->setText("Знайдено колізії."); + colission->setText(tr("Collisions found.")); ui->actionNext->setDisabled(true); ui->actionSave->setEnabled(false); } @@ -257,14 +255,8 @@ void TableWindow::itemColliding(QList list, int number) if (lis.size()-2 <= 0) { VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(i) ); - if (bitem == 0) - { - qDebug()<<"Не можу привести тип об'єкту"; - } - else - { - bitem->setPen(QPen(Qt::black, widthMainLine)); - } + Q_ASSERT(bitem != 0); + bitem->setPen(QPen(Qt::black, widthMainLine)); listCollidingItems.removeAt(i); } } @@ -272,14 +264,8 @@ void TableWindow::itemColliding(QList list, int number) else if (listCollidingItems.size()==1) { VItem * bitem = qgraphicsitem_cast ( listCollidingItems.at(0) ); - if (bitem == 0) - { - qDebug()<<"Не можу привести тип об'єкту"; - } - else - { - bitem->setPen(QPen(Qt::black, widthMainLine)); - } + Q_ASSERT(bitem != 0); + bitem->setPen(QPen(Qt::black, widthMainLine)); listCollidingItems.clear(); collidingItems = true; } @@ -369,7 +355,7 @@ void TableWindow::keyPressEvent ( QKeyEvent * event ) if (ui->actionNext->isEnabled() == true ) { AddDetail(); - qDebug()<<"Додали деталь."; + qDebug()<<"Added detail."; } } QMainWindow::keyPressEvent ( event ); diff --git a/src/tools/drawTools/vtoollinepoint.cpp b/src/tools/drawTools/vtoollinepoint.cpp index 6b612c2c6..00a77acfe 100644 --- a/src/tools/drawTools/vtoollinepoint.cpp +++ b/src/tools/drawTools/vtoollinepoint.cpp @@ -35,8 +35,6 @@ VToolLinePoint::VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64 mainLine(0) { Q_ASSERT_X(basePointId > 0, Q_FUNC_INFO, "basePointId <= 0"); - //TODO please translate comment - //Лінія, що з'єднує дві точки QPointF point1 = data->GetPoint(basePointId).toQPointF(); QPointF point2 = data->GetPoint(id).toQPointF(); mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this); diff --git a/src/tools/drawTools/vtoolsinglepoint.cpp b/src/tools/drawTools/vtoolsinglepoint.cpp index 2342378f4..b8f56cf21 100644 --- a/src/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/tools/drawTools/vtoolsinglepoint.cpp @@ -66,17 +66,16 @@ void VToolSinglePoint::AddToFile() AddToCalculation(domElement); } -//TODO please translate comments into english QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) { if (change == ItemPositionChange && scene()) { - // value - это новое положение. + // value - this is new position. QPointF newPos = value.toPointF(); QRectF rect = scene()->sceneRect(); if (rect.contains(newPos) == false) { - // Сохраняем элемент внутри прямоугольника сцены. + // Save element into rect of scene. newPos.setX(qMin(rect.right(), qMax(newPos.x(), rect.left()))); newPos.setY(qMin(rect.bottom(), qMax(newPos.y(), rect.top()))); return newPos; @@ -84,7 +83,7 @@ QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, } if (change == ItemPositionHasChanged && scene()) { - // value - это новое положение. + // value - this is new position. QPointF newPos = value.toPointF(); QDomElement domElement = doc->elementById(QString().setNum(id)); if (domElement.isElement()) diff --git a/src/tools/vabstracttool.cpp b/src/tools/vabstracttool.cpp index af9fe1005..21a7b02af 100644 --- a/src/tools/vabstracttool.cpp +++ b/src/tools/vabstracttool.cpp @@ -26,7 +26,6 @@ ** *************************************************************************/ -//TODO please translate comments into english #include "vabstracttool.h" const QString VAbstractTool::AttrId = QStringLiteral("id"); @@ -107,12 +106,12 @@ qint32 VAbstractTool::LineIntersectCircle(const QPointF ¢er, qreal radius, c QPointF &p2) { const qreal eps = 1e-8; - //коефіцієнти для рівняння відрізку + //coefficient for equation of segment qreal a = 0, b = 0, c = 0; LineCoefficients(line, &a, &b, &c); - // проекция центра окружности на прямую + // projection center of circle on to line QPointF p = ClosestPoint (line, center); - // сколько всего решений? + // how many solutions? qint32 flag = 0; qreal d = QLineF (center, p).length(); if (qAbs (d - radius) <= eps) @@ -130,10 +129,10 @@ qint32 VAbstractTool::LineIntersectCircle(const QPointF ¢er, qreal radius, c return 0; } } - // находим расстояние от проекции до точек пересечения + // find distance from projection to points of intersection qreal k = sqrt (radius * radius - d * d); qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length(); - // добавляем к проекции векторы направленные к точкам пеерсечения + // add to projection a vectors aimed to points of intersection p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t); p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t); return flag; @@ -180,7 +179,7 @@ void VAbstractTool::RemoveAllChild(QDomElement &domElement) void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c) { - //коефіцієнти для рівняння відрізку + //coefficient for equation of segment QPointF p1 = line.p1(); *a = line.p2().y() - p1.y(); *b = p1.x() - line.p2().x(); diff --git a/src/tools/vtooldetail.cpp b/src/tools/vtooldetail.cpp index b38428b14..5b30f986c 100644 --- a/src/tools/vtooldetail.cpp +++ b/src/tools/vtooldetail.cpp @@ -219,8 +219,7 @@ QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const { if (change == ItemPositionHasChanged && scene()) { - //TODO please translate into english - // value - это новое положение. + // value - this is new position. QPointF newPos = value.toPointF(); //qDebug()<elementById(QString().setNum(id)); diff --git a/src/widgets/vcontrolpointspline.cpp b/src/widgets/vcontrolpointspline.cpp index d8686d1ee..754ae0f7a 100644 --- a/src/widgets/vcontrolpointspline.cpp +++ b/src/widgets/vcontrolpointspline.cpp @@ -25,7 +25,6 @@ ** along with Valentina. If not, see . ** *************************************************************************/ -//TODO if this class is still in use: please translate all ukrainian text into english #include "vcontrolpointspline.h" @@ -48,7 +47,6 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePoint: this->setAcceptHoverEvents(true); this->setPos(controlPoint); - //Лінія, що з'єднує дві точки QPointF p1, p2; LineIntersectCircle(QPointF(), radius, QLineF( QPointF(), splinePoint-controlPoint), p1, p2); controlLine = new QGraphicsLineItem(QLineF(splinePoint-controlPoint, p1), this); @@ -83,14 +81,14 @@ qint32 VControlPointSpline::LineIntersectCircle(const QPointF ¢er, qreal rad QPointF &p2) const { const qreal eps = 1e-8; - //коефіцієнти для рівняння відрізку + //coefficient for equation of segment qreal a = line.p2().y() - line.p1().y(); qreal b = line.p1().x() - line.p2().x(); - // В даному випадку не використовується. + // In this case does not used. //qreal c = - a * line.p1().x() - b * line.p1().y(); - // проекция центра окружности на прямую + // projection center of circle on to line QPointF p = ClosestPoint (line, center); - // сколько всего решений? + // how many solutions? qint32 flag = 0; qreal d = QLineF (center, p).length(); if (qAbs (d - radius) <= eps) @@ -108,10 +106,10 @@ qint32 VControlPointSpline::LineIntersectCircle(const QPointF ¢er, qreal rad return 0; } } - // находим расстояние от проекции до точек пересечения + // find distance from projection to points of intersection qreal k = sqrt (radius * radius - d * d); qreal t = QLineF (QPointF (0, 0), QPointF (b, - a)).length(); - // добавляем к проекции векторы направленные к точкам пеерсечения + // add to projection a vectors aimed to points of intersection p1 = addVector (p, QPointF (0, 0), QPointF (- b, a), k / t); p2 = addVector (p, QPointF (0, 0), QPointF (b, - a), k / t); return flag; diff --git a/src/widgets/vitem.cpp b/src/widgets/vitem.cpp index 666ce1c7e..536761501 100644 --- a/src/widgets/vitem.cpp +++ b/src/widgets/vitem.cpp @@ -25,7 +25,6 @@ ** along with Valentina. If not, see . ** *************************************************************************/ -//TODO if this class is still in use: please translate all ukrainian text into english #include "vitem.h" #include "../options.h" @@ -52,13 +51,11 @@ void VItem::checkItemChange() QRectF myrect = sceneBoundingRect(); if ( rect.contains( myrect )==true ) { - qDebug()<<"Не виходить за рамки листа"; setPen(QPen(Qt::black, widthMainLine)); emit itemOut( numInOutList, false ); } else { - qDebug()<<"Виходить за рамки листа"; setPen(QPen(Qt::red, widthMainLine)); emit itemOut( numInOutList, true ); } @@ -67,15 +64,13 @@ void VItem::checkItemChange() { list.append( this ); setPen(QPen(Qt::red, widthMainLine)); - qDebug()<<"Деталь перетинається з іншими деталями "< itemList; itemList.append( this ); - qDebug()<<"Деталь більше не перетинається з іншими деталями "<delta())>0) { ZoomIn();