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

feature(transloco): Use MessageFormatTranspiler with FunctionalTranspiler #705

Open
1 task done
MikeDabrowski opened this issue Sep 22, 2023 · 3 comments
Open
1 task done

Comments

@MikeDabrowski
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Which Transloco package(s) will this feature affect?

MessageFormat

Is your feature request related to a problem? Please describe

Is there a way to combine the MessageFormatTranspiler and FunctionalTranspiler?
Current impl of MessageFormatTranspiler extends DefaultTranspiler. I havent found any hint in the docs apart creating custom one myself.

Describe the solution you'd like

No response

Describe alternatives you've considered

CustomTranspiler extends FunctionalMessageFormatTranspiler extends FunctionalTranspiler.

I just started writing it, not sure if it will work.

Additional context

No response

I would like to make a pull request for this feature

Yes 🚀

@shaharkazaz shaharkazaz changed the title Use MessageFormatTranspiler with FunctionalTranspiler feature(transloco): Use MessageFormatTranspiler with FunctionalTranspiler Sep 26, 2023
@shaharkazaz
Copy link
Collaborator

@MikeDabrowski I'll have to consider how since it wasn't raised before.
I would love to hear your functional transpiler use case! I don't get much comments about it.

@MikeDabrowski
Copy link
Author

We have an alert type component - just a rectangle with background and text we display to notify user of some important things.

That already has translation that uses markdown. Now UX has the idea that we need to show additionally a list of errors there. If But those errors each has to be translated as well. I thought maybe I could just append the translated errors for markdown to render them. But I thought the logic to do so would be best moved to such function.

I tried to merge Functional and MessageFormat ones but the fn didn't work.

In the end (we need this done by the end of this week) I just created new component and have two regular translations.

@MikeDabrowski
Copy link
Author

We just got another feature where this fn would be useful - need to replace some parts of translations based on dynamic config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants