简体   繁体   English

C#在英语中普遍存在吗?

[英]Is C# in English universally?

Does the C# language localize for people that have their machine's set to some language other than English? 对于将机器设置为除英语之外的某种语言的人,C#语言是否可以本地化?

In other words, is C# always unconditionally written in English? 换句话说,C#总是无条件用英文写的吗?

C# is written in C#; C#是用C#编写的; C# is a language in and of itself. C#本身就是一种语言。 You can name your variables whatever you want, but reserved words are C#, not English, Spanish, or any other language. 您可以根据需要为变量命名,但保留字是C#,而不是英语,西班牙语或任何其他语言。

Take the word for the type "int" (or Int32). 取“int”(或Int32)类型的单词。 You can't say that "int" is an English word; 你不能说“int”是一个英文单词; no English speaking person really uses the word Int32 to talk about an integer. 没有说英语的人真的用Int32这个词来谈论一个整数。 Or how about the phrase "do while"? 或者“做什么”这句话怎么样? No one says: "Hey Bobby, do task x while the time is less than 5pm". 没有人说:“嘿Bobby,在时间不到5点的时候做任务x”。

Some of the C# reserved words have their roots in English, but that does not mean they're anything like the English language. 一些C#保留词的根源是英语,但这并不意味着它们就像英语一样。 Spanish, French and many other "romance" languages share the same root, but they're not the same. 西班牙语,法语和许多其他“浪漫”语言共享相同的根,但它们不一样。

C# is standardized in the C# Language Specification (ECMA-334) . C#在C#语言规范(ECMA-334)中标准化

There's only one set of keywords (English) and is the same for everybody. 只有一组关键词(英语),每个人都一样。 The .NET Framework (which is not part of the C# language) also uses English for all class and method names. .NET Framework(不是C#语言的一部分)也对所有类和方法名称使用英语。

Of course, you may name your variables and method names as you like. 当然,您可以根据需要命名变量和方法名称。 C# supports the whole range of Unicode characters. C#支持整个Unicode字符范围。

The keywords are derived from english words, but the keywords never change regardless of the local language. 关键字源自英语单词,但不管本地语言如何,关键字都不会改变。

The only place that I have seen a localised programming language is in Excel. 我见过本地化编程语言的唯一地方是Excel。 The function names for formulas are translated, so for example in a swedish version the If function is called Om . 公式的函数名称被翻译,因此例如在瑞典语版本中, If函数被称为Om

Well, reserved words are English, not C#. 保留字是英文,而不是C#。 while, if, for, let, from, using...etc. 而if,for,let,from,using ......等等。

The .NET CLR has very impressive extensibility hooks for the language itself. .NET CLR为语言本身提供了非常令人印象深刻的可扩展性钩子。 So you could implement your own DSL that has keywords in french or spanish pretty easily I believe. 因此,您可以轻松实现自己的DSL,其中包含法语或西班牙语的关键字。

The C# keywords and the BCL class and member names are, and will always be, English only. C#关键字以及BCL类和成员名称是,并且将始终仅为英语。 However it is legal to name your own classes and members in any language you like, though I wouldn't recommend it. 但是,用您喜欢的任何语言命名自己的类和成员是合法的,但我不推荐它。

Furthermore you can get language packs for the .NET framework which will localize strings like exceptions messages. 此外,您可以获得.NET框架的语言包 ,它将本地化​​字符串,例如异常消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM