-
-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to ICU MessageFormat #2759
Conversation
I'm for the first option too. Smaller bundle! 👍 |
Maybe we should include |
This might hurt performance, as MessageFormat is more complex than non-MessageFormat. However, consistency would be a benefit: we would no longer need to include curly braces in variable keys. Plus, we're using MessageFormat code in the frontend anyway. |
I got it working for 95% of what we need via ultraq/icu-message-formatter#7, other needed changes are outlined in the same issue. If that isn't merged, we can just include the code from the PR in our repo; this library is very extensible! |
After some more thought, why don't we ise |
d7db6d5
to
23cce36
Compare
This is ready for review, but we can't merge until the items in TODO are implemented over in https://github.com/ultraq/icu-message-formatter |
[ci skip] [skip ci]
This makes it simpler to mark them as requiring intl-icu formatting
No longer necessary now that we use MessageFormat
702b796
to
f54c288
Compare
No longer WIP, this is now ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome, but please involve our translators if this hasn't happened yet (a discussion under the i18n - https://discuss.flarum.org/t/i18n - tag would be smart. At least they need to know in advance because this will be NBC for all translations.
[ci skip] [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Foundation for flarum/issue-archive#385
Closes #2745
Closes #2062 as moot
Changes proposed in this pull request:
Done:
+intl-icu
files in locales and language packs for backend translatorTODO:
Reviewers should focus on:
+intl-icu
be the default for ALL files? This might have slight performance ramifications, but it would also be more consistent (see expected results ofcustom_translation_exists_if_added
vscustom_translation_does_not_exist_by_default
in the backend tests). This would be a further breaking change though. But it would be more consistent with what's done on the frontend. Currently in the PR.Confirmed
composer test
).