Support for variables for dynamic message translations
As a Corevist employee, I would like to add a new message translation which can interpret the variables returned from SAP.
- as a user in the cart receiving the duplicate order message, I want to know which order has already used this PO number ( EPHI-333 )
- as a user in the cart, I want to know the available and delivered quantities when there is a problem ( EPHI-339 )
Message translations use this syntax:
msg|some text %{ some variable } and more text and %{ another variable }
We could improve this by allowing something like this:
msg|some text %{msgv1} and the other text %{msgv2}
In this way, we would not need a rails change/commit in order to offer custom messages in the cart.
Furthermore, message variables need interpretation when they are quantities, currencies, dates, or units of measure so that they appear in the users preferred format.
For example, a message might be "Quantity 1,234.000 CTN ordered on 12/24/2022" which gets sent back from SAP as
ZCOREVIST-001 | msgv1 = 1234.000 | msgv2 = KAR | msgv3 = 20221224
The translation would be maintained something like
msg|zcorevist-001
Quantity %{ msgv1.toqty } %{ "lbl|unit%{msgv2}" } ordered on %{ msgv3.to_date }
This would be the same for overall messages but also item messages in the cart.