Detecting an end user's language from an email message

<div class="article-banners">
<div id="docs-wmp-link">
<a href="https://support.zendesk.com/hc/en-us/articles/5411234991258-plan" rel="noopener" target="_blank">What's my plan?</a>
</div>
<div class="article-banner" id="suite_gpee">
<table style="margin-left: 0px; margin-right: auto;">
<tbody>
<tr>
<td>
<strong>All Suites</strong>
</td>
<td>Growth, Professional, Enterprise, or Enterprise Plus</td>
</tr>
</tbody>
</table>
</div>
<div class="article-banner" id="support_pe">
<table style="margin-left: 0px; margin-right: auto;">
<tbody>
<tr>
<td>
<strong>Support</strong>
</td>
<td>Professional or Enterprise</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="docs-ai-summary">
<p id="docs-ai-summary-toggle">
Verified AI summary <span id="up-triangle">◀</span><span id="down-triangle">▼</span>
</p>
<p id="docs-ai-summary-content">
Automatically detect an end user's language from email messages to set
their language preference.
This feature works for new or unregistered users without a set language.
If detection fails, the language is set using the email's
header or defaults to your account's language.
</p>
</div>
<div class="body">
<p class="p">
There are several ways to
<a class="xref" href="https://support.zendesk.com/hc/en-us/articles/10395044176538" target="_blank">detect and set a user's language</a>.
One of
those ways is automatically detecting an end user's language from an
email
message sent to Zendesk Support. Automatic detection works only for requests
from unregistered (new) users and users who do not currently
have a language
setting selected.
</p>
<p class="p">
Email-based language detection is useful if you provide support via email
only
since your users don't use help center, never sign in, and aren't able
to
set a language preference. The only other way to handle language for
email-only end users is to have them send email support requests to a
language-specific email address such as german@support.myaccount.com.
</p>
<p class="p">This article contains the following sections:</p>
<div class="p">
<ul class="ul" id="topic-1__ul_z4t_nyv_qy">
<li class="li">
<a class="xref" href="#topic_el5_jyv_qy">How it works</a>
</li>
<li class="li">
<a class="xref" href="#topic_lfw_sqk_tf">Supported languages</a>
</li>
</ul>
</div>
</div>
<div aria-labelledby="ariaid-title2" class="topic nested1" id="topic_el5_jyv_qy">
<h2 class="title topictitle2" id="ariaid-title2">How it works</h2>
<div class="body">
<p class="p">
Email-based language detection is automatically turned on when you
have
more than one language in your Zendesk account.
</p>
<p class="p">
First, the incoming email message is analyzed to detect the language.
If the scan detects one
with enough confidence, it is set automatically for the user. The
length of the email message can affect the language analysis.
(Longer messages produce better results.)
</p>
<div class="p">
If the language-processing analysis couldn't detect a language, and
the
email has a valid <code class="ph codeph">Accept-Language</code>
header, then:
<ul class="ul" id="topic_el5_jyv_qy__ul_bhg_n1h_pgc">
<li class="li">
If the language in the
<code class="ph codeph">Accept-Language</code>
header is included in your
<a class="xref" href="https://support.zendesk.com/hc/en-us/articles/4408888770714" target="_blank">supported
languages</a>,
then the user's language
preference is set.
</li>
<li class="li">
If a language can't be detected by analyzing the email
text or header, then the user's language is set to
the Zendesk account's default language.
</li>
</ul>
</div>
<div class="note note">
<span class="notetitle">Note:</span> If the "Ask users to register"
setting is enabled, this feature will not set the language for
the end user, because their initial ticket will be suspended. The
language will be set either by the end user when they create their
profile or by the agent when creating the profile to recover the
suspended ticket.
</div>
</div>
</div>
<div aria-labelledby="ariaid-title3" class="topic nested1" id="topic_lfw_sqk_tf">
<h2 class="title topictitle2" id="ariaid-title3">Supported languages</h2>
<div class="body">
<p class="p">
The email language detection feature currently supports the following
languages:
</p>
<div class="p">
<ul class="ul" id="topic_lfw_sqk_tf__ul_tkd_vqk_tf">
<li class="li">Arabic</li>
<li class="li">Chinese</li>
<li class="li">Danish</li>
<li class="li">Dutch</li>
<li class="li">English</li>
<li class="li">Finnish</li>
<li class="li">French</li>
<li class="li">German</li>
<li class="li">Greek</li>
<li class="li">Hebrew</li>
<li class="li">Italian</li>
<li class="li">Japanese</li>
<li class="li">Korean</li>
<li class="li">Norwegian</li>
<li class="li">Polish</li>
<li class="li">Portuguese</li>
<li class="li">Russian</li>
<li class="li">Spanish</li>
<li class="li">Swedish</li>
<li class="li">Thai</li>
</ul>
</div>
</div>
</div>
<script id="ai-summary-script">
//<![CDATA[
const ai_summary_style = document.createElement('style');
ai_summary_style.innerHTML = `#styled-article-body{padding:0 0 0}#article-body #docs-ai-summary{background-color:#f3f3f3;border:1px solid #d3d3d3;padding:10px 10px 6px;margin-bottom:16px}#article-body #docs-ai-summary #docs-ai-summary-toggle{font-size:.9em;font-weight:700;margin-bottom:4px;cursor:pointer;display:flex;justify-content:space-between;align-items:center}#article-body #docs-ai-summary #docs-ai-summary-toggle #up-triangle{margin-left:auto;padding-right:10px;display:none}#article-body #docs-ai-summary #docs-ai-summary-toggle #down-triangle{margin-left:auto;padding-right:10px}#article-body #docs-ai-summary #docs-ai-summary-content{font-size:.9em;padding-left:25px;padding-right:25px;margin-bottom:12px}`;
document.head.appendChild(ai_summary_style);

const toggleAISummary = () => {
const summary = document.getElementById("docs-ai-summary-content");
const upTriangle = document.getElementById("up-triangle");
const downTriangle = document.getElementById("down-triangle");
if (summary.style.display === "none") {
summary.style.display = "block";
upTriangle.style.display = "none";
downTriangle.style.display = "inline";
} else {
summary.style.display = "none";
upTriangle.style.display = "inline";
downTriangle.style.display = "none";
}
};

document.getElementById("docs-ai-summary-toggle").addEventListener("click", toggleAISummary);
//]]>
</script>