-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Unicode characters in GDScript identifiers #24785
Comments
Because that's the specification. |
but blender's python support unicode to be var name |
Blender's Python is Python 3. |
fine,thank you |
This could be labeled as feature proposal though. |
I might be biased since I'm native speaker of a latin language, but beyond the "oh cool" effect of being able to write code like As far as I know, all keyboard layouts can quite easily input latin characters, while it's pretty difficult on most layouts to input a random Unicode character, or CJK characters if you don't have a proper IME set up, etc. Having identifiers in Simplified Chinese characters used e.g. in a FOSS library would make it very difficult for any non-Chinese user to modify this code (and of course to understand it, but that's another issue). If there are good practical use cases for this, it could be considered, but otherwise it sounds like making the language more complex for little gain. |
Some languages have minimal pairs with some characters being accented or having other diacritics and others not. I believe Godot complains hugely when I try to have a ł or a ń or some other Polish character in a variable name - and given the existence of such minimal pairs in both Polish and Spanish, well, it'd help if I could have two different variable names for such pairs instead of having to look for synonyms. |
In my opinion, since the language's keywords are English, it's a good practice to have English identifiers, too. Because allowing Unicode characters is like if I'd ask to translate all keywords to all languages' translated counterparts. Yes, it's easier to allow Unicode identifiers than aliasing all keywords, but the result is the same: You can't read GDScript anymore. You can only read GDScript if it's written in a language you understand. And English is the international language (thus the keywords are English), that's just how it is. |
I have seen code written by a Finnish guy with Finnish variable names, and I understood what the code does without knowing any Finnish. I also once did it with German and Spanish and Russian, which I do know a bit of. So yes, knowing the language the variable names use helps, but is not a requirement. And to be clear, I'm not advocating ALL Unicode, just the accented latin characters. CJK in variable names is a bad idea either way. |
I agree with this. I want to write variables as |
it's gdscript.. keep it to gdscript syntax only imo |
not all the people in the world like using English to name the variables, especially asians include me. |
My understanding so far: usecase "cool"
usecase "symbolic characters"
2👍, 1☺ by kirk-github, FlamyAT, KoBeWi
usecase "internationalization"
The internationalization tracker issue #3081 conveys the message that akien-mga pursued a global internationalization solution in the past and that many individuals (want to) use internationalized components of Godot. IMOI'd guess the internationalization issue has the most weight. Especially people with only little knowledge of English could be enabled to use Godot. I observed German students using German identifiers in a university Javascript team-project. That's probably not good for an international project but for a local team or for education I guess that's valuable. I guess Introducing Unicode support for the GDScript parser is not much overhead and it could be a requirement for solving issues like Internationalization of Project Settings or future internationalization issues. Quoting the issuer of the mentioned issue:
|
English may be international but I really need unicode here in asia, trying to keep only english characters makes coding unnecesarily confusing. |
Different countries, different languages,but you can use your native language in GDscript,it is so cool. |
You can do this. or compile like .ts convert .js |
Add support for Unicode characters in GDScript identifiers,What is the result?add or no add? |
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! |
Just FYI, this PR allows Unicode characters, which seems close to the first solution mentioned in this proposal:
Hopefully it's helpful for those who wants a short-term and quick solution. |
Godot version:
3.0.6
OS/device including version:
windows
Issue description:
Steps to reproduce:
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: