-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"QObject::tr" does not work #5
Comments
Labelled this as an enhancement - TBE will work if not fixed, but some strings are not translated. |
I didn't find any issues using either |
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. |
OK, I've run with Russian. I see that tool tips for internal objects do not show translated text. |
Can you verify that commit [1897c8a] solves the issue for all normal balls? |
Somehow, I'm under the impression that what is working for CircleObjects, is not working for RectObjects and PolyObjects... |
Yes.
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... |
My mistake. 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 );
|
Changeset 825db79 (which I had to type again because copy/paste appears to not work. Thanks, github) resolves this issue. |
QObject::tr is present in code yet. Are you sure it works? I'm not. |
Tested, issue was fixed. |
It marks string for translation for lupdate, but don't allow to use translated string.
https://forum.qt.io/topic/33568/qt-tr-not-working-if-i-am-using-in-static-member
Please find another way instead of "QObject::tr" for static members, but keep lupdate as workable.
The text was updated successfully, but these errors were encountered: