0.0.4 • Published 7 months ago
@cloarec/transloco-mf2 v0.0.4
Transloco MF2
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.
Installation in your project
Transloco must be installed and configured in your application.
You also must install the latest version of messageformat.
pnpm add @cloarec/transloco-mf2Then 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
}),
],
};Development of the library
Dev server
# Compile the library in watch mode
pnpm watch
# Run the dev server
pnpm serveBuilding
pnpm install
pnpm run buildPublishing the Library
cd dist/transloco-mf2
# remove dry-run option to really publish the package ;)
pnpm publish --access=public --dry-runTODO
- Adapt tests
- Recreate cache feature (deleted for simplicity reasons)