Commit graph

4 commits

Author SHA1 Message Date
Brad Jorsch
a2aa77740f libs/Message: Add static constructor
When chaining ->params() methods, this is more convenient than having to
put extra parentheses around the "new".

Change-Id: I34845310e6bfdfbf1924b27eb58a734f2991fe13
2019-10-17 15:57:54 -04:00
Brad Jorsch
0395cc8bf5 libs/Message: Improve tests
If code in libs isn't supposed to depend on stuff outside of libs, then
that code's tests shouldn't either.

Also, let's explicitly test MessageParam and its subclasses.

Change-Id: I87b7c6aabea5bdb694cc598a412e0428cd78a68a
2019-10-17 10:36:41 -04:00
Brad Jorsch
ce79d607c7 libs/Message: Improve documentation
Among other things, this removed mention of MediaWiki classes from the
library and adds a README.md that attempts to define constraints for
interoperability between libraries producing MessageValues and formatter
implementations that are expected to handle them.

This also renames "TextParam" to "ScalarParam", as that seems a more
accurate name for the class.

Change-Id: I264dd4de394d734a87929cf4740779e7b7d0e04a
2019-08-29 17:04:01 -04:00
Tim Starling
09cd8eb080 MessageFormatterFactory
An injectable service interface for message formatting, somewhat
narrowed compared to Message.

Only the text format is implemented in this framework so far, with
getTextFormatter() returning a formatter that converts to the text
format. Other formatters could be added to MessageFormatterFactory.

Bug: T226598
Change-Id: Id053074c1dbcb692e8309fdca602f94a385bca0c
2019-08-28 12:28:05 +10:00