Repository: godot
Issue: kebab-case names are not translated properly into the other naming scheme options
Labels: bug,topic:editor

### Tested versions

Reproducible in all Godot versions upwards of 897e2d9, which is part of v4.3.stable, where #78119 was merged and enabled kebab-case script names.

### System information

Not relevant. It happens on Windows, macOS and Linux

### Issue description

Since Godot version 897e2d9, it is possible to specify kebab-case as a standard for script names, but whenever those names have to be translated into other naming schemes like PascalCase, snake_case or camelCase, the translation fails and produces invalid names.

One example is the creation of human readable names for the "Template" dropdown field in the "Attach Node Script" popup. Those are generated by capitalizing the template scripts file name if the template doesn't explicitly specify the name in a "meta-name" comment. This works for all cases except kebab-case, where the first word of the generated name is capitalized, but the rest is just kebab-case.

![Image](https://github.com/user-attachments/assets/59d100ee-1368-42a9-a4a3-67ae7a70da4d) ![Image](https://github.com/user-attachments/assets/74cdc415-e2d1-4e75-a4dc-a9f609b40af5)

The second example is the translation of script file names into a script templates \_CLASS\_ variable. Here, the generated \_CLASS\_ name is correct for all script naming schemes except for kebab-case, where the generated \_CLASS\_ name is capitalized on the first word, and the rest is treated as snake_case

![Image](https://github.com/user-attachments/assets/51f9fb57-530e-4b78-8289-91426ce4e550) ![Image](https://github.com/user-attachments/assets/fb750c7d-dc41-4276-9b5a-5b15d5ffb846)

The generated class_names for the scripts in the screenshot above are as follows:

| Script name | class_name |
| - | - |
| TestPascalCase.gd | TestPascalCase |
| test_snake_case.gd |TestSnakeCase |
| testCamelCase.gd | TestCamelCase |
| test-kebab-case.gd | Test_kebab_case |


### Steps to reproduce

To check the first case with the human readable template names:

- open the attached project in any Godot version upwards of 897e2d9
- select the "Root" node in the SceneTree, attach a new script and open the "Templates" dropdown in the "Attach Node Script" popup
- observe the human readable names of the project templates

The second case with wrongly generated \_CLASS\_  names is a bit more work. The simplest method is to give all nodes under the "Root" node a new script, select a template which includes a \_CLASS\_  variable (all of the four embedded project templates do so), and then save the script with the same name as the node. The generated \_CLASS\_  variable will be based on the scripts file name.

- open the attached project in any Godot version upwards of 897e2d9
- select the "TestPascalCase" node, create a new script, select any of the project templates, save the script as "TestPascalCase.gd"
- select the "test_snake_case" node, create a new script, select any of the project templates, save the script as "test_snake_case.gd"
- select the "testCamelCase" node, create a new script, select any of the project templates, save the script as "testCamelCase.gd"
- select the "test-kebab-case" node, create a new script, select any of the project templates, save the script as "test-kebab-case.gd"
- open all four of the generated scripts in the editor and check the generated class_name variable


### Minimal reproduction project (MRP)

[test.zip](https://github.com/user-attachments/files/17880000/test.zip)