Closed luaneko closed 3 years ago
Personally I don't think using an ID in source code to translate is good.
You should consider using defaultMessage
:
<FormattedMessage
defaultMessage="Control Panel"
description="title of control panel section"
/>
ref: https://formatjs.io/docs/getting-started/message-extraction/
Personally I don't think using an ID in source code to translate is good. You should consider using defaultMessage
I've considered this, and I decided not to use it still.
The main problem with auto extraction is that it doesn't handle dynamic message contents. e.g.
<FormattedMessage defaultMessage={character.name} />
The extractor fails saying we need constant messages, but we need dynamic messages if we want to be able to translate database stuff like character and weapon names.
You can use ID with dynamic messages. And use defaultMessage
with static messages.
Resolves #53