@goodandready/dsh-voice 0.8.18 → 0.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ exports.inject = ['timer', 'slots', 'settingsScope', 'locale']
2
+ exports.apply = function apply(ctx) {
3
+ // English is the source language. Other languages come from the
4
+ // separate translation plugin at runtime. Re-registering the same
5
+ // namespace+language throws, so tolerate a pre-registered dictionary.
6
+ const addLocale = (locale, dictionary) => {
7
+ try {
8
+ return ctx.locale.register(NS, locale, dictionary)
9
+ } catch (alreadyTaken) {
10
+ return () => {}
11
+ }
12
+ }
13
+ ctx.effect(() => {
14
+ const undo = [addLocale('en', en)]
15
+ return () => { for (const off of undo) off() }
16
+ }, 'dsh-voice: locale dictionaries')
17
+ moduleT = ctx.locale.bind(NS)
18
+ registerComposer(ctx)
19
+ registerSettings(ctx)
20
+ }
21
+ return module.exports
22
+ },
23
+ })