Internationalisation of system notes
Problem to solve
Currently the text for system notes is constructed in markdown, rendered once and then saved in the database. This has a number of problems:
- we are constructing markdown in Ruby which is fragile, and indirect
- if we edit the note text definition, the body of existing notes is not updated
- we are constructing text in English that we cannot internationalise
- this hampers our ability to iterate, since system notes do not change with new code
Intended users
This affects all users, since system notes are widely used. It particularly affects international users and those who cannot or choose not to use English.
Proposal
System notes should ideally be pure data, without rendered representations. We should be able to render them (with appropriate caching) based on the data they hold, into the user's localisation. We do this with parts of the note (its time, the author) but we do not do this to the note itself.
Any change to system notes is wide ranging and needs to be backwards compatible. The existing rendered notes will remain in our database and are not going anywhere. They need to continue to work. We need to do this in a way that does not need an all-or-nothing effort, but where we can gradually move to a better way of presenting information on a case-by-case basis.
Permissions and Security
This requires no especial permissions.
Documentation
This will require developer documentation explaining how to use the system note APIs.
Testing
This could have an impact on performance, since we will have more data to render at (or close to) runtime. Caching may help, but the whole point here is to render the data as the user needs to see it.
This affects a lot of systems (issues, discussions, MRs) and they all need to continue to work as present.
What does success look like, and how can we measure that?
Success is:
- As a user, I have my interface localised to my native language (not English), and I see system notes (e.g. "Joe Bloggs commented on issue") in my native language
- As a developer, if I change a note presentation, then that affects previously created notes of the same type.
cc: @phikai