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

Compile to FormatJS compiled format with formatphp compile CLI command #95

Open
ramsey opened this issue Aug 22, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@ramsey
Copy link
Contributor

ramsey commented Aug 22, 2023

Compile to FormatJS compiled format with formatphp compile CLI command

We already have the compilation capability built-in to FormatPHP, for validation purposes. We should expose this to users through a formatphp compile command that works similarly to the formatjs compile command.

This will enable sharing the same translation files across front-end and back-end code.

Background/problem

FormatJS has a special compilation step that helps improve performance and efficiency internally, since it's a type of AST for translation strings. You can read more about the compile command here:

FormatPHP already implements the same AST compilation process in order to validate messages. We need to expose this as a compile command to output the AST and save to a file. With this functionality, users could merge their translation files to usethe same ones for front-end and back-end.

Proposal/solution

Add a compile command to the FormatPHP CLI tool that mirrors the functionality of the FormatJS command of the same name: https://formatjs.io/docs/tooling/cli#compilation

@ramsey ramsey added the enhancement New feature or request label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant