This repository has been archived by the owner on Nov 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(http-loader): support for Angular 6 and RxJS 6
BREAKING CHANGE: The library is now compatible with Angular 6+ and RxJS 6+. If you need to use Angular 5, please stay on version 2.0.1. If you need to use RxJS 5, update to 5.6 and use the rxjs-compat library (see [the RxJS update guide](https://docs.google.com/document/d/12nlLt71VLKb-z3YaSGzUfx6mJbc34nsMXtByPUN35cg/preview#))
- Loading branch information
Showing
15 changed files
with
2,665 additions
and
523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ npm-debug.log | |
coverage | ||
*.metadata.json | ||
bundles | ||
build | ||
dist | ||
dist.tgz | ||
|
||
################# | ||
## JetBrains | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,23 @@ | ||
language: node_js | ||
|
||
cache: yarn | ||
|
||
sudo: false | ||
|
||
notifications: | ||
email: false | ||
|
||
node_js: | ||
- '7' | ||
|
||
branches: | ||
except: | ||
- "/^v\\d+\\.\\d+\\.\\d+$/" | ||
|
||
- '8' | ||
before_install: | ||
- export CHROME_BIN=chromium-browser | ||
|
||
before_script: | ||
- npm prune | ||
|
||
- npm i -g npm@3 # fix for https://github.com/npm/npm/issues/19222 | ||
after_success: | ||
- npm run semantic-release | ||
|
||
- yarn build | ||
- cp .git dist/ -r # required by semantic release | ||
- cp README.md dist/ | ||
- cd dist | ||
- yarn install | ||
- yarn semantic-release | ||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ | ||
before_script: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- sh -e /etc/init.d/xvfb start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,9 @@ Now you need to install the npm module for `TranslateHttpLoader`: | |
npm install @ngx-translate/http-loader --save | ||
``` | ||
|
||
**NB: if you're still on Angular <4.3, please use Http from @angular/http with [email protected].** | ||
**if you're still on Angular <4.3, please use Http from @angular/http with [email protected].** | ||
|
||
**If you're still using Angular v5, please use ngx-translate 9.x and http-loader 2.x, version 3 and above are only compatible with Angular v6. If you need to use RxJS 5, update to 5.6 and use the rxjs-compat library (see [the RxJS update guide](https://docs.google.com/document/d/12nlLt71VLKb-z3YaSGzUfx6mJbc34nsMXtByPUN35cg/preview#)).** | ||
|
||
## Usage | ||
#### 1. Setup the `TranslateModule` to use the `TranslateHttpLoader`: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "./node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "dist", | ||
"keepLifecycleScripts": true, | ||
"workingDirectory": ".ng_build", | ||
"lib": { | ||
"entryFile": "index.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "@ngx-translate/http-loader", | ||
"description": "A loader for ngx-translate that loads translations using http", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ngx-translate/http-loader.git" | ||
}, | ||
"keywords": [ | ||
"angular", | ||
"angular 2", | ||
"i18n", | ||
"translate", | ||
"ngx-translate" | ||
], | ||
"author": "Olivier Combe", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ngx-translate/http-loader/issues" | ||
}, | ||
"homepage": "https://github.com/ngx-translate/http-loader", | ||
"peerDependencies": { | ||
"@ngx-translate/core": ">=10.0.0", | ||
"@angular/core": ">=6.0.0-rc.0", | ||
"@angular/http": ">=6.0.0-rc.0" | ||
}, | ||
"devDependencies": { | ||
"semantic-release": "8.2.3" | ||
}, | ||
"scripts": { | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {HttpClient} from "@angular/common/http"; | ||
import {TranslateLoader} from "@ngx-translate/core"; | ||
|
||
export class TranslateHttpLoader implements TranslateLoader { | ||
constructor(private http: HttpClient, public prefix: string = "/assets/i18n/", public suffix: string = ".json") {} | ||
|
||
/** | ||
* Gets the translations from the server | ||
*/ | ||
public getTranslation(lang: string): any { | ||
return this.http.get(`${this.prefix}${lang}${this.suffix}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.