open-index/open-npm huggingface dataset:
npm package: @medrecord/frontend-translations-middleware
Description: This is a translation middleware for loading and using translations.
Latest version: 0.0.15

# Medrecord Translations Middleware

This is a translation middleware for loading and using translations.

# Installation
Add `TranslateModule` from `@ngx-translate/core`.
It requires `HttpClientModule`.

_app.module.ts_
```angular2
@NgModule({
  ...
  imports: [
    ...
    HttpClientModule,
    TranslationMiddlewareModule.forRoot(),
    })
    ...
  ],
  ...
})
export class AppModule { }
```

## Usage
Inject `TranslationMiddlewareService` into your component.
Use method: `addTranslation` for extending translations list.  
Use `translationMiddleware` instead of `translation`.

## API

`TranslationMiddlewareService`

| Method      | Description                                                   | Default               | Values                        |
| ----------- | ------------------------------------------------------------- | --------------------- | ----------------------------- |
| translations| Getter for displaying all loaded and added translations       | {}                    | --                           |
| language    | Getter for displaying selected language.     | 'en'                  | 'en','nl','it','fr','es','de' |    
| setTranslations | Replace all loaded translations. Custom translations will stay unchanged     | --                 |- |    
| extendTranslations    | Extend loaded translations by another load     | --                  | -- |    
| addTranslation    | Add custom translation.  If key will be same as loaded, this translations will be major.   | --                   | --  |
| setLanguage    | Switch language. It will trigger `listenLanguage$`   | --                   | --  |
| listenLanguage$    | Observable value for getting language updates  | --                   | --  |
| translate    | Get current language translation by key and with params if required.  | --                   | --  |
--------------------------------------------------------------------------------------------------------------------------------------- 

## Troubleshooting

If you have no `i18n` folder in your assets or `en.json` file you will start getting 404 error in your console. Ignore it or add `i18n/en.json` as default file.
npm package: @medrecord/services-datetime
Description: This library provides the ability to work with locales by a simple configuration.  Also it was created for work wit Effective Date format.
Latest version: 0.0.4

## Medrecord Moment Service

This library provides the ability to work with locales by a simple configuration. 
Also it was created for work wit Effective Date format.


## Installation

1. Install package.
2. Connect ```MedrecordDatetimeModule``` module to your Application
npm package: @medrecord/tools-ngrx-sync-storage
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.0.6

# tools-kit-ngrx-sync-storage

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test tools-kit-ngrx-sync-storage` to execute the unit tests.
npm package: @medrecord/ui
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.0.10

# ui

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test ui` to execute the unit tests.

## Build instructions

nx build doesnt parsed style included in `stylePreprocessorOptions`
Before build all imports from this paths should be replaced by `@import "node_modules/PATH_TO_BUILD_AND_INSTALLED_UI_LIBRARY"`;

_`NOTE: Please make sure that last version of the style library was built, published and installed in current project`_
npm package: @medrecord/ui-components
Description: [Components Demo](https://master-storybook.medvision360.org/)
Latest version: 1.0.0

# MedrecordUiComponents

[Components Demo](https://master-storybook.medvision360.org/)

## Installation

```shell script
npm i @medrecord/ui-components @medrecord/frontend-translations-middleware
```

Connect styles to you root styles file

```scss
@import "~@medrecord/ui-components/components";
```

### Assets

For correct components work you should connect fonts, icons and translations.

_angular.json_

```json
 "build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    "allowedCommonJsDependencies": [
      "@medrecord/frontend-translations-middleware",
      "lodash",
      "lodash/get",
      "lodash/uniqBy",
      "lodash/toString",
      "moment-timezone",
      "moment-range"
    ],
    ....
    "assets": [
      ...
      {
        "glob": "**/*",
        "input": "node_modules/@medrecord/ui-components/client-styling/images/",
        "output": "/client-styling/images/"
      },
      {
        "glob": "**/*",
        "input": "node_modules/@medrecord/ui-components/fonts/",
        "output": "/client-styling/fonts/"
      },
      {
        "glob": "**/*",
        "input": "node_modules/@medrecord/ui-components/medrecord-i18n/",
        "output": "/assets/medrecord-i18n/"
      }
      ...
    ],
   ...
  },
...
```

Import `MedrecordUiComponentsModule` and `HttpClientModule` in root module of your application.

```angular2
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    ...
    MedrecordUiComponentsModule,
    TranslationMiddlewareModule.forRoot()
    HttpClientModule,
    ...
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

## Translations
Library uses translations what are managed by [@medrecord/frontend-translations-middleware](https://www.npmjs.com/package/@medrecord/frontend-translations-middleware) and connected as assets. For correct components work library should be installed and connected in root module. 

## Troubleshooting

Take into account that starting with version 10, Angular now warns you when your build pulls in one of these bundles. If you’ve started seeing these warnings for your dependencies, let your dependency know that you’d prefer an ECMAScript module (ESM) bundle.
Here is an official documentation - [Configuring CommonJS dependencies](https://angular.io/guide/build#configuring-commonjs-dependencies)

Add into your `angular.json`

```json

"architect": {
"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    ...
    "allowedCommonJsDependencies": [
      "moment-timezone",
      "moment-range",
      "lodash/get",
      "lodash/uniqBy"
    ],
    ...
```

We are using i18n and Angular 9 introduced a global `$localize()` function that needs to be loaded.
Please run `ng add @angular/localize` from the Angular CLI.
(For non-CLI projects, add `import '@angular/localize/init';` to your `polyfills.ts` file.
npm package: @medricsfatih/demo-lib
Description: This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0.
Latest version: 0.0.7

# DemoLib

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0.

## Code scaffolding

Run `ng generate component component-name --project demo-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project demo-lib`.
> Note: Don't forget to add `--project demo-lib` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build demo-lib` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build demo-lib`, go to the dist folder `cd dist/demo-lib` and run `npm publish`.

## Running unit tests

Run `ng test demo-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.