0.6.0 • Published 6 months ago
electron-packager-languages v0.6.0
Electron Packager Plugin: Languages
Reason
After packaging an Electron application, it contains all possible languages whether it supports or not. Then all those languages are listed e.g. at the App Store. The folders of unsupported languages should be removed in order to hide those languages at the detail page of the product.
Usage
Use the afterCopy
hook in Electron Packager to run this plugin.
const setLanguages = require('electron-packager-languages');
electronPackager({
...
afterCopy: [setLanguages(['en', 'en_GB'])]
})
Note that different platforms have different language/locale identifiers, e.g. Windows has en-GB
while macOS has en_GB
. See also issue #57.
In order to protect users from accidentally removing all languages from an app, there's an allowRemovingAll
option that defaults to false
. It can be overridden like this: setLanguages(['en', 'en_GB'], { allowRemoveAll: true })
.