@@ -95,31 +95,31 @@ void EditorAutoloadSettings::_notification(int p_what) {
95
95
bool EditorAutoloadSettings::_autoload_name_is_valid (const String &p_name, String *r_error) {
96
96
if (!p_name.is_valid_unicode_identifier ()) {
97
97
if (r_error) {
98
- *r_error = TTR (" Invalid name. " ) + " " + TTR ( " Must be a valid Unicode identifier." );
98
+ *r_error = TTR (" Must be a valid Unicode identifier." );
99
99
}
100
100
101
101
return false ;
102
102
}
103
103
104
104
if (ClassDB::class_exists (p_name)) {
105
105
if (r_error) {
106
- *r_error = TTR (" Invalid name. " ) + " " + TTR ( " Must not collide with an existing engine class name." );
106
+ *r_error = TTR (" Must not collide with an existing engine class name." );
107
107
}
108
108
109
109
return false ;
110
110
}
111
111
112
112
if (ScriptServer::is_global_class (p_name)) {
113
113
if (r_error) {
114
- *r_error = TTR (" Invalid name. " ) + " \n " + TTR ( " Must not collide with an existing global script class name." );
114
+ *r_error = TTR (" Must not collide with an existing global script class name." );
115
115
}
116
116
117
117
return false ;
118
118
}
119
119
120
120
if (Variant::get_type_by_name (p_name) < Variant::VARIANT_MAX) {
121
121
if (r_error) {
122
- *r_error = TTR (" Invalid name. " ) + " " + TTR ( " Must not collide with an existing built-in type name." );
122
+ *r_error = TTR (" Must not collide with an existing built-in type name." );
123
123
}
124
124
125
125
return false ;
@@ -128,7 +128,7 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
128
128
for (int i = 0 ; i < CoreConstants::get_global_constant_count (); i++) {
129
129
if (CoreConstants::get_global_constant_name (i) == p_name) {
130
130
if (r_error) {
131
- *r_error = TTR (" Invalid name. " ) + " " + TTR ( " Must not collide with an existing global constant name." );
131
+ *r_error = TTR (" Must not collide with an existing global constant name." );
132
132
}
133
133
134
134
return false ;
@@ -139,7 +139,7 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, Strin
139
139
for (const String &keyword : ScriptServer::get_language (i)->get_reserved_words ()) {
140
140
if (keyword == p_name) {
141
141
if (r_error) {
142
- *r_error = TTR (" Invalid name. " ) + " " + TTR ( " Keyword cannot be used as an Autoload name." );
142
+ *r_error = TTR (" Keyword cannot be used as an Autoload name." );
143
143
}
144
144
145
145
return false ;
@@ -780,7 +780,7 @@ bool EditorAutoloadSettings::autoload_add(const String &p_name, const String &p_
780
780
781
781
String error;
782
782
if (!_autoload_name_is_valid (name, &error)) {
783
- EditorNode::get_singleton ()->show_warning (TTR (" Can't add Autoload:" ) + " \n " + error);
783
+ EditorNode::get_singleton ()->show_warning (TTR (" Can't add Autoload:" ) + " \n " + vformat ( TTR ( " %s is an invalid name. " ), p_name) + " " + error);
784
784
return false ;
785
785
}
786
786
0 commit comments