Giter VIP home page Giter VIP logo

Comments (12)

kaa-ching avatar kaa-ching commented on May 20, 2024

Labelled this as an enhancement - TBE will work if not fixed, but some strings are not translated.

from tbe.

kaa-ching avatar kaa-ching commented on May 20, 2024

I didn't find any issues using either
git grep static.*tr.*\(
or using
git grep QObject::tr
All occurences of the latter seem to be present in the i18n/*.ts files.

from tbe.

glixx avatar glixx commented on May 20, 2024

Yes, all strings are present in i18n/*.ts files, but it's not enough. QObject::tr allows to mark strings for lupdate, but no more. Sometimes QObject::tr is workable, but not always.
If you finish Dutch translation 100% you will see this issue. I have 100% for Russian and I see big problem with translations.
You did not understand this issue, grep will show OK, ts files is OK, but bug is present anyway.

from tbe.

kaa-ching avatar kaa-ching commented on May 20, 2024

OK, I've run with Russian. I see that tool tips for internal objects do not show translated text.
e.g. in level "Marble boulevard", CircleObject.cpp:65 and PolyObject.cpp:119 are not shown translated.
Is that what you are looking at?

from tbe.

kaa-ching avatar kaa-ching commented on May 20, 2024

Can you verify that commit [1897c8a] solves the issue for all normal balls?
I think it does :-)

from tbe.

kaa-ching avatar kaa-ching commented on May 20, 2024

Somehow, I'm under the impression that what is working for CircleObjects, is not working for RectObjects and PolyObjects...
The strings do not appear in the *.ts files.
Did I forget something?

from tbe.

glixx avatar glixx commented on May 20, 2024

Can you verify that commit [1897c8a] solves the issue for all normal balls?

Yes.

Somehow, I'm under the impression that what is working for CircleObjects, is not working for RectObjects and PolyObjects...

lupdate works for RectObjects, but not for CircleObjects, PolyObjects. I don't know why.

from tbe.

kaa-ching avatar kaa-ching commented on May 20, 2024

lupdate works for RectObjects, but not for CircleObjects, PolyObjects. I don't know why.

So apparently it only works for one file, not for more. In my case, it chose CircleObjects, in your case it chose RectObjects... Sigh...

from tbe.

glixx avatar glixx commented on May 20, 2024

My mistake.
I found reason:

diff -ur tbe-0.9-git8b8c580.orig/src/model/PolyObject.cpp tbe-0.9-git8b8c580/src/model/PolyObject.cpp
--- tbe-0.9-git8b8c580.orig/src/model/PolyObject.cpp    2015-08-15 21:36:20.000000000 +0300
+++ tbe-0.9-git8b8c580/src/model/PolyObject.cpp 2015-08-20 00:45:00.000000000 +0300
@@ -44,8 +44,8 @@

 static AbstractPolyObjectFactory theBowlingPinFactory(
    "BowlingPin",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Bowling Pin"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Bowling pins are meant to be run "
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Bowling Pin"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Bowling pins are meant to be run "
                "over - and most people prefer to do that using "
                "a Bowling Ball."),
    "BowlingPin",
@@ -57,8 +57,8 @@

 static AbstractPolyObjectFactory theSkyhookFactory(
    "Skyhook",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Skyhook"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "A skyhook just hangs in the air. And you can hang a "
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Skyhook"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "A skyhook just hangs in the air. And you can hang a "
                "lot of weight on it!"),
    "Skyhook",
    "(-0.03,-0.07)=(0.01,-0.11)=(0.05,-0.11)=(0.1,-0.05)=(0.1,-0.02)"
@@ -67,40 +67,40 @@

 static AbstractPolyObjectFactory theWeightFactory(
    "Weight",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Weight"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "A serious mass. As heavy as it looks!"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Weight"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "A serious mass. As heavy as it looks!"),
    "Weight",
    "(-0.20,-0.20)=(0.20,-0.20)=(0.06,0.20)=(-0.06,0.20)",
    0.40, 0.40, 10.0, 0.3 );

 static AbstractPolyObjectFactory theLeftRampFactory(
    "LeftRamp",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Left Ramp"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "This is a ramp. The left is lower than the right, so things slide to the left."),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Left Ramp"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "This is a ramp. The left is lower than the right, so things slide to the left."),
    "LeftRamp",
        "(-0.5,-0.46)=(-0.5,-0.5)=(0.13,-0.5)=(0.5,0.5)",
    1.0, 1.0, 0.0, 0.2 );

 static AbstractPolyObjectFactory theRightRampFactory(
    "RightRamp",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Right Ramp"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "This is a ramp. The left is higher than the right, so things slide to the right."),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Right Ramp"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "This is a ramp. The left is higher than the right, so things slide to the right."),
    "RightRamp",
        "(-0.5,0.5)=(-0.13,-0.5)=(0.5,-0.5)=(0.5,-0.46)",
    1.0, 1.0, 0.0, 0.2 );

 static AbstractPolyObjectFactory theLeftWedgeFactory(
    "LeftWedge",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Left Wedge"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "This is a wedge. The left is lower than the right, so things slide to the left."),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Left Wedge"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "This is a wedge. The left is lower than the right, so things slide to the left."),
    "birch-wedge-left",
        "(-0.5,-0.46)=(-0.5,-0.5)=(0.5,-0.5)=(0.5,0.5)",
    1.0, 1.0, 0.0, 0.2 );

 static AbstractPolyObjectFactory theRightWedgeFactory(
    "RightWedge",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Right Wedge"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "This is a wedge. The left is higher than the right, so things slide to the right."),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Right Wedge"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "This is a wedge. The left is higher than the right, so things slide to the right."),
    "birch-wedge-right",
        "(-0.5,0.5)=(-0.5,-0.5)=(0.5,-0.5)=(0.5,-0.46)",
    1.0, 1.0, 0.0, 0.2 );
@@ -109,8 +109,8 @@
 // on both the inside and the outside - you can use both if you want :-)
 static AbstractPolyObjectFactory the40QuarterArcFactory(
    "QuarterArc40",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Quarter Arc Small"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "This is a quarter arc. Or ninety degrees, or 1.57 radians if you want."),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Quarter Arc Small"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "This is a quarter arc. Or ninety degrees, or 1.57 radians if you want."),
    "QuarterArc",
    "(0.100,-.200)=(0.200,-.200)=(0.180,-.076)=(0.085,-.107);"
    "(0.085,-.107)=(0.180,-.076)=(0.124,0.035)=(0.043,-.024);"
@@ -123,8 +123,8 @@
 // on both the inside and the outside - you can use both if you want :-)
 static AbstractPolyObjectFactory the80QuarterArcFactory(
    "QuarterArc80",
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "Quarter Arc Large"),
-   QT_TRANSLATE_NOOP(AbstractPolyObjectFactory, "This is a quarter arc. Or ninety degrees, or 1.57 radians if you want."),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "Quarter Arc Large"),
+   QT_TRANSLATE_NOOP("AbstractPolyObjectFactory", "This is a quarter arc. Or ninety degrees, or 1.57 radians if you want."),
    "QuarterArc80",
    "( 0.300,-0.400)=( 0.400,-0.400)=( 0.388,-0.261)=( 0.289,-0.278);"
    "( 0.289,-0.278)=( 0.388,-0.261)=( 0.352,-0.126)=( 0.258,-0.161);"
diff -ur tbe-0.9-git8b8c580.orig/src/model/RectObject.cpp tbe-0.9-git8b8c580/src/model/RectObject.cpp
--- tbe-0.9-git8b8c580.orig/src/model/RectObject.cpp    2015-08-15 21:36:20.000000000 +0300
+++ tbe-0.9-git8b8c580/src/model/RectObject.cpp 2015-08-20 00:45:39.000000000 +0300
@@ -49,27 +49,27 @@
 // anImageName,   aWidth,aHeight,  aMass,  aBounciness

 static AbstractRectObjectFactory theDomRedFactory("DominoRed",
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "Domino (Red)"),
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "The famous plastic red domino stone"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "Domino (Red)"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "The famous plastic red domino stone"),
    "DominoRed", 0.1, 0.5, 2.5, 0.1 );

 static AbstractRectObjectFactory theDomBlueFactory("DominoBlue",
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "Domino (Blue)"),
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "The famous plastic blue domino stone"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "Domino (Blue)"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "The famous plastic blue domino stone"),
    "DominoBlue", 0.1, 0.5, 2.5, 0.1 );

 static AbstractRectObjectFactory theDomGreenFactory("DominoGreen",
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "Domino (Green)"),
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "The famous plastic green domino stone"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "Domino (Green)"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "The famous plastic green domino stone"),
    "DominoGreen", 0.1, 0.5, 2.5, 0.1 );

 static AbstractRectObjectFactory theFloorFactory("Floor",
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "Floor"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "Floor"),
    "",
    "used_wood_bar", 1.0, 0.1, 0.0, 0.1 );

 static AbstractRectObjectFactory theWallFactory("Wall",
-   QT_TRANSLATE_NOOP(AbstractRectObjectFactory, "Wall"),
+   QT_TRANSLATE_NOOP("AbstractRectObjectFactory", "Wall"),
    "",
    "oldbrick", 0.2, 1.0, 0.0, 0.05 );

from tbe.

kaa-ching avatar kaa-ching commented on May 20, 2024

Changeset 825db79 (which I had to type again because copy/paste appears to not work. Thanks, github) resolves this issue.

from tbe.

glixx avatar glixx commented on May 20, 2024

QObject::tr is present in code yet. Are you sure it works? I'm not.
QT_TRANSLATE_NOOP works always, but QObject::tr not always.

from tbe.

glixx avatar glixx commented on May 20, 2024

Tested, issue was fixed.
It seems others QObject::tr are workable.

from tbe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.