vanilla/vanilla — pull request #2245 by JasonBarnabe (2014-11-07 05:19:11+00:00)
Title: Fix up PluralTranslate calls

In https://github.com/vanilla/vanilla/commit/5859c8d51ea09069a05303fa5dc15f514dc10ab3, the function `PluralTranslate` was introduced and used for strings like "n views". In that check-in, the keys being looked up are like `'%s view html'` - these keys are not defined anywhere. (I thought that maybe the ` html` was a flag that made the l18n functions do something special, but I can't find anything that would do that.) `PluralTranslate` accepts a separate default (in this case, it's ``'%s view`), which would've made it work correctly (in English only) after this commit.

Then along comes https://github.com/vanilla/vanilla/commit/9b7cbb47eda42e5cb441da4d91c40920f65ca2f1; now, the keys are translated before `PluralTranslate` gets them. `'%s view html'` still doesn't exist, so remains the same when passed in to `PluralTranslate`, which attempts to translate it again and fails. The default parameter `%s view` gets properly translated to whatever locale we want, `PluralTranslate` wants to use it since it couldn't find `'%s view html'`, attempts to translate it again, fails, but since it was already translated, things are fine!

This PR sorts out this mess. Tested on latest stage and the strings still are being translated correctly.