perfood / couch-auth

Powerful authentication for APIs and apps using CouchDB (or Cloudant) with Node >= 14
MIT License
65 stars 19 forks source link

Internationalization support for the nunjucks templates #55

Open fynnlyte opened 1 year ago

fynnlyte commented 1 year ago
suchyjan commented 1 year ago

It is great idea :) It should be able to send a header to local.confirmEmailRedirectURL too or using parameter to callback ?success=true&lang=en or "error=...lang=en" for example to be able to display correct localized html page to the user.. The language can be also set on registration as field and saved in sl-users, but if someone wants to change the language on that user, that should be than possible by another api call for example. Or better approach can be the custom header for every API call.. And of course some change to nunjucks folder structure templates/[lang]/email with some default lang (as en) fe. I vote for this enhancement :) Thank you.

fynnlyte commented 1 year ago

It should be able to send a header to local.confirmEmailRedirectURL too or using parameter to callback ?success=true&lang=en or "error=...lang=en" for example to be able to display correct localized html page to the user.

Yeah, that makes sense.

The language can be also set on registration as field and saved in sl-users, but if someone wants to change the language on that user, that should be than possible by another api call for example. Or better approach can be the custom header for every API call.

Or maybe just use the Accept-Language Header. I don't think I want to add setting a language via sl-users in couch-auth.