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
In a controller it would be nice for i18n if we're able to do:
action() {
return $this->json(['message' => new t('id')]);
}
The payload would contain the translated string, eg. {"message": "translated"}.
Note if one wants a custom payload, eg. {"message": {"id": ..., "domain": ...}} i tend to prefer a custom normalizer instead, or control it by a context option.
Example
No response
The text was updated successfully, but these errors were encountered:
carsonbot
added
the
RFC
RFC = Request For Comments (proposals about features that you want to be discussed)
label
Mar 14, 2023
Description
In a controller it would be nice for i18n if we're able to do:
The payload would contain the translated string, eg.
{"message": "translated"}
.Note if one wants a custom payload, eg.
{"message": {"id": ..., "domain": ...}}
i tend to prefer a custom normalizer instead, or control it by a context option.Example
No response
The text was updated successfully, but these errors were encountered: