Fixed JS plural function to be per app

Some apps might not define the same "nplural" value.
To avoid conflicts, the plural function is now generated per app.

Fixes #6427
Merge pull request #6431 from owncloud/core-pluraltranslationsfix

Added plural translation fallback