New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@medrecord/frontend-translations-middleware

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@medrecord/frontend-translations-middleware

This is a translation middleware for loading and using translations.

  • 0.0.15
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

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

@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

MethodDescriptionDefaultValues
translationsGetter for displaying all loaded and added translations{}--
languageGetter for displaying selected language.'en''en','nl','it','fr','es','de'
setTranslationsReplace all loaded translations. Custom translations will stay unchanged---
extendTranslationsExtend loaded translations by another load----
addTranslationAdd custom translation. If key will be same as loaded, this translations will be major.----
setLanguageSwitch language. It will trigger listenLanguage$----
listenLanguage$Observable value for getting language updates----
translateGet 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.

FAQs

Package last updated on 09 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc