I have a number of applications written in different languages (Java, JavaScript, PHP, etc.). Their presentation / presentation layers display things in various formats: HTML, plain text, etc.
I want to display some text / numeric data approximately the same in every application. Of course, the result will vary slightly depending on the output format (for example, if you output HTML, you will need to run some HTML encoding functions, and if you output plain text, you will have to ignore things like links.)
So, I was thinking of storing formatting information in some abstract configuration language. Then each application can analyze formatting information, convert it into code in its own language and run the code to generate the actual text displayed.
For example:
Welcome <username>.
Your balance is <balance format: usDollars>.
<if returning> You last logged in on <lastLoginDate format: m / d / Y> </if>
My question is: do I need to come up with such a syntax from scratch? Or is there an existing template / formatting language that has become cross-platform?
JW. source
share