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

What is the best way to extract enums? #191

Open
sibelius opened this issue Jul 24, 2020 · 0 comments
Open

What is the best way to extract enums? #191

sibelius opened this issue Jul 24, 2020 · 0 comments

Comments

@sibelius
Copy link

🚀 Feature Proposal

Fbt enables use to extract translations for enums
I'd like to be able to extract enums from the code

check this https://facebook.github.io/fbt/docs/enums/

<fbt desc="buy prompt">
  Buy a new
  <fbt:enum enum-range={{
    CAR: 'car',
    HOUSE: 'house',
    BOAT: 'boat',
    HOUSEBOAT: 'houseboat',
  }} value={enumVal} />!
</fbt>

Motivation

We have some fixed enums that needs translations, like options in an autocomplete

Example

Right now we are doing manual extraction like this:

"MYENUM.DUPLICATED": "Duplicate",
  "MYENUM.INVALID": "Invalid",
  "MYENUM.VALID": "Valid",
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

1 participant