-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Description
I am building a gatsby website that holds some data in data/technologies.json:
[
{
"shortName": "Frontend",
"longName": "Frontend Development",
"descriptionPath": "leistungen.techstack.frontend"
}
]
In the render method, I have code that is fetching this data with graphQL and sets the current selected element.
// get data
const techStacks = useStaticQuery...
// get current selected element
const techStack = techStacks[currentIndex]
Now, I want to use this descriptionPath
field to insert as a translation key:
<FormattedMessage
id=techStack.descriptionPath
defaultMessage="This message should be extracted"
></FormattedMessage>
But when I run formatJS to extract these defaultMessages into a language file, an arbitrary key gets generated...
formatjs extract 'src/**/*.tsx' --out-file src/intl/de.json --format simple
// should be "leistungen.techstack.frontend": "This message should be extracted"
"rnIXQm": "This message should be extracted"
Why is that? I can't be the only one with this problem. I feel like iterating over an array with data that should be dynamically translated is very common. Really hope someone can assist me with that.
Alex
Metadata
Metadata
Assignees
Labels
No labels