mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
301713ef96
This patch upgrades the MessageFormat library to version 3.3.0 from 0.1.5. Our `I18n.messageFormat` method signature is unchanged, and now uses the new API under the hood. We don’t need dedicated locale files for handling pluralization rules anymore as everything is now included by the library itself. The compilation of the messages now happens through our `messageformat-wrapper` gem. It then outputs an ES module that includes all its needed dependencies. Most of the changes happen in `JsLocaleHelper` and in the `ExtraLocales` controller. A new method called `.output_MF` has been introduced in `JsLocaleHelper`. It handles all the fetching, compiling and transpiling to generate the proper MF messages in JS. Overrides and fallbacks are also handled directly in this method. The other main change is that now the MF translations are served through the `ExtraLocales` controller instead of being statically compiled in a JS file, then having to patch the messages using overrides and fallbacks. Now the MF translations are just another bundle that is created on the fly and cached by the client. |
||
---|---|---|
.. | ||
about | ||
admin/backups | ||
application | ||
badges | ||
categories | ||
common | ||
default | ||
embed | ||
exceptions | ||
finish_installation | ||
groups | ||
invites | ||
layouts | ||
list | ||
metadata | ||
offline | ||
posts | ||
published_pages | ||
qunit | ||
robots_txt | ||
safe_mode | ||
search | ||
session | ||
sitemap | ||
static | ||
tags | ||
topics | ||
user_api_keys | ||
user_notifications | ||
users |