Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
angular-translate-loader-pluggable
Advanced tools
Pluggable loader for angular-translate that allows separate independent angular modules to contribute their angular-translate translations.
This library has been designed for Angular 1.5
Pluggable Loader is a custom loader for angular-translate. It aims to facilitate the modularization of the applications s.t. each module can contribute their own translations and possibly be independent in the kind of angular-translate loader it uses.
Available as npm package
$ npm install angular-translate-loader-pluggable --save
or as Bower package
$ bower install angular-translate-loader-pluggable --save
Plunkr demo: http://plnkr.co/edit/Smc89rX5UoCXYu6Qp2F0?p=preview
Configure your app to use the pluggable loader:
angular.module('demoapp', [
'pascalprecht.translate',
'angular-translate-loader-pluggable'
])
.config(function translationConfig($translateProvider, translatePluggableLoaderProvider) {
$translateProvider.useLoader('translatePluggableLoader');
})
Then, in your angular modules where you want to contribute new translations, use the translatePluggableLoaderProvider
instead of the $translateProvider
.
angular.module('staticTranslationsModule', ['angular-translate-loader-pluggable'])
.config(function(translatePluggableLoaderProvider) {
translatePluggableLoaderProvider
.translations('de', {
"anotherMessage": "Anderes Message!"
})
.translations('en', {
"anotherMessage": "Some Message!"
});
});
You can also use other loaders, such as the partial loader:
angular
.module('partialModule', ['angular-translate-loader-pluggable'])
.config(function(translatePluggableLoaderProvider, $translatePartialLoaderProvider){
// this module uses the $translatePartialLoader
translatePluggableLoaderProvider.useLoader('$translatePartialLoader', {
urlTemplate: '{part}-locale-{lang}.json'
});
$translatePartialLoaderProvider.addPart('anothermodule');
});
Note that I'm not registering the $translatePartialLoader
on the $translateProvider
but instead on the translatePluggableLoderProvider
so that it can handle it.
Your loader doesn't work? Let me know about it!
Of course! If you have improvements, suggestions, let me know about them and either file some issues to discuss something or even better, submit a PR. Please check out our contribution guidelines!
FAQs
Pluggable loader for angular-translate that allows separate independent angular modules to contribute their angular-translate translations.
The npm package angular-translate-loader-pluggable receives a total of 1,813 weekly downloads. As such, angular-translate-loader-pluggable popularity was classified as popular.
We found that angular-translate-loader-pluggable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.