@yrpri/api 9.0.180 → 9.0.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrpri/api",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.182",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Bjarnason & Citizens Foundation",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@google-cloud/vertexai": "^1.10.0",
|
|
26
26
|
"@google-cloud/vision": "^5.1.0",
|
|
27
27
|
"@node-saml/passport-saml": "^5.0.1",
|
|
28
|
-
"@policysynth/agents": "^1.3.
|
|
28
|
+
"@policysynth/agents": "^1.3.150",
|
|
29
29
|
"async": "^3.2.6",
|
|
30
30
|
"authorized": "^1.0.0",
|
|
31
31
|
"aws-sdk": "^2.1692.0",
|
|
@@ -258,7 +258,7 @@ i18n
|
|
|
258
258
|
// this is the defaults
|
|
259
259
|
backend: {
|
|
260
260
|
// path where resources get loaded from
|
|
261
|
-
loadPath:
|
|
261
|
+
loadPath: localesPath + '/{{lng}}/translation.json',
|
|
262
262
|
// path to post missing resources
|
|
263
263
|
addPath: localesPath + '/{{lng}}/translation.missing.json',
|
|
264
264
|
// jsonIndent to use when storing json files
|
|
@@ -456,7 +456,7 @@ i18n
|
|
|
456
456
|
// this is the defaults
|
|
457
457
|
backend: {
|
|
458
458
|
// path where resources get loaded from
|
|
459
|
-
loadPath:
|
|
459
|
+
loadPath: localesPath + '/{{lng}}/translation.json',
|
|
460
460
|
// path to post missing resources
|
|
461
461
|
addPath: localesPath + '/{{lng}}/translation.missing.json',
|
|
462
462
|
// jsonIndent to use when storing json files
|
|
@@ -30,7 +30,7 @@ i18n
|
|
|
30
30
|
// this is the defaults
|
|
31
31
|
backend: {
|
|
32
32
|
// path where resources get loaded from
|
|
33
|
-
loadPath:
|
|
33
|
+
loadPath: localesPath + '/{{lng}}/translation.json',
|
|
34
34
|
// path to post missing resources
|
|
35
35
|
addPath: localesPath + '/{{lng}}/translation.missing.json',
|
|
36
36
|
// jsonIndent to use when storing json files
|
package/utils/i18n.cjs
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var i18n = require('i18next');
|
|
3
3
|
var Backend = require('i18next-fs-backend');
|
|
4
|
-
var path = require('path');
|
|
5
|
-
var fs = require('fs');
|
|
6
|
-
function buildLoadPath(language, namespace) {
|
|
7
|
-
var localesDir = path.resolve(__dirname, '../services/locales');
|
|
8
|
-
var filePath = path.join(localesDir, language, 'translation.json');
|
|
9
|
-
if (!fs.existsSync(filePath)) {
|
|
10
|
-
var altLanguage = language.replace(/-/g, '_');
|
|
11
|
-
filePath = path.join(localesDir, altLanguage, 'translation.json');
|
|
12
|
-
if (!fs.existsSync(filePath)) {
|
|
13
|
-
filePath = path.join(localesDir, 'en', 'translation.json');
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return filePath;
|
|
17
|
-
}
|
|
18
4
|
i18n
|
|
19
5
|
.use(Backend)
|
|
20
6
|
.init({
|
|
21
|
-
fallbackLng: 'en',
|
|
22
|
-
lowerCaseLng: true,
|
|
23
7
|
// this is the defaults
|
|
24
8
|
backend: {
|
|
25
9
|
// path where resources get loaded from
|
|
26
|
-
loadPath:
|
|
10
|
+
loadPath: '../locales/{{lng}}/translation.json',
|
|
27
11
|
// path to post missing resources
|
|
28
12
|
addPath: '../locales/{{lng}}/translation.missing.json',
|
|
29
13
|
// jsonIndent to use when storing json files
|
|
@@ -31,4 +15,3 @@ i18n
|
|
|
31
15
|
}
|
|
32
16
|
});
|
|
33
17
|
module.exports = i18n;
|
|
34
|
-
module.exports.buildLoadPath = buildLoadPath;
|