Skip to content
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

Add basic tests for PHP and JS Translators #3735

Draft
wants to merge 6 commits into
base: 2.x
Choose a base branch
from

Conversation

rob006
Copy link
Contributor

@rob006 rob006 commented Feb 15, 2023

Failing tests to demonstrate the discrepancy between JS and PHP translators.

Related issues: #3702, #3734, #3685

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)
  • Related core extension PRs: (Remove if irrelevant)

@rob006 rob006 requested a review from a team as a code owner February 15, 2023 16:58
@rob006 rob006 marked this pull request as draft February 15, 2023 16:58
@rob006
Copy link
Contributor Author

rob006 commented Mar 18, 2023

@askvortsov1 Is there any particular reason why https://www.npmjs.com/package/@ultraq/icu-message-formatter was chosen for ICU formatting? It seems to lack some basic features. I tested https://www.npmjs.com/package/format-message and https://www.npmjs.com/package/intl-messageformat and both looked more mature and reliable. And they have separate packages to parse message to token-like format - it could be used to handle rich-syntax support with less magic than current implementation, which relies on string operations on original message.

@SychO9
Copy link
Member

SychO9 commented Apr 30, 2023

@askvortsov1 sorry for the second ping, but any chance you recall? I'd like to try to look into this before 1.8 is over

@askvortsov1
Copy link
Sponsor Member

@askvortsov1 sorry for the second ping, but any chance you recall? I'd like to try to look into this before 1.8 is over

Hey, sorry, missed this one. Iirc, it came down to package size: the ultraq one is 6kb, vs 22kb and 28kb respectively. That being said, with the (broken) rich text changes, it comes out to ~10kb, and I don't know that there's a trivial fix. It would probably be worth it to switch to a more mature, widely-used package.

@SychO9 SychO9 changed the base branch from main to 2.x May 27, 2023 17:41
@SychO9 SychO9 added this to the 2.0 milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants