mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-20 22:23:53 +08:00
fix(locales): Copy lproj files to ensure navigator.language works
See https://github.com/atom/electron/issues/2484
This commit is contained in:
parent
b3bf4ad65d
commit
159bb51a10
1 changed files with 12 additions and 0 deletions
|
@ -25,6 +25,18 @@ module.exports = (grunt) ->
|
|||
cp(path.join(shellAppDir, 'Contents', 'MacOS', 'Electron'),
|
||||
path.join(shellAppDir, 'Contents', 'MacOS', 'Nylas'))
|
||||
rm path.join(shellAppDir, 'Contents', 'MacOS', 'Electron')
|
||||
|
||||
# Create locale directories that were skipped because they were empty.
|
||||
# Otherwise, `navigator.language` always returns `English`.
|
||||
resourcesDir = 'electron/Electron.app/Contents/Resources'
|
||||
filenames = fs.readdirSync(resourcesDir)
|
||||
for filename in filenames
|
||||
continue unless fs.statSync(path.join(resourcesDir, filename)).isDirectory()
|
||||
continue unless path.extname(filename) is '.lproj'
|
||||
destination = path.join(shellAppDir, 'Contents', 'Resources', filename)
|
||||
continue if fs.existsSync(destination)
|
||||
grunt.file.mkdir(destination)
|
||||
|
||||
else if process.platform is 'win32'
|
||||
cp 'electron', shellAppDir, filter: /default_app/
|
||||
cp path.join(shellAppDir, 'electron.exe'), path.join(shellAppDir, 'nylas.exe')
|
||||
|
|
Loading…
Reference in a new issue