Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications in different languages #456

Open
saschabrockel opened this issue Sep 22, 2021 · 6 comments
Open

Notifications in different languages #456

saschabrockel opened this issue Sep 22, 2021 · 6 comments
Labels
area:notifications Everything related to notifications feature-request Request for new features to be added

Comments

@saschabrockel
Copy link

Describe the solution you'd like
It would be nice if the notifications would be in the same language as the interface or that you could choose the language or even individualize them. Currently, I've set the web interface to German but I'm still getting my mails, Discord & Telegram notifications in English. The problem is that not everybody speaks English especially older people.

@saschabrockel saschabrockel added the feature-request Request for new features to be added label Sep 22, 2021
@zsxeee
Copy link
Contributor

zsxeee commented Sep 22, 2021

Seems we need the server-side translation, including response message and notification message.

@Saibamen
Copy link
Contributor

@zsxeee The simplest way -> return message codes (with parameters if any) from server. Frontend will translate it with interpolation (https://www.i18next.com/translation-function/interpolation)

@Saibamen
Copy link
Contributor

But for notifications, IMO it will be better if translation keys will be in new object-key, like:

notifications: {
   LOGIN_SUCCESS: "Logged in successfully",
   UNEXPECTED_ERROR: "Unexpected error detected. Please try again, check if you have latest app version or report a bug in GitHub"
}

@zsxeee
Copy link
Contributor

zsxeee commented Sep 22, 2021

@Saibamen After check "notification-providers", I found many notification messages have their message text with little difference. It will make many unnecessary translation works.
Before add translation keys, I think we need a common message format/template first.

@louislam
Copy link
Owner

louislam commented Sep 23, 2021

@Saibamen After check "notification-providers", I found many notification messages have their message text with little difference. It will make many unnecessary translation works.
Before add translation keys, I think we need a common message format/template first.

Agree, but it is not an easy task, as some notification payloads are very special such as Discord and MS Teams.

@deefdragon
Copy link
Contributor

deefdragon commented Oct 9, 2021

While the card on discord etc. are nice, I think that the priority should be creating a general text template to use for most supported notifications (with potentially some specific ones for the special cases like twitter with its character limits).

Ideally, the templates could be over-ridden by the user for customization, or personal translation if a community translation has not yet been done. In the best case, you could override the templates on a per-notification basis, as well as override the default notifications (thus updating all notifications without needing to update them separately).

From the quick searching I have done, I think liquidjs might be a good option for the templates, as Liquid appears to be a reasonable enough language for what most kuma users need, and the library is actively maintained.

The special cases that need an object, such as discord's card, might be done by accepting a JSON object as the "template", and running each non obj/array in the object against the template engine. You could also generate raw JSON with the template, and use that. In either case, building a custom template or translation would be a bit messy for discord etc., but it would still be possible.

There are several other issues that I think all boil down to more customization on the notification message (#524, #582, #172, #208, #428) and I think using a template engine would solve the lot, while also potentially providing a work-around to a number of others such as #570 and #40 (depending on the data available to the template)

I would be willing to take a crack at a proof of concept implementing luquidjs, but there is a small chance someone else will need to finish it as I will be loosing some of my free time following next week. If you think that this has a good chance of being used, I will create a new issue to track progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:notifications Everything related to notifications feature-request Request for new features to be added
Projects
None yet
Development

No branches or pull requests

6 participants