Most sites in the network have a specific set of languages that you are allowed to use in posts. For example, on Stack Overflow and most other sites, all posts must be in English. On German, all posts must be in English or German. This applies to most of the other language sites as well, e.g. on Italian, all posts must be in English or Italian. There are a couple of sites that allow other languages, e.g. Judaism which allows Hebrew, I believe.
For Stack Overflow, specifically, there are also language-specific "sister" sites, for example in Portuguese and Russian.
In general, the sets of languages supported on a site are small and well-defined.
I propose to detect posts whose majority of user-authored natural language content is not in one of the site's allowed languages and display a warning message to the poster when they submit the finished post. If there are language-specific sister sites, and the detected language of the post matches one of the languages of the sister sites, the message should additionally inform the poster about the possibility to ask their question there.
Something like (on Stack Overflow):
It looks like you are trying to ask a question in Portuguese. Please note that Stack Overflow is English-only. However, you can ask questions in Portuguese on our sister site Stack Overflow em Português.
This is a part of site curation that could be somewhat automated and thus lessen the burden on the community, the reviewers, and the moderators. It could also improve the experience for the poster, because it will take less time (immediate automated response instead of minutes or hours for the community) to give better feedback (a constructive message instead of downvotes, closure, and deletion).
In particular, the recommended practice of dealing with such questions (close as "Unclear", delete) is technically correct from the site point of view, but may be confusing to the poster, since it is well possible that the question is perfectly clear in their native language.
Non-English questions are a somewhat regular occurrence on Stack Overflow, and they mostly seem to be asked in languages for which a dedicated sister site exists, so they look more like honest mistakes. A feature like this could help those honest askers who simply confused the two sites as well, not just the moderators and the community.
- Which content should be included in the analysis? Only natural language content authored by the poster. This excludes, for example, code, LaTeX, circuit diagrams, and block quotes as well as URIs. (Questions with code where all identifiers and comments are in a different language and it is thus hard to understand what the code is supposed to do, also exist, but handling those automatically would be too complex.)
- When should the message be shown? At the very end of the composition process, when the poster submits the post. (For questions, this would mean the "Review" or "Ask" button, for answers the "Answer" button. IFF we want to include comments, it would be the "Add Comment" button or the Enter key.)
- What about false positives? We should take certain measures to avoid false positives, such as making sure that enough content of the question is actually user-authored natural language content, and not e.g. mostly code. We should also ensure that both the total amount of content as well as each individual block is long enough to give the analyzer a chance to detect the language.
- What percentage of false positives is acceptable? Ultimately, that is a community decision. In my experience, given a long enough input (see above), language recognizers are fairly accurate these days.
- Why a warning message and not automatically rejecting / placing in a review queue / migrating? Because false positives.