Skip to content

Commit 7b1ed52

Browse files
committed
Merge pull request #101592 from Ivorforce/float-constant-defs-translate-macos
Fix float constant descriptions not translating on macOS.
2 parents 503a20d + 2766543 commit 7b1ed52

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

editor/plugins/visual_shader_editor_plugin.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@
7575
struct FloatConstantDef {
7676
String name;
7777
float value = 0;
78-
String desc;
78+
const char *desc_key;
7979
};
8080

8181
static FloatConstantDef float_constant_defs[] = {
82-
{ "E", Math_E, TTR("E constant (2.718282). Represents the base of the natural logarithm.") },
83-
{ "Epsilon", CMP_EPSILON, TTR("Epsilon constant (0.00001). Smallest possible scalar number.") },
84-
{ "Phi", 1.618034f, TTR("Phi constant (1.618034). Golden ratio.") },
85-
{ "Pi/4", Math_PI / 4, TTR("Pi/4 constant (0.785398) or 45 degrees.") },
86-
{ "Pi/2", Math_PI / 2, TTR("Pi/2 constant (1.570796) or 90 degrees.") },
87-
{ "Pi", Math_PI, TTR("Pi constant (3.141593) or 180 degrees.") },
88-
{ "Tau", Math_TAU, TTR("Tau constant (6.283185) or 360 degrees.") },
89-
{ "Sqrt2", Math_SQRT2, TTR("Sqrt2 constant (1.414214). Square root of 2.") }
82+
{ "E", Math_E, TTRC("E constant (2.718282). Represents the base of the natural logarithm.") },
83+
{ "Epsilon", CMP_EPSILON, TTRC("Epsilon constant (0.00001). Smallest possible scalar number.") },
84+
{ "Phi", 1.618034f, TTRC("Phi constant (1.618034). Golden ratio.") },
85+
{ "Pi/4", Math_PI / 4, TTRC("Pi/4 constant (0.785398) or 45 degrees.") },
86+
{ "Pi/2", Math_PI / 2, TTRC("Pi/2 constant (1.570796) or 90 degrees.") },
87+
{ "Pi", Math_PI, TTRC("Pi constant (3.141593) or 180 degrees.") },
88+
{ "Tau", Math_TAU, TTRC("Tau constant (6.283185) or 360 degrees.") },
89+
{ "Sqrt2", Math_SQRT2, TTRC("Sqrt2 constant (1.414214). Square root of 2.") }
9090
};
9191

9292
const int MAX_FLOAT_CONST_DEFS = sizeof(float_constant_defs) / sizeof(FloatConstantDef);
@@ -7198,7 +7198,7 @@ VisualShaderEditor::VisualShaderEditor() {
71987198
// CONSTANTS
71997199

72007200
for (int i = 0; i < MAX_FLOAT_CONST_DEFS; i++) {
7201-
add_options.push_back(AddOption(float_constant_defs[i].name, "Scalar/Constants", "VisualShaderNodeFloatConstant", float_constant_defs[i].desc, { float_constant_defs[i].value }, VisualShaderNode::PORT_TYPE_SCALAR));
7201+
add_options.push_back(AddOption(float_constant_defs[i].name, "Scalar/Constants", "VisualShaderNodeFloatConstant", TTRGET(float_constant_defs[i].desc_key), { float_constant_defs[i].value }, VisualShaderNode::PORT_TYPE_SCALAR));
72027202
}
72037203
// FUNCTIONS
72047204

0 commit comments

Comments
 (0)