Localization of Health Checks
# package-development
s
I'm slowly getting my packages ready for Belissima. I have some health checks that I would like to localize though. Is it correct that I can't localize texts in a health check using the js localization files? Also - is it possible to localize the name and description of a health check (the parts configured in the HealthCheck attribute on the class)?
m
This is a good question 😄 I find my self wanting to perform localization of some "server side stuff" as well. I've passed down the translation keys from the server which works on most cases but I have not played with Health Checks so I can't really speak for that, sorry.
s
Attributues on classes (in)famously can't be translated, but there have been workarounds in the past..
Internally, we localize like this: https://github.com/umbraco/Umbraco-CMS/blob/v14/dev/src/Umbraco.Core/HealthChecks/Checks/Security/HttpsCheck.cs#L118 Not sure if the attributes can be translated though, I don't think we have anything for that at the moment (nor in v13 and below 😅 )
2 Views