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
It would be useful to be able to ensure that the key argument was a type of the key of the messages in the bundle to prevent passing invalid key property.
Package Version: 7.0.0-pre
Code
Assume an .nls file as such:
constmessages={foosAvailable: '{num} are available'};exportdefault{ messages };
A widget with this behaviour in the render
const{ messages, format }=i18n.localize(bundle);// Later onformat('barsAvailable',{num: bars.length})}
Expected behavior:
A type error occurs when using a no message bundle key.
Actual behavior:
There is no type error.
The text was updated successfully, but these errors were encountered:
Enhancement
The format function in the i18n middleware is currently typed as
(key: string, options?: any)
:https://github.com/dojo/framework/blob/master/src/core/middleware/i18n.ts#L94
It would be useful to be able to ensure that the
key
argument was a type of the key of the messages in the bundle to prevent passing invalid key property.Package Version: 7.0.0-pre
Code
Assume an .nls file as such:
A widget with this behaviour in the
render
Expected behavior:
A type error occurs when using a no message bundle key.
Actual behavior:
There is no type error.
The text was updated successfully, but these errors were encountered: