You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When returnDetails is set to true, the returned object includes the key, language, namespace and other important details. However, it does not include any parameter values passed to t() and used in interpolation.
Motivation
In order to understand what drove a particular translation, the details include everything you would need to trace the specific resource being used to drive res. Everything, that is, except interpolated parameters specifically passed into t(). These values are crucial details about the resolved translation if interpolation was involved.
Example
In our specific situation, we need to be able to "pass thru" the context data for a message from a back end GraphQL API through to the API client so it might drive their own localization upon ingesting our API responses. In other words, if we do this:
This is similar to returnObjects in concept, but more "pass thru" in that we shouldn't have to declare every parameter and the structure of the returned object in our en.json file. This way, we can structure a post-processor to massage the translation to match our GraphQL schema in the resolver.
The text was updated successfully, but these errors were encountered:
馃殌 Feature Proposal
When
returnDetails
is set totrue
, the returned object includes the key, language, namespace and other important details. However, it does not include any parameter values passed tot()
and used in interpolation.Motivation
In order to understand what drove a particular translation, the details include everything you would need to trace the specific resource being used to drive
res
. Everything, that is, except interpolated parameters specifically passed intot()
. These values are crucial details about the resolved translation if interpolation was involved.Example
In our specific situation, we need to be able to "pass thru" the context data for a message from a back end GraphQL API through to the API client so it might drive their own localization upon ingesting our API responses. In other words, if we do this:
The results in
translation
should be something like:This is similar to
returnObjects
in concept, but more "pass thru" in that we shouldn't have to declare every parameter and the structure of the returned object in ouren.json
file. This way, we can structure a post-processor to massage the translation to match our GraphQL schema in the resolver.The text was updated successfully, but these errors were encountered: