15

This question already has an answer here:

Is it ever acceptable to edit and Anglicise the contents of a question on Stack Overflow?

By way of an example, this question in which the user gives the following HTML markup:

<div class="box-a bfc">drei</div>
<div class="box-b bfc">vier</div>

And in the questions asks:

The box "drei" and "vier" have collapsing margins

This is perhaps only the most basic example (for which Anglicisation would likely not offer much value), but for the sake of argument it would involve replacing drei with three, and vier with four.

I would posit the majority (answering/viewing) audience of Stack Overflow is English, so changing question content to English may be of more immediate help for answerers and future viewers, but clearly of less help to the OP.

My personal view would be to take it on a case by case basis, perhaps preferring to leaving language 'as the OP intended', but it would intrigue me to know what the general feeling on this subject was.

marked as duplicate by michaelb958, Martijn Pieters, Monica Cellio, hims056, Aziz Shaikh Mar 26 '14 at 5:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 19
    This could hurt a post if the text contained special characters, and they were somehow related to the OP's problem. – S.L. Barth Mar 25 '14 at 10:29
  • Non-English characters characters can cause some issues and removing them might mask the true issue/solution – Joe W Mar 25 '14 at 13:58
  • 3
    gotta be careful, use your judgement - possibly leave a comment if you do edit the name so it's shown in the revision history. Be careful about editing those because sometimes the actual problem with the code may be a misspelled string. – user221081 Mar 25 '14 at 15:57
8

If the non English words don't matter then leave them alone. In a code fragment the class might be called Employee or Person or Foo or Class1 and it doesn't matter. What matters is the missing semi colon or the lack of a copy constructor or the use of = instead of ==.

But if a Save button or a Cancel button are not identified in English, and the poster expects that people know what Save and Cancel buttons do, there is a lack of understanding possible. My preference would be to explain once

The page has Foo (save) and Bar (cancel) buttons that are not working

This way as little real code needs to be edited, possibly introducing artifacts that obscure the real problem. It also reduces the effort to ask the question, in theory allowing the asker more time to actually explain the question, show the error messages etc.

If the asker doesn't translate words in the question that you know (because you recognize the words) are key to the question, edit it not to replace the words with their English equivalent, but to explain their meaning to other readers. If the words are mere placeholders with meanings like "three", "four", and so on, leave them alone.

14

I'll give the same answer I just posted here.

Using English for identifiers doesn't change how the code works. If company policy mandates native language identifiers and someone has to change all that just to post on SO, they risk making typos or introducing bugs.

  • 8
    I do find it much harder to follow code with variables in a language I don't understand – Richard Tingle Mar 25 '14 at 10:47
  • 10
    I find it harder to read code with badly named variables line e.g. integer1, integer2 but I don't think it would be appropriate to rename them all in the code. – Amicable Mar 25 '14 at 12:16
3

There's a reason to change text which is not in English to English, whether it appears as text data (for instance, var foo = "something non-English") or as identifiers (for instance, var something_non_english = "foo"): it is not possible for the people who have the ability or responsibility to flag problematic contents or remove it to do so if they can't understand what is said. In English, if I saw a question that contains words generally considered offensive, and they are not essential to the question, I'd change them for something non-offensive. Perhaps a question about processing offensive word might have to contain such words, but unless making the change materially affects the meaning of the question I'd do it.

I realize that it is not always possible to tell whether an identifier is a word in another language or perhaps an English initialism.

3

Changing code in a question is extremely dangerous, it is likely that bugs can be introduced or the cause of the question removed. Ideally the OP themselves should do the translation. The translation is itself useful however since it is much easier for the question to be answered when you understand the meaning of the variable and method names being used. For example the following is much easier to understand than the german version

serialiseData(Data data){
    ...
}

vs

sparenDaten(Daten daten){
    ...
}

For one it will be immediately obvious what the code should do, on the other it isn't (unless you understand German).

If you are 100% sure that your translation is correct then it is helpful but I would expect it is very rare that that is possible (and even then; likely only after the question is solved). So usually; encourage the OP to do it.

1

I live in Britain, but the 'language of programming' is not British English but American English.

It would be silly for me to write technical terms in British English as it would make searching\refactoring harder. Everyone expects the American spellings and it would be an exercise in futility for me to try to change that (much as it pains me).

In this case, if it's possible, sticking to the convention will make your and future dev's lives easier.

  • 3
    Although I agree this is usually what "anglicising" means; in this case I think the OP means German/French etc --> English (American or British) – Richard Tingle Mar 25 '14 at 13:43
  • I agree, I thought this would be a similar (if more subtle) issue i.e. wanting to work in your own language. – BanksySan Mar 25 '14 at 13:46
  • 2
    Personally I write my own posts in British english and don't expect people to change them. But other peoples posts can stay in American english. I don't believe SE has an official policy on which variey of english the site is in – Richard Tingle Mar 25 '14 at 13:47
  • I wasn't thinking of SE in particular. I would write the content in British English, but code samples in American English, certainly production code in American English. – BanksySan Mar 25 '14 at 13:51
0

Such edits are useless, because they doesn't improve the code in any way. Unnecessary edits can turn post into community edit, and are the lost of time. Maybe the editor is hunting edit badges?

Name conventions are primarily opinion based, and the template text even more. Some are using English, some German, some Lorem Ipsum. Someone translated button title from German to English, someone else may capitalise the labels, or add famous missing giant S. Someone will change "Joe Smith" from sample data to "Joan Smith" to provide gender parity, someone else will protest that you should provide parity for non Ango-Saxon family names. Someone will rollback that, and someone else will rollback the rollback.

This is useless, distracting and likely to trigger flame wars in comments. If someone want to get shiny edit badges, it's better to focus on that infamous giant S...

  • 1
    I would argue that its a lot easier to answer a question with a method called serialiseData(Data data){...} than sparenDaten(Daten daten). I wouldn't say its useless (assuming its done properly) – Richard Tingle Mar 25 '14 at 15:31
  • @RichardTingle then you shouldn't be surprised by someone changing the name to serializeData (because he prefers that way), and someone else to serialize (because adding Data to method taking Data argument is smurf naming convention). What about people choosing to name methods method1, method2 in code samples posted on SO? Do you think that edit linked by OP was in any way useful? – Danubian Sailor Mar 25 '14 at 16:03
  • 1
    You're forgetting that the official language of stack exchange is English (either American or British). There are other language variations in either beta or waiting for launch and thats great, but this one is in english – Richard Tingle Mar 25 '14 at 16:05
  • @RichardTingle the original question WAS IN ENGLISH. Only the PLACEHOLDER TEXT was changed. It makes a difference. – Danubian Sailor Mar 25 '14 at 16:08
  • 1
    drei and vier is pretty pointless, but this question is more general than that. The OP of this question themselves states that its not a great example – Richard Tingle Mar 25 '14 at 16:09

Not the answer you're looking for? Browse other questions tagged .