The implementation of the TranslocoTranspiler interface in this project uses messageformat V4. Since V4, the library messageformat provides an implementation of the Unicode standard MessageFormat 2 (MF2).
The code in this project is inspired by the current implementation in the Transloco project, which uses messageformat V3.
For more details, you can read this great article.
Transloco must be installed and configured in your application.
You also must install the latest version of messageformat.
pnpm add @cloarec/transloco-mf2
Then in your main.config.ts :
export const appConfig: ApplicationConfig = {
providers: [
//...
provideTransloco({
//... your configuration
// change default transloco interpolation to prevent conflict
interpolation: ['<<<', '>>>'],
}),
provideTranslocoMF2Transpiler({
// https://messageformat.github.io/variables/messageformat_functions.DraftFunctions.html
includeDraftFunctions: true
}),
],
};# Compile the library in watch mode
pnpm watch
# Run the dev server
pnpm servepnpm install
pnpm run buildcd dist/transloco-mf2
# remove dry-run option to really publish the package ;)
pnpm publish --access=public --dry-run- Adapt tests
- Recreate cache feature (deleted for simplicity reasons)