aboutsummaryrefslogtreecommitdiff
path: root/src/lib/notification-i18n-loader.js
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-06-25 15:28:17 -0500
committerMark Felder <feld@FreeBSD.org>2020-06-25 15:28:17 -0500
commit199fc9351d2db400a966750a23c2b3077345a383 (patch)
tree657c01da3db0bcace07c7003d61456c5940aa7d0 /src/lib/notification-i18n-loader.js
parentb8350423d97cf81708795ec6383803413e7bff98 (diff)
parentbbb91d8ae3f1c3d5374de7610e723e63121e8222 (diff)
Merge branch 'develop' into refactor/notification_settings
Diffstat (limited to 'src/lib/notification-i18n-loader.js')
-rw-r--r--src/lib/notification-i18n-loader.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/notification-i18n-loader.js b/src/lib/notification-i18n-loader.js
new file mode 100644
index 00000000..71f9156a
--- /dev/null
+++ b/src/lib/notification-i18n-loader.js
@@ -0,0 +1,12 @@
+// This somewhat mysterious module will load a json string
+// and then extract only the 'notifications' part. This is
+// meant to be used to load the partial i18n we need for
+// the service worker.
+module.exports = function (source) {
+ var object = JSON.parse(source)
+ var smol = {
+ notifications: object.notifications || {}
+ }
+
+ return JSON.stringify(smol)
+}