Skip to content

Commit

Permalink
Merge pull request #97273 from timothyqiu/unicode-autoload
Browse files Browse the repository at this point in the history
Allow using Unicode identifier for Autoload name
  • Loading branch information
akien-mga committed Sep 21, 2024
2 parents 2daea4b + e8462bf commit e4e024a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions editor/editor_autoload_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,9 @@ void EditorAutoloadSettings::_notification(int p_what) {
}

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) {
*r_error = TTR("Invalid name.") + " ";
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 _";
}
*r_error = TTR("Invalid name.") + " " + TTR("Must be a valid Unicode identifier.");
}

return false;
Expand Down

0 comments on commit e4e024a

Please sign in to comment.