aboutsummaryrefslogtreecommitdiff
path: root/src/lib/notification-i18n-loader.js
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-19 13:34:04 +0000
committerlain <lain@soykaf.club>2020-06-19 13:34:04 +0000
commit1afa0f004455175e5bc1770cae5c7833a1a0e84f (patch)
tree48725152f1e0099e84bb02fe33a947c5e96f5eed /src/lib/notification-i18n-loader.js
parent267102809d3e866d510c42bd4cf0dbfa36094703 (diff)
parented908e0195db26ec9c51d124315bc084c5576a29 (diff)
Merge branch 'notification-unification-experiments' into 'develop'
Notification unification / WebPush i18n. See merge request pleroma/pleroma-fe!1142
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)
+}