mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:01:20 +08:00
FIX: Allow invalid plural keys in MF translations
We can get translations with invalid plural keys from Crowdin or from custom overrides. Currently, this will raise an error and the locales won’t be outputted at all. This patch addresses this issue by using the new `strict: false` option of our `messageformat-wrapper` gem, allowing to generate locales even if there are invalid plural keys present.
This commit is contained in:

committed by
Loïc Guitaut

parent
5dca68dc1d
commit
c4845acf5e
@ -150,7 +150,7 @@ module JsLocaleHelper
|
||||
)
|
||||
end
|
||||
.compact_blank
|
||||
compiled = MessageFormat.compile(message_formats.keys, message_formats)
|
||||
compiled = MessageFormat.compile(message_formats.keys, message_formats, strict: false)
|
||||
transpiled = DiscourseJsProcessor.transpile(<<~JS, "", "discourse-mf")
|
||||
import Messages from '@messageformat/runtime/messages';
|
||||
#{compiled.sub("export default", "const msgData =")};
|
||||
|
Reference in New Issue
Block a user