We are attempting to translate our application into the Korean language using the ICU library's MessageFormat (more specifically, PHP's MessageFormatter).
The Korean language makes extensive use of suffixes (어미), which attach onto the end of words. The form of most nominal suffixes are dependent on the final consonant (받침) of the final syllable of the preceding noun. For example, the subject marker takes the form 이 (-i) when it follows a final consonant and 가 (-ga) when there is no final consonant. So translators who are given:
{0} is good.
John is good.
Susie is good.
might translate it as:
{0}이 좋다. ({0}-i joh-da.)
길동이 좋다. (gil-dong-i joh-da.)
if {0} ends in a consonant, and as:
{0}가 좋다. ({0}-ga joh-da.)
지혜가 좋다. (ji-hye-ga joh-da.)
if {0} doesn't end in a consonant.
One convention is to format strings like these as:
{0}이(가) 좋다. ({0}-i(-ga) joh-da.)
지혜이(가) 좋다. (ji-hye-i(-ga) joh-da.)
Of course this looks clumsy and unprofessional and is precisely the sort of thing MessageFormat was designed to eliminate (at least in the case of plurals and gender-dependency, neither of which, incidentally, are relevant to the Korean language).
Ideally, what I need is functionality similar to plural or select, but specifically for allowing translators to easily provide different translations based on the detected final consonant. Something like this would be ideal:
{0}{0, final, none {가} other {이}} 좋다.
{0}{0, final, none {로} ㄹ {로} other {으로}} 갔다.
I've thought about implementing a pre-processor to parse out such deterministic, locale-dependent formats and to inject them as additional arguments before passing them into MessageFormatter, but I'd like to avoid the overhead of parsing the string twice if possible.
What is the best practice for handling this kind of situation with MessageFormatter?