Merge pull request #97273 from timothyqiu/unicode-autoload

Allow using Unicode identifier for Autoload name
This commit is contained in:
Rémi Verschelde 2024-09-21 11:51:06 +02:00
commit e4e024ab88
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 7 deletions

View File

@ -88,14 +88,9 @@ void EditorAutoloadSettings::_notification(int p_what) {
} }
bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, String *r_error) { bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, String *r_error) {
if (!p_name.is_valid_ascii_identifier()) { if (!p_name.is_valid_unicode_identifier()) {
if (r_error) { if (r_error) {
*r_error = TTR("Invalid name.") + " "; *r_error = TTR("Invalid name.") + " " + TTR("Must be a valid Unicode identifier.");
if (p_name.size() > 0 && p_name.left(1).is_numeric()) {
*r_error += TTR("Cannot begin with a digit.");
} else {
*r_error += TTR("Valid characters:") + " a-z, A-Z, 0-9 or _";
}
} }
return false; return false;