Is there a way to access the defineMessages
parameter object keys
for id
generation?
#4097
Unanswered
ansavchenco
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
babel-plugin-formatjs
supportsidInterpolationPattern
where you can use[path]
,[name]
and things like[sha512:contenthash:base64:6]
but there is no way to get the key of the object and the variable name the result ofdefineMessages
is assigned to?Example.
Let's say i have a file
src/feature-name/translations.ts
with the following messages defined in it:The unique ids could easily be generated by a pattern
[path][name]/[object]/[key]
which will result in thesrc/feature-name/translations/someKey
. Any ideas how this could be done with the available plugins fromformatjs
?Beta Was this translation helpful? Give feedback.
All reactions