- Log event IDs, not messages.
- Capturing data associated with a specific event, together with the event identifier.
- When a user views the log, localize the event message based on a unique identifier.
The problem that you will encounter is that you are trying to insert dynamic data into messages in an interactive way. For example, if you need to write “No messages found” against “One message found” against “X messages found” is problematic - in English we have different values for zero, one or more than one ... but this is not necessarily the same as in other languages. Things like numbers or dates are less problematic to insert into a String.Format form, but you do not want you to try to dynamically generate a real language locally.
I would recommend the following template, similar to the Windows event log, in which you displayed the event identifier, a localized message based on the event identifier and then fixed certain "fields" in which you localize the field name and the displayed field format, for example, "Amount: $ 2.00" or something else. Perhaps this is not the most beautiful way, but if you do not have a full-fledged linguist dedicated to this, and you intend to take into account all the subtle nuances in each language, I would post it and go with a simpler output format for the magazine.
In this example, you must separate the log message from the data, for example:
Customer did not complete payment.
Amount: XX
You would register a message identifier, for example, "13579" may be a unique identifier for the event when the customer does not complete the payment. Finally, you can save this value as a separate field.
How do you know how many fields to highlight an event or how to store data ... well, the exercise is best left to the reader.
source share