1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Mark GDScript and shader warnings for translation

This commit is contained in:
kobewi
2025-06-24 18:03:52 +02:00
parent 987832be46
commit 015cc38912
4 changed files with 60 additions and 63 deletions

View File

@@ -527,9 +527,6 @@
<member name="debug/gdscript/warnings/confusable_local_usage" type="int" setter="" getter="" default="1"> <member name="debug/gdscript/warnings/confusable_local_usage" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an identifier that will be shadowed below in the block is used. When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when an identifier that will be shadowed below in the block is used.
</member> </member>
<member name="debug/gdscript/warnings/constant_used_as_function" type="int" setter="" getter="" default="1" deprecated="This warning is never produced. Instead, an error is generated if the expression type is known at compile time.">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a constant is used as a function.
</member>
<member name="debug/gdscript/warnings/deprecated_keyword" type="int" setter="" getter="" default="1"> <member name="debug/gdscript/warnings/deprecated_keyword" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when deprecated keywords are used. When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when deprecated keywords are used.
[b]Note:[/b] There are currently no deprecated keywords, so this warning is never produced. [b]Note:[/b] There are currently no deprecated keywords, so this warning is never produced.
@@ -546,9 +543,6 @@
<member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true"> <member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true">
If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings. If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings.
</member> </member>
<member name="debug/gdscript/warnings/function_used_as_property" type="int" setter="" getter="" default="1" deprecated="This warning is never produced. When a function is used as a property, a [Callable] is returned.">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when using a function as if it is a property.
</member>
<member name="debug/gdscript/warnings/get_node_default_without_onready" type="int" setter="" getter="" default="2"> <member name="debug/gdscript/warnings/get_node_default_without_onready" type="int" setter="" getter="" default="2">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when [method Node.get_node] (or the shorthand [code]$[/code]) is used as default value of a class variable without the [code]@onready[/code] annotation. When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when [method Node.get_node] (or the shorthand [code]$[/code]) is used as default value of a class variable without the [code]@onready[/code] annotation.
</member> </member>
@@ -583,9 +577,6 @@
<member name="debug/gdscript/warnings/onready_with_export" type="int" setter="" getter="" default="2"> <member name="debug/gdscript/warnings/onready_with_export" type="int" setter="" getter="" default="2">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when the [code]@onready[/code] annotation is used together with the [code]@export[/code] annotation, since it may not behave as expected. When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when the [code]@onready[/code] annotation is used together with the [code]@export[/code] annotation, since it may not behave as expected.
</member> </member>
<member name="debug/gdscript/warnings/property_used_as_function" type="int" setter="" getter="" default="1" deprecated="This warning is never produced. Instead, an error is generated if the expression type is known at compile time.">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when using a property as if it is a function.
</member>
<member name="debug/gdscript/warnings/redundant_await" type="int" setter="" getter="" default="1"> <member name="debug/gdscript/warnings/redundant_await" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a function that is not a coroutine is called with await. When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when a function that is not a coroutine is called with await.
</member> </member>

View File

@@ -2964,6 +2964,12 @@ GDScriptLanguage::GDScriptLanguage() {
String path = GDScriptWarning::get_settings_path_from_code(code); String path = GDScriptWarning::get_settings_path_from_code(code);
GLOBAL_DEF(GDScriptWarning::get_property_info(code), default_enabled); GLOBAL_DEF(GDScriptWarning::get_property_info(code), default_enabled);
} }
#ifndef DISABLE_DEPRECATED
ProjectSettings::get_singleton()->set_as_internal("debug/gdscript/warnings/property_used_as_function", true);
ProjectSettings::get_singleton()->set_as_internal("debug/gdscript/warnings/constant_used_as_function", true);
ProjectSettings::get_singleton()->set_as_internal("debug/gdscript/warnings/function_used_as_property", true);
#endif
#endif // DEBUG_ENABLED #endif // DEBUG_ENABLED
} }

View File

@@ -194,50 +194,50 @@ String GDScriptWarning::get_name_from_code(Code p_code) {
ERR_FAIL_COND_V(p_code < 0 || p_code >= WARNING_MAX, String()); ERR_FAIL_COND_V(p_code < 0 || p_code >= WARNING_MAX, String());
static const char *names[] = { static const char *names[] = {
"UNASSIGNED_VARIABLE", PNAME("UNASSIGNED_VARIABLE"),
"UNASSIGNED_VARIABLE_OP_ASSIGN", PNAME("UNASSIGNED_VARIABLE_OP_ASSIGN"),
"UNUSED_VARIABLE", PNAME("UNUSED_VARIABLE"),
"UNUSED_LOCAL_CONSTANT", PNAME("UNUSED_LOCAL_CONSTANT"),
"UNUSED_PRIVATE_CLASS_VARIABLE", PNAME("UNUSED_PRIVATE_CLASS_VARIABLE"),
"UNUSED_PARAMETER", PNAME("UNUSED_PARAMETER"),
"UNUSED_SIGNAL", PNAME("UNUSED_SIGNAL"),
"SHADOWED_VARIABLE", PNAME("SHADOWED_VARIABLE"),
"SHADOWED_VARIABLE_BASE_CLASS", PNAME("SHADOWED_VARIABLE_BASE_CLASS"),
"SHADOWED_GLOBAL_IDENTIFIER", PNAME("SHADOWED_GLOBAL_IDENTIFIER"),
"UNREACHABLE_CODE", PNAME("UNREACHABLE_CODE"),
"UNREACHABLE_PATTERN", PNAME("UNREACHABLE_PATTERN"),
"STANDALONE_EXPRESSION", PNAME("STANDALONE_EXPRESSION"),
"STANDALONE_TERNARY", PNAME("STANDALONE_TERNARY"),
"INCOMPATIBLE_TERNARY", PNAME("INCOMPATIBLE_TERNARY"),
"UNTYPED_DECLARATION", PNAME("UNTYPED_DECLARATION"),
"INFERRED_DECLARATION", PNAME("INFERRED_DECLARATION"),
"UNSAFE_PROPERTY_ACCESS", PNAME("UNSAFE_PROPERTY_ACCESS"),
"UNSAFE_METHOD_ACCESS", PNAME("UNSAFE_METHOD_ACCESS"),
"UNSAFE_CAST", PNAME("UNSAFE_CAST"),
"UNSAFE_CALL_ARGUMENT", PNAME("UNSAFE_CALL_ARGUMENT"),
"UNSAFE_VOID_RETURN", PNAME("UNSAFE_VOID_RETURN"),
"RETURN_VALUE_DISCARDED", PNAME("RETURN_VALUE_DISCARDED"),
"STATIC_CALLED_ON_INSTANCE", PNAME("STATIC_CALLED_ON_INSTANCE"),
"MISSING_TOOL", PNAME("MISSING_TOOL"),
"REDUNDANT_STATIC_UNLOAD", PNAME("REDUNDANT_STATIC_UNLOAD"),
"REDUNDANT_AWAIT", PNAME("REDUNDANT_AWAIT"),
"ASSERT_ALWAYS_TRUE", PNAME("ASSERT_ALWAYS_TRUE"),
"ASSERT_ALWAYS_FALSE", PNAME("ASSERT_ALWAYS_FALSE"),
"INTEGER_DIVISION", PNAME("INTEGER_DIVISION"),
"NARROWING_CONVERSION", PNAME("NARROWING_CONVERSION"),
"INT_AS_ENUM_WITHOUT_CAST", PNAME("INT_AS_ENUM_WITHOUT_CAST"),
"INT_AS_ENUM_WITHOUT_MATCH", PNAME("INT_AS_ENUM_WITHOUT_MATCH"),
"ENUM_VARIABLE_WITHOUT_DEFAULT", PNAME("ENUM_VARIABLE_WITHOUT_DEFAULT"),
"EMPTY_FILE", PNAME("EMPTY_FILE"),
"DEPRECATED_KEYWORD", PNAME("DEPRECATED_KEYWORD"),
"CONFUSABLE_IDENTIFIER", PNAME("CONFUSABLE_IDENTIFIER"),
"CONFUSABLE_LOCAL_DECLARATION", PNAME("CONFUSABLE_LOCAL_DECLARATION"),
"CONFUSABLE_LOCAL_USAGE", PNAME("CONFUSABLE_LOCAL_USAGE"),
"CONFUSABLE_CAPTURE_REASSIGNMENT", PNAME("CONFUSABLE_CAPTURE_REASSIGNMENT"),
"INFERENCE_ON_VARIANT", PNAME("INFERENCE_ON_VARIANT"),
"NATIVE_METHOD_OVERRIDE", PNAME("NATIVE_METHOD_OVERRIDE"),
"GET_NODE_DEFAULT_WITHOUT_ONREADY", PNAME("GET_NODE_DEFAULT_WITHOUT_ONREADY"),
"ONREADY_WITH_EXPORT", PNAME("ONREADY_WITH_EXPORT"),
#ifndef DISABLE_DEPRECATED #ifndef DISABLE_DEPRECATED
"PROPERTY_USED_AS_FUNCTION", "PROPERTY_USED_AS_FUNCTION",
"CONSTANT_USED_AS_FUNCTION", "CONSTANT_USED_AS_FUNCTION",

View File

@@ -85,16 +85,16 @@ String ShaderWarning::get_name_from_code(Code p_code) {
ERR_FAIL_INDEX_V(p_code, WARNING_MAX, String()); ERR_FAIL_INDEX_V(p_code, WARNING_MAX, String());
static const char *names[] = { static const char *names[] = {
"FLOAT_COMPARISON", PNAME("FLOAT_COMPARISON"),
"UNUSED_CONSTANT", PNAME("UNUSED_CONSTANT"),
"UNUSED_FUNCTION", PNAME("UNUSED_FUNCTION"),
"UNUSED_STRUCT", PNAME("UNUSED_STRUCT"),
"UNUSED_UNIFORM", PNAME("UNUSED_UNIFORM"),
"UNUSED_VARYING", PNAME("UNUSED_VARYING"),
"UNUSED_LOCAL_VARIABLE", PNAME("UNUSED_LOCAL_VARIABLE"),
"FORMATTING_ERROR", PNAME("FORMATTING_ERROR"),
"DEVICE_LIMIT_EXCEEDED", PNAME("DEVICE_LIMIT_EXCEEDED"),
"MAGIC_POSITION_WRITE", PNAME("MAGIC_POSITION_WRITE"),
}; };
static_assert(std::size(names) == WARNING_MAX, "Amount of warning types don't match the amount of warning names."); static_assert(std::size(names) == WARNING_MAX, "Amount of warning types don't match the amount of warning names.");