13

I know it's of course a dispute whether or not to support foreign languages on StackOverflow. However, my question is a bit different. This question for example is in English, but has code with comments and identifiers in a foreign language. This limits the ability for people to leave answers.

Despite the fact that the example question I linked is poor regardless of language barrier, how should we [the users] handle such questions? Should we...

  1. Accept them into StackOverflow and try to translate them?
  2. Cast close votes because we cannot understand to answer?
  3. Ask the OP to translate it to English for us?
  4. Wait for someone else to come translate it for us?

The same also applies when the code its self includes identifiers in a foreign language. In case this original question I linked gets deleted, here's the source from that question:

procedure TForm1.Button1Click(Sender: TObject);
var
  X: Integer;
begin
  for x := 1 to 5 do
    if Sender = Botones[x] then //Valida el Boton que provoco el evento
    begin
      Codigo := x;   //Captura la posicion donde se eonctro el objeto que generó el evento
      // ShowMessage(IntToStr(x));
      Exit; //sale del bucle
    end;
end;
4
  • For the suggested duplicate, I read that and don't agree that it's a duplicate. That question is asking whether it's okay to translate something. I'm asking how people who can't translate it should handle it. Aug 20, 2013 at 23:26
  • 1
    Migrate them to the appropriate SO-in-$LANGUAGE site. If they get out of beta. (If they get into beta.) Aug 20, 2013 at 23:27
  • @michaelb958 I just edited, I mean questions which are in English but have code with some foreign language Aug 20, 2013 at 23:29
  • My bad, I misread. I feel like leaving my comment there, for the "if they get into beta" quip, though. Aug 20, 2013 at 23:33

2 Answers 2

10

Stack overflow comes in a lot of languages now (some still in beta), so if the question itself is in a foreign language you can vote to migrate it if the relevant SO exists. In any case, if the question itself is in English I wouldn't vote to close it. A good answer to the question can still be found without the comments.

For variables / functions names my answer is the same.. sometimes people name their functions do_this() or a variable called $abc even if the OP is a native English speaker.. in this case you wouldn't vote to close it right?

If the code is impossible to understand (English or not) you can ask OP for clarification (or a fiddle if relevant). In my opinion voting to close in these cases is wrong.

9
  • In this case migration wouldn't be the solution because it's already in English, it's the code that's in a foreign language. Aug 20, 2013 at 23:31
  • @JerryDodge if it's only the comments I would not vote to close it.. if the code in the question was posted with no comments at all you wouldn't close it right?
    – Yotam Omer
    Aug 20, 2013 at 23:34
  • Well with the sample code from the linked question, I do not understand what's going on in the code. Aug 20, 2013 at 23:36
  • Why not? there are 5 buttons, and this function only sets Codigo variable to the index of the button that was clicked...
    – Yotam Omer
    Aug 20, 2013 at 23:37
  • And that's just by chance that "Botones" is close enough to "Buttons" to understand what it translates to. This is one example out of billions of possible ones. Aug 20, 2013 at 23:38
  • 1
    I've seen code blocks in plain English that where a lot harder to understand. Besides... the program languages are by themselves written in english.. so if you have an event Button1Click you know that Sender is probably a button.. so if Sender is compared with Botones[x] you know Botones will have buttons regardless of it's name.
    – Yotam Omer
    Aug 20, 2013 at 23:40
  • True, true, I'm glad OP provided comments to explain what they are doing, it's just very awkward that it's in Spanish, which I've never studied. Aug 20, 2013 at 23:41
  • 1
    I don't know any Spanish either.. And I assume there are code blocks which will be impossible to understand in English or any other language.. in these cases you will probably ask OP for clarification (or a working fiddle if relevant) however voting to close is not correct in these cases in my opinion
    – Yotam Omer
    Aug 20, 2013 at 23:43
  • What a coincidence, I just translated an answer from Spanish a few hours ago. I agree that if the question is in another language for which there's another SO site, it makes sense to migrate it. But if the question is in English, translating an answer that could be helpful that's written in another language is worth the effort.
    – Adi Inbar
    Aug 21, 2013 at 3:59
6

The code is actually never in English. It's in Java, C, Python, Perl etc.

What is exactly the source of your concern? Variable names? You don't know what Botones are? Well, they aren't defined anywhere, that's the problem. If they are, it doesn't matter what Botones means, as long as it doesn't make it harder to analyze what's happening with the variable. It's the same name like foo or arr1.

The comments? Well, comments are thought to explain code. If that's their purpose on SO, they should be translated to English. If they doesn't provide any helpful information, they are noise and can be removed.

I don't consider changing variable names to be constructive, as long as they are not obfuscated or so long that they mess with formatting. Comments should be treated as a part of questions, so they should be in English.

You must log in to answer this question.

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