i18n Trap #1
By Adrian Sutton
i18n trap #1: I should have a simple way to map an Enum to a presentable string.
This seems eminently reasonable at first glance – there are many cases where you have one of a set of things and need to inform the user which one you have. Unfortunately human language, unlike their computer language counter-parts, are context-dependent. So that single Enum value in code could well be presented with many different words when presented as part of different sentences or in different contexts.
It turns out that it’s not just language contexts that use these variants either. You might display a short string as a value in a table but have a longer explanatory string as the tooltip. That should be natural within the code, not some special case exception.