<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>6.0.8</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>Windows 10 (1809)</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto"><em>app.getLocale()</em> should return value passed to <em>app.commandLine.appendSwitch('lang', VALUE)</em></p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto"><em>app.getLocale()</em> always returns <em>'en-US'</em></p>
<h3 dir="auto">To Reproduce</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const app = require('electron').app;
app.commandLine.appendSwitch('lang', 'ja');
app.on('ready', () =&gt; console.log('locale:', app.getLocale()));"><pre class="notranslate"><code class="notranslate">const app = require('electron').app;
app.commandLine.appendSwitch('lang', 'ja');
app.on('ready', () =&gt; console.log('locale:', app.getLocale()));
</code></pre></div>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">As far as I see, it was broken many versions ago. Is there any workaround or fixes?</p>
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>5.0.0</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>Windows 10 (1709)</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>4.1.5</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">I expected calling <code class="notranslate">app.commandLine.appendSwitch('lang', 'el')</code> and then later at app ready event that calling <code class="notranslate">app.getLocale()</code> would return <strong>"el"</strong></p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Calling <code class="notranslate">app.getLocale()</code> returns <strong>"en-US"</strong> that is the system locale currently set on local machine.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">Run this code in main process:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var electron = require('electron');
var app = electron.app;
app.commandLine.appendSwitch('lang', 'el');

app.on('ready', function () {
  console.log(app.getLocale());
});"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">electron</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'electron'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-s1">electron</span><span class="pl-kos">.</span><span class="pl-c1">app</span><span class="pl-kos">;</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-c1">commandLine</span><span class="pl-kos">.</span><span class="pl-en">appendSwitch</span><span class="pl-kos">(</span><span class="pl-s">'lang'</span><span class="pl-kos">,</span> <span class="pl-s">'el'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'ready'</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">getLocale</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">Problem exists even if there is a browserWindow created before the console.log<br>
Chromium window also uses the wrong locale.</p>