diff --git a/ui/package-lock.json b/ui/package-lock.json
index 62402e379b..91908d7334 100644
--- a/ui/package-lock.json
+++ b/ui/package-lock.json
@@ -1030,6 +1030,11 @@
}
}
},
+ "@cospired/i18n-iso-languages": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@cospired/i18n-iso-languages/-/i18n-iso-languages-2.0.3.tgz",
+ "integrity": "sha512-Z9MYRoJtEpq5r3v203nr8+Nown4/bQMPFlrzs2JU/HdkZsUtRtak6WdQO5BE5T7jR6jvoFDDNvTL7JbGTKp8gg=="
+ },
"@ngtools/webpack": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-7.2.3.tgz",
@@ -1564,7 +1569,6 @@
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"dev": true,
- "optional": true,
"requires": {
"delegates": "^1.0.0",
"readable-stream": "^2.0.6"
@@ -2781,8 +2785,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
- "dev": true,
- "optional": true
+ "dev": true
},
"constants-browserify": {
"version": "1.0.0",
@@ -3209,8 +3212,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
- "dev": true,
- "optional": true
+ "dev": true
},
"depd": {
"version": "1.1.2",
@@ -4314,8 +4316,7 @@
},
"ansi-regex": {
"version": "2.1.1",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"aproba": {
"version": "1.2.0",
@@ -4334,13 +4335,11 @@
},
"balanced-match": {
"version": "1.0.0",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
- "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -4353,18 +4352,15 @@
},
"code-point-at": {
"version": "1.1.0",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"concat-map": {
"version": "0.0.1",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"console-control-strings": {
"version": "1.1.0",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"core-util-is": {
"version": "1.0.2",
@@ -4477,8 +4473,7 @@
},
"inherits": {
"version": "2.0.3",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"ini": {
"version": "1.3.5",
@@ -4489,7 +4484,6 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
- "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -4503,20 +4497,17 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
- "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
- "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -4533,7 +4524,6 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
- "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -4609,8 +4599,7 @@
},
"number-is-nan": {
"version": "1.0.1",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"object-assign": {
"version": "4.1.1",
@@ -4621,7 +4610,6 @@
"once": {
"version": "1.4.0",
"bundled": true,
- "optional": true,
"requires": {
"wrappy": "1"
}
@@ -4704,8 +4692,7 @@
},
"safe-buffer": {
"version": "5.1.2",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -4739,7 +4726,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
- "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -4758,7 +4744,6 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
- "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -4799,13 +4784,11 @@
},
"wrappy": {
"version": "1.0.2",
- "bundled": true,
- "optional": true
+ "bundled": true
},
"yallist": {
"version": "3.0.3",
- "bundled": true,
- "optional": true
+ "bundled": true
}
}
},
@@ -4814,7 +4797,6 @@
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
"dev": true,
- "optional": true,
"requires": {
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
@@ -4827,7 +4809,6 @@
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"dev": true,
- "optional": true,
"requires": {
"aproba": "^1.0.3",
"console-control-strings": "^1.0.0",
@@ -4864,8 +4845,7 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
"integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
- "dev": true,
- "optional": true
+ "dev": true
},
"get-stream": {
"version": "3.0.0",
@@ -5093,8 +5073,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
- "dev": true,
- "optional": true
+ "dev": true
},
"has-value": {
"version": "1.0.0",
@@ -5841,8 +5820,7 @@
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
- "dev": true,
- "optional": true
+ "dev": true
},
"is-windows": {
"version": "1.0.2",
@@ -6512,7 +6490,6 @@
"resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"dev": true,
- "optional": true,
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
@@ -6525,8 +6502,7 @@
"version": "2.3.0",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
- "dev": true,
- "optional": true
+ "dev": true
}
}
},
@@ -6790,8 +6766,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
"integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
- "dev": true,
- "optional": true
+ "dev": true
},
"map-visit": {
"version": "1.0.0",
@@ -11583,7 +11558,6 @@
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"dev": true,
- "optional": true,
"requires": {
"are-we-there-yet": "~1.1.2",
"console-control-strings": "~1.1.0",
@@ -12698,7 +12672,6 @@
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
"dev": true,
- "optional": true,
"requires": {
"load-json-file": "^1.0.0",
"normalize-package-data": "^2.3.2",
@@ -12710,7 +12683,6 @@
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
"dev": true,
- "optional": true,
"requires": {
"graceful-fs": "^4.1.2",
"pify": "^2.0.0",
@@ -12721,8 +12693,7 @@
"version": "2.3.0",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
- "dev": true,
- "optional": true
+ "dev": true
}
}
},
@@ -12731,7 +12702,6 @@
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
"dev": true,
- "optional": true,
"requires": {
"find-up": "^1.0.0",
"read-pkg": "^1.0.0"
@@ -12742,7 +12712,6 @@
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"dev": true,
- "optional": true,
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
@@ -12753,7 +12722,6 @@
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"dev": true,
- "optional": true,
"requires": {
"pinkie-promise": "^2.0.0"
}
@@ -13996,7 +13964,6 @@
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
"dev": true,
- "optional": true,
"requires": {
"is-utf8": "^0.2.0"
}
@@ -15280,7 +15247,6 @@
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"dev": true,
- "optional": true,
"requires": {
"string-width": "^1.0.2 || 2"
}
diff --git a/ui/package.json b/ui/package.json
index ae4ab472c5..22ef127461 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -24,6 +24,7 @@
"@angular/platform-browser": "~7.2.2",
"@angular/platform-browser-dynamic": "~7.2.2",
"@angular/router": "~7.2.2",
+ "@cospired/i18n-iso-languages": "^2.0.3",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"angular-datatables": "^7.0.0",
diff --git a/ui/src/app/core/core.module.ts b/ui/src/app/core/core.module.ts
index e8b4152350..b16cd14471 100644
--- a/ui/src/app/core/core.module.ts
+++ b/ui/src/app/core/core.module.ts
@@ -39,6 +39,7 @@ import { ToastrModule } from 'ngx-toastr';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TitlePipe } from './pipe/title.pipe';
import { OrganisationViewService } from './organisation/organisation-view.service';
+import { TranslateLanguageService } from './translate/translate-language.service';
@NgModule({
declarations: [
@@ -69,7 +70,8 @@ import { OrganisationViewService } from './organisation/organisation-view.servic
PatronTypeTool,
ItemTypeTool,
UniqueValidator,
- I18nPluralPipe
+ I18nPluralPipe,
+ TranslateLanguageService
],
exports: [
AlertsComponent
diff --git a/ui/src/app/core/index.ts b/ui/src/app/core/index.ts
index b3693dd511..796bd14a36 100644
--- a/ui/src/app/core/index.ts
+++ b/ui/src/app/core/index.ts
@@ -34,3 +34,5 @@ export * from './utils';
export * from './alerts/alerts.service';
export * from './toastr-dialog/toastr-dialog.component';
export * from './pipe/title.pipe';
+export * from './pipe/translate-language.pipe';
+export * from './translate/translate-language.service';
diff --git a/ui/src/app/core/manual-translations.ts b/ui/src/app/core/manual-translations.ts
index c0d8e8a115..3fbf4bb5ac 100644
--- a/ui/src/app/core/manual-translations.ts
+++ b/ui/src/app/core/manual-translations.ts
@@ -31,19 +31,6 @@ _('readingRoom');
_('readingroom');
_('publicaccess');
-_('fre');
-_('eng');
-_('ger');
-_('ita');
-_('lat');
-_('spa');
-_('ara');
-_('por');
-_('rus');
-_('heb');
-_('jpn');
-_('chi');
-_('und');
_('patron');
_('librarian');
diff --git a/ui/src/app/core/pipe/translate-language.pipe.spec.ts b/ui/src/app/core/pipe/translate-language.pipe.spec.ts
new file mode 100644
index 0000000000..981dc404cd
--- /dev/null
+++ b/ui/src/app/core/pipe/translate-language.pipe.spec.ts
@@ -0,0 +1,28 @@
+/*
+
+RERO ILS
+Copyright (C) 2019 RERO
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, version 3 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see