Refactor Diff display error message
At the moment, the error message when the diff cannot be displayed, it's split among different subclassed objects.
The final sentence is rendered as: "This %{viewer} could not be displayed because %{reason}. You can %{options} instead."
. To build it we need info from the diff viewers because each one of them stores the %{viewer}
part, and again we need them for the %{reason}
and %{options}
.
As @reprazent pointed out in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812#note_126229525, this structure can lead to weird translated sentences. For example:
Deze gerenderde diff kon niet worden weeregeven omdat het te groot is. Bekijk de blob
vs Deze diff kon niet worden gerenderd omdat hij te groot is. Bekijk de blob.
The proposal is to rewrite each message as a whole.