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
// injecting a config is optional, and any values provided here will
56
+
// override the defaults (see below)
57
+
{
58
+
provide: MESSAGE_FORMAT_CONFIG,
59
+
useValue: {
60
+
throwOnError: true,
61
+
formatters: { upcase: (v) =>v.toUpperCase() },
62
+
},
63
+
},
53
64
],
54
-
bootstrap: [AppComponent],
55
-
})
56
-
exportclassAppModule {}
65
+
});
57
66
```
58
67
59
-
Check the [ngx-translate documentation](https://ngx-translate.org/reference/configuration/#standalone-components) for an example when using a "standalone" setup.
60
-
61
-
You can override the values used when configuring MessageFormat by providing a configuration object for the `MESSAGE_FORMAT_CONFIG` injection token. Here's the default:
68
+
You can override the values used by the plugin to configure MessageFormat by providing a configuration object for the `MESSAGE_FORMAT_CONFIG` injection token. Here's the default:
62
69
63
70
```ts
64
71
{
@@ -76,22 +83,6 @@ You can override the values used when configuring MessageFormat by providing a c
76
83
77
84
MessageFormat instances provide some options to influence its behaviour, among them `customFormatters`, `biDiSupport` and `strict`. Learn about their meaning here: <https://messageformat.github.io/messageformat/api/core.messageformatoptions/> (The names used in the MESSAGE_FORMAT_CONFIG object are slightly different for backward-compatibility reasons.)
78
85
79
-
This is how you would enable bi-directional support and add a custom formatter, for example:
This library implements neither the syntax used for pluralization (et al) nor the "mechanics" for making translations work in your Angular app. The former is _MessageFormat_, the latter _ngx-translate_. Before you assume your problem is with _ngx-translate-messageformat-compiler_, please consult these ressources:
@@ -106,20 +97,7 @@ Here's two important differences to _ngx-translate_'s default syntax when using
106
97
107
98
### Transitioning from _ngx-translate_ default syntax to _MessageFormat_ syntax
108
99
109
-
If you have to transition on a message-by-message basis, you can do so by configuring a prefix that, if found on the message, will cause the compiler to "ignore" the message. This has the effect of falling back on _ngx-translate_'s default message interpolation.
If you have to transition on a message-by-message basis, you can do so by configuring a prefix that, if found on the message, will cause the compiler to "ignore" the message. This has the effect of falling back on _ngx-translate_'s default message interpolation. Set the prefix using `fallbackPrefix` in the configuration object, e.g. `fallbackPrefix: 'your_choice::'`.
0 commit comments