NoSuchLanguageError: No known languages found for specification English.
See original GitHub issue- Version: 22.10.5
- Electron Version: 8.5.5
- Electron Type (current, beta, nightly):
- Target: macOS
If I try to build our application with electron-builder it fails with the following exception:
⨯ No known languages found for specification English. stackTrace=
NoSuchLanguageError: No known languages found for specification English.
at Function.bySpec (/Users/dmey/workspace/drive/node_modules/dmg-license/lib/Language.js:35:19)
at Object.indexByLanguage (/Users/dmey/workspace/drive/node_modules/dmg-license/lib/Language.js:81:41)
at labelCache (/Users/dmey/workspace/drive/node_modules/dmg-license/lib/assembleLicenses.js:92:35)
at Object.assembleLicenses [as default] (/Users/dmey/workspace/drive/node_modules/dmg-license/lib/assembleLicenses.js:117:23)
at dmgLicensePlist (/Users/dmey/workspace/drive/node_modules/dmg-license/lib/index.js:27:78)
at dmgLicense (/Users/dmey/workspace/drive/node_modules/dmg-license/lib/index.js:21:62)
at dmgLicenseFromJSON (/Users/dmey/workspace/drive/node_modules/dmg-license/lib/index.js:37:18)
at addLicenseToDmg (/Users/dmey/workspace/drive/node_modules/dmg-builder/src/dmgLicense.ts:57:9)
The exact same configuration is working on a workmates device.
We have a license_de.rtf
, license_en.rtf
, licenseButtons_de.json
and a licenseButtons_en.json
in our build directory.
Thanks for your help, best regards, Dominic
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top Results From Across the Web
No known languages found for specification English. #5 - GitHub
Hey, I am trying to build one of our projects but it fails with the following exception: ⨯ No known languages found for...
Read more >Specification language - Wikipedia
A specification language is a formal language in computer science used during systems analysis, requirements analysis, and systems design to describe a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I borrowed a Mac and successfully reproduced your problem.
Problems
There are two things going on here:
licenseButtons
propertylang
is supposed to be a language tag (likeen-us
), but the documentation says to put a language name (likeEnglish
) there. Doing this results in the error message you originally reported:No known languages found for specification English.
I’ve opened issue #5887 about that.languageButtons_en-us.json
).electron-builder
expects an underscore between the language and country (as inlanguageButtons_en_us.json
), presumably for backward compatibility reasons. Putting a dash there results in the error message you reported just now:No known languages found for specification en-us-EN-US.
Solutions
lang
property from alllicenseButtons
files. It’s not needed withelectron-builder
and can only cause confusion.license_en_us.rtf
,licenseButtons_en_us.json
,license_de_de.rtf
,licenseButtons_de_de.json
.Giving a Language Name
You can give a language name in the
licenseButtons
file (though it’s optional, except for languages marked “requireslanguageName
” in the list). It goes in thelanguageName
property, notlang
. Example:However, I don’t think current macOS actually displays the language name anywhere. It still expects a language name to appear in the DMG metadata, but there probably isn’t any benefit in providing a
languageName
unless it’s required.licenseButtons
Are OptionalFor several languages, including both US English and German, you don’t actually have to provide a
licenseButtons
file at all. For any language marked as having “predefined labels” in the list, those predefined labels will be used if you don’t provide your own.Many thanks @argv-minus-one , your solution works fine 😃