cap-js/notifications

Detection of locale not possible with hardcoded property language

Opened this issue · 0 comments

Creating a Notification in my custom service, i am not able to detect the initiator language, because Notifications are send by service and not by user.

For this reason, all Properties contain a Language flag to control, which NotificationType Template language should be used.

Currently, is is not possible to set the language.

utils.js

const properties = [
    {
      Key: "title",
>>>   Language: "en",
      Value: title,
      ...
    },

I think, this should be req.locale or additionally a config option in the in the alert api.

What do you think?

My current Workaround looks like this:

/*
data: {
    ID: ID,
    subject: subject,
    text: text
},
*/
Properties: [
    {
        Key: 'ID',
        Language: locale,
        Value: ID,
        Type: 'String',
        IsSensitive: false
    },
    {
        Key: 'subject',
        Language: locale,
        Value: subject,
        Type: 'String',
        IsSensitive: false
    },
    {
        Key: 'text',
        Language: locale,
        Value: text,
        Type: 'String',
        IsSensitive: false
    }
],

but your data option is more convenient!

Regards
Holger