FreeCAD / FreeCAD-translations

Repository tracking localization issues and progress
5 stars 3 forks source link

TechDraw → object names for view tools #264

Closed kaktusus closed 9 months ago

kaktusus commented 11 months ago
OS: Debian GNU/Linux trixie/sid (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.0.33631 (Git) AppImage
Build type: Release
Branch: master
Hash: 2167fb6f7ec6ac5c2f6365d4c3035d2db6879b1e
Python 3.10.12, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: Polish/Poland (pl_PL)
Installed mods: 
...

Some time ago (#71) it was made possible to translate object names for the Insert Projection Group tool.

image

It is welcome to proceed consistently and translate these names for the other tools in the view group.

image

  1. View
  2. Active view
  3. Detail
  4. Section
  5. Section for complex section
luzpaz commented 11 months ago

CC @wandererfan

WandererFan commented 11 months ago

I won't get this in for v0.21, but I'll put my notes here for posterity:

// I think this can go anywhere, but QGIView.cpp would be the best place.
#if 0// needed for Qt's lupdate utility
    qApp->translate("DrawView", "View");
    qApp->translate("DrawViewPart", "View");
    qApp->translate("DrawViewSection", "Section");
    qApp->translate("DrawComplexSection", "ComplexSection");
    qApp->translate("DrawViewDetail", "Detail");
    qApp->translate("DrawActiveView", "ActiveView");
    qApp->translate("DrawViewAnnotation", "Annotation");
    qApp->translate("DrawViewImage", "Image");
    qApp->translate("DrawViewSymbol", "Symbol");
    qApp->translate("DrawViewArch", "Arch");
    qApp->translate("DrawViewDraft", "Draft");
#endif

// in QGIView.cpp drawBorder
    QString qClassName = QString::fromUtf8("DrawView");
    QString qTypeName = QString::fromUtf8(getViewObject()->getTypeId().getName());
    QRegularExpression rxClassName(QString::fromUtf8("^.+::(.+)"));
    QRegularExpressionMatch match;
    int pos = qTypeName.indexOf(rxFontSize, pos, &match));
    if ( qTypeName.indexOf(rxFontSize, pos, &match)) != -1) {
        qClassName  = match.captured(0);
    }
    QString labelStr = qApp->translate(qClassName, getViewObject()->Label.getValue());
    m_label->setPlainText(labelStr);
luzpaz commented 11 months ago

@WandererFan Ready to add this now that we're post-release ?

WandererFan commented 11 months ago

Can anybody provide guidance on how I would test this after making the code changes?

I'm only familiar with the mad rush process at release time.

kaktusus commented 11 months ago

I can provide help and guidance if you have a translation test in mind.

WandererFan commented 10 months ago

This should be fixed by #10202. It will probably need a Crowdin cycle before the results are apparent as I was testing with a local translation file.

kaktusus commented 10 months ago

great

kaktusus commented 9 months ago

thank you for implementing this feature