@larscom/ngx-translate-module-loader
Advanced tools
Comparing version 3.0.2 to 3.0.3
{ | ||
"name": "@larscom/ngx-translate-module-loader", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Highly configurable and flexible translations loader for ngx-translate. Fetch multiple translations, each translation file gets it's own namespace by default", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -6,9 +6,11 @@ # @larscom/ngx-translate-module-loader | ||
[![license](https://img.shields.io/npm/l/@larscom/ngx-translate-module-loader.svg)](https://github.com/larscom/ngx-translate-module-loader/blob/master/LICENSE) | ||
[![@larscom/ngx-translate-module-loader](https://github.com/larscom/ngx-translate-module-loader/workflows/@larscom/ngx-translate-module-loader/badge.svg?branch=master)](https://github.com/larscom/ngx-translate-module-loader) | ||
[![Master](https://github.com/larscom/ngx-translate-module-loader/actions/workflows/workflow.yml/badge.svg?branch=master)](https://github.com/larscom/ngx-translate-module-loader/actions/workflows/workflow.yml) | ||
[![CodeQL](https://github.com/larscom/ngx-translate-module-loader/actions/workflows/codeql-analysis.yml/badge.svg?branch=master)](https://github.com/larscom/ngx-translate-module-loader/actions/workflows/codeql-analysis.yml) | ||
[![codecov](https://codecov.io/gh/larscom/ngx-translate-module-loader/branch/master/graph/badge.svg?token=5LWR6NXR8B)](https://codecov.io/gh/larscom/ngx-translate-module-loader) | ||
Highly configurable and flexible translations loader for [@ngx-translate/core](https://github.com/ngx-translate/core). | ||
Fetch multiple translations (http only) and configure them to your needs. | ||
Each translation file has it's own **namespace** out of the box so the key/value pairs do not conflict with each other. You can disable namespaces or provide your own value as well. | ||
Each translation file has it's own **namespace** out of the box so the key/value pairs do not conflict with each other. | ||
@@ -100,30 +102,28 @@ ## Demo | ||
Lets say each module in the above example resolves to the following translation: | ||
Lets say each module in the **above** example resolves to the following **JSON**: | ||
``` | ||
```json | ||
{ | ||
"KEY: "VALUE" | ||
"KEY": "VALUE" | ||
} | ||
``` | ||
The final result would then be: | ||
The final translation you are working with would be: | ||
``` | ||
```json | ||
{ | ||
"KEY: "VALUE", | ||
"KEY": "VALUE", | ||
"FEATURE1" : { | ||
"KEY: "VALUE" | ||
"KEY": "VALUE" | ||
}, | ||
"FEATURE2" : { | ||
"KEY: "VALUE" | ||
"KEY": "VALUE" | ||
} | ||
} | ||
``` | ||
Even though all JSON files from those modules are the same, they don't conflict because they are not on the same level after they get merged. | ||
If you don't want uppercase keys, set `lowercaseNamespace` to true in the options because it's uppercase by default. | ||
If you don't want namespaces at all, set `disableNamespace` to true. | ||
You can override the default name space by setting the `namespace` property in the options. | ||
## Configuration | ||
The configuration is very flexible, you can even define custom templates for fetching translations. | ||
@@ -213,6 +213,4 @@ ```ts | ||
## Examples | ||
## Custom templates for fetching translations | ||
### Custom templates for fetching translations | ||
By default, translations gets fetched by using the following template: | ||
@@ -219,0 +217,0 @@ |
59570
231