The electron zip file contains 100s of language.lproj folders, and this causes the mac app store to list the app as being available in all of these languages.
You can use afterPack, but if you can write code, it is better to prepare PR instead of hack on your side.
Would electron build be interested in adding code to allow me to choose which of these folders to leave and which to remove?
Yes, files currently affects only app code, not electron distribution. Maybe electronFiles?
Do you know, for what so many empty language.lproj directories? Maybe we can just leave en.lproj and electronFiles will allow to add another if need?
For the moment I am adding quick fix to my gulp task. I'm going to put it here for reference. If I find some time ill try and make a pull request.
let languages = ['en'];
electronBuilder.build({
platform: getElectronPlatforms(),
devMetadata: {
build: {
afterPack: ({appOutDir, options}) => {
return new Promise((res, rej) => {
console.log('afterPack', appOutDir, options.platformPackager.platform);
if (options.platformPackager.platform.name === 'mac') {
let glob = require('glob'),
del = require('del');
glob(`${appOutDir}/${options.appInfo.name}.app/Contents/Resources/!(${languages.join('|')}).lproj`, (err, files) => {
if (err) return rej(err);
del(files).then(res, rej);
});
} else {
res();
}
});
}
}
}
})
Do you like electronFiles solution?
I'd probably be more inclined to add a list of languages as a setting, that's why I put languages as a variable in that code.
I think it might be hard to get electron to remove the default ones.
Is there a way of doing this without afterpack? I'm not using the programmatic api, and I don't want to start using it because of that (I run my build using gradle/kotlin, so no easy javascript support there).
@fab1an for what?
Never mind, I just added a .js-file to my build for now.
Reopened — requested by 2 VIP users is enough to implement.
Implemented. mac.electronLanguages Set to array of lang codes. e.g. ["en", "bn"]
Hello, can I ask you why electron-builder does not accept pt-BR, zh-TW or zh? Is there any reason for that?
Thank you
I have figured out, that I have to use pt_BR, zh_TW and so on. Sorry for bothering you
Reopened — requested by 2 VIP users is enough to implement.
@develar Are VIP users still a thing? If yes how does one become a VIP user?
Most helpful comment
Implemented.
mac.electronLanguagesSet to array of lang codes. e.g.["en", "bn"]