Fixes#5353.
I made the promise usage consistent in the relevant addKeyboards
functions, instead of mixing promise and async/await style code, which
made it easier to spot the place(s) where promises had not been returned
as we needed.
Relates to #949.
* Adds optional `displayName` property to keyboard stubs: if present,
this will override the name on the spacebar.
* Adds optional `spacebarText` member to `keyman.options`. This defaults
to `SpacebarText.LANGUAGE_KEYBOARD`, and can be one of:
```
SpacebarText.LANGUAGE
SpacebarText.KEYBOARD
SpacebarText.LANGUAGE_KEYBOARD
SpacebarText.BLANK
```
* Sets the display pattern for LANGUAGE_KEYBOARD to be
"language - keyboard" instead of "language (keyboard)", which
reduces the number of parentheses visible on the spacebar.
There are a number of changes here to improve the performance of
KeymanWeb and the toolbar and reduce unnecessary requests:
1. (kmwbase.ts and kmwkeyboards.ts) Added option `setActiveOnRegister`,
default `'true'`; if set to `'false'` then will never attempt to
activate the first registered keyboard. Note that this property is a
string because the `options` object currently supports only string
types, which is not ideal, but out of scope for this PR.
2. (kmwuitoolbar.ts) fixed issue with toolbar not matching correctly on
full BCP 47 code (line 960) after keyboard change notification.
3. (kmwuitoolbar.ts) fixed issue with toolbar not showing active
keyboard if the keyboard is activated before init is complete
(see `ui.lastSelectedKeyboard` references).
4. (kmwuitoolbar.ts) avoided re-entrancy for `ui.changeKeyboardEvent`
by ensuring that `ui.selectKeyboard` does not attempt to set the
active keyboard again for keymanweb; note that this was being caught
by the event dispatcher in keymanweb but it was still not ideal.
5. (kmwuitoolbar.ts) with above changes, able to remove appalling two
second timeout on load (yay!)
These changes will be useful immediately with keymanweb.com.