Angular Translate
How to incorporate Angular Translate into your project
Minimum Requirements
Please review our Minimum Requirements to ensure a smooth installation. Then follow 3 easy steps:
- Update your
package.json
- Create or update your
.npmrc
file - Install & Run!
Detailed Instructions
Substitute the Angular Translate dependencies in your package.json with the following
Create an .npmrc
file with the following
Replace <NES_ACCESS_TOKEN>
with either your access token or a valid email
Install your dependencies and run the service
And just like that, you can run your integration tests against AngularJS Translate NES!
Additional Information
Differences in Translation Key Sanitization
By default, AngularJS Translate NES sanitizes translation keys containing HTML that the Open Source version would potentially allow. As such, if your translation keys contain HTML markup you may need to configure the sanitization rules accordingly. If you believe this may affect your applications, please contact support and include information about your translation strategy.
Configure DOMPurify
DOMPurify is a DOM-only, super-fast, open source, XSS sanitizer for HTML.
AngularJS Translate NES comes bundled with a version of DOMPurify and uses it to sanitize translation keys that contain HTML. However, it is possible to override the bundled version by providing your own.
AngularJS Translate NES will automatically detect DOMPurify and utilize it as needed. For this to happen, DOMPurify
must be available on the window
object. There are various ways to achieve this depending on your setup.
Option 1
Add the DOMPurify dependency to your package.json
with the following:
Then ensure node_modules/dompurify/dist/purify[.min].js
is included in your application, either as a standalone script or in your application bundle.
There are many ways in which dependencies are imported and bundled together in applications. You must ensure that your application makes DOMPurify available on the window
object in order for it to work properly. Here is an example of how it could be accomplished within an application that uses Webpack.
Option 2
Include DOMPurify from a CDN in your HTML template:
Direct download URLs
The direct download URL for AngularJS Translate NES is:
Package | URL |
---|---|
angular-translate 2.19.1-angular-translate-2.20.4 | Download |