0.0.4 • Published 7 months ago

@cloarec/transloco-mf2 v0.0.4

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

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-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
        }),
    ],
};

Development of the library

Dev server

# Compile the library in watch mode
pnpm watch
# Run the dev server
pnpm serve

Building

pnpm install
pnpm run build

Publishing the Library

cd dist/transloco-mf2
# remove dry-run option to really publish the package ;)
pnpm publish --access=public --dry-run

TODO

  • Adapt tests
  • Recreate cache feature (deleted for simplicity reasons)
0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago