@progress/kendo-angular-messages 1.41.0 → 1.41.1-develop.1
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/bin/kendo-translate.js +13 -19
- package/package.json +39 -66
package/bin/kendo-translate.js
CHANGED
|
@@ -13,39 +13,38 @@ const R = require('ramda');
|
|
|
13
13
|
const args = (() => {
|
|
14
14
|
const argparse = require('argparse');
|
|
15
15
|
const parser = new argparse.ArgumentParser({
|
|
16
|
-
|
|
17
|
-
addHelp: true,
|
|
16
|
+
add_help: true,
|
|
18
17
|
description: 'Populates Kendo UI for Angular messages in i18n message files'
|
|
19
18
|
});
|
|
20
19
|
|
|
21
|
-
parser.
|
|
20
|
+
parser.add_argument('file', {
|
|
22
21
|
help: 'XLIFF file to process, e.g. "src/i18n/messages.en.xlf"',
|
|
23
22
|
});
|
|
24
23
|
|
|
25
|
-
parser.
|
|
24
|
+
parser.add_argument('-l', '--locale', {
|
|
26
25
|
help: 'the locale ID, for example "en-US"',
|
|
27
26
|
required: true
|
|
28
27
|
});
|
|
29
28
|
|
|
30
|
-
parser.
|
|
29
|
+
parser.add_argument('-f', '--force', {
|
|
31
30
|
help: 'overwrites existing translations',
|
|
32
|
-
|
|
33
|
-
action: '
|
|
31
|
+
default: false,
|
|
32
|
+
action: 'store_true'
|
|
34
33
|
});
|
|
35
34
|
|
|
36
|
-
parser.
|
|
35
|
+
parser.add_argument('-e', '--encoding', {
|
|
37
36
|
help: 'Specifies the message files encoding. Default is "utf-8".',
|
|
38
|
-
|
|
37
|
+
default: 'utf-8'
|
|
39
38
|
});
|
|
40
39
|
|
|
41
|
-
return parser.
|
|
40
|
+
return parser.parse_args();
|
|
42
41
|
})();
|
|
43
42
|
|
|
44
43
|
const msgRoot = path.resolve(__dirname, '../messages');
|
|
45
44
|
|
|
46
45
|
const langFiles = `/**/*.${args.locale}.yml`;
|
|
47
46
|
|
|
48
|
-
const extendAll = R.reduce(R.mergeWith(R.
|
|
47
|
+
const extendAll = R.reduce(R.mergeWith(R.mergeRight), {});
|
|
49
48
|
|
|
50
49
|
const complete = (reject, resolve) => (error, result) => {
|
|
51
50
|
error ? reject(error) : resolve(result);
|
|
@@ -64,17 +63,12 @@ const readFile = filename => new Task((reject, resolve) => {
|
|
|
64
63
|
// parseYaml :: FileContent -> Task YML
|
|
65
64
|
const parseYaml = data => new Task((reject, resolve) => {
|
|
66
65
|
try {
|
|
67
|
-
resolve(yaml.
|
|
66
|
+
resolve(yaml.load(data));
|
|
68
67
|
} catch (e) {
|
|
69
68
|
reject(e);
|
|
70
69
|
}
|
|
71
70
|
});
|
|
72
71
|
|
|
73
|
-
// verifyFile :: [FilePath] -> Task Error [FilePath]
|
|
74
|
-
const verifyFile = files => new Task((reject, resolve) => {
|
|
75
|
-
files.length ? resolve(files) : reject(new Error(`Unable to locate '${args.file}' file`));
|
|
76
|
-
});
|
|
77
|
-
|
|
78
72
|
// parseXml :: FileContent -> Task XML
|
|
79
73
|
const parseXml = data => new Task((reject, resolve) => {
|
|
80
74
|
const doc = cheerio.load(data, { xmlMode: true, decodeEntities: false })
|
|
@@ -125,8 +119,8 @@ const translations = R.pipe(
|
|
|
125
119
|
|
|
126
120
|
// mergeTranslations :: FilePath -> YML -> XML
|
|
127
121
|
const mergeTranslations = path => translations => R.pipe(
|
|
128
|
-
|
|
129
|
-
R.chain(
|
|
122
|
+
parseXmlFile,
|
|
123
|
+
R.chain(xmlFile => safeTranslate(xmlFile, translations))
|
|
130
124
|
)(path);
|
|
131
125
|
|
|
132
126
|
const main = () => {
|
package/package.json
CHANGED
|
@@ -1,85 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-messages",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.1-develop.1",
|
|
4
4
|
"description": "Localization messages - Kendo UI for Angular",
|
|
5
|
+
"author": "Progress",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
|
+
"homepage": "https://github.com/telerik/kendo-angular-messages#readme",
|
|
5
8
|
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"lint": "gulp lint",
|
|
8
|
-
"semantic-release": "semantic-release pre && semantic-prerelease publish && semantic-release post",
|
|
9
|
-
"seed-messages": "sh ./tools/seed-messages.sh",
|
|
10
|
-
"append-message": "sh ./tools/append-message.sh"
|
|
11
|
-
},
|
|
12
9
|
"bin": {
|
|
13
10
|
"kendo-translate": "./bin/kendo-translate.js"
|
|
14
11
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
12
|
+
"scripts": {
|
|
13
|
+
"lint": "npx yaml-lint ./messages/**/*.yml",
|
|
14
|
+
"test": "bash ./test/run",
|
|
15
|
+
"seed-messages": "bash ./tools/seed-messages.sh",
|
|
16
|
+
"append-message": "bash ./tools/append-message.sh",
|
|
17
|
+
"prepare": "husky install"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"cheerio": "1.0.0-rc.12",
|
|
21
|
+
"data.task": "^3.1.2",
|
|
22
|
+
"glob": "^8.0.3",
|
|
23
|
+
"js-yaml": "^4.1.0",
|
|
24
|
+
"ramda": "^0.28.0",
|
|
25
|
+
"xlf-translate": "^2.0.5"
|
|
23
26
|
},
|
|
24
|
-
"homepage": "https://github.com/telerik/kendo-angular-messages#readme",
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"gulp-yaml-validate": "^1.0.2",
|
|
32
|
-
"semantic-release": "^6.3.6",
|
|
33
|
-
"validate-commit-msg": "2.11.1"
|
|
28
|
+
"@commitlint/cli": "^17.4.0",
|
|
29
|
+
"@commitlint/config-conventional": "^17.4.0",
|
|
30
|
+
"husky": "^8.0.0",
|
|
31
|
+
"semantic-release": "^19.0.5",
|
|
32
|
+
"yaml-lint": "^1.7.0"
|
|
34
33
|
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"data.task": "^3.1.1",
|
|
38
|
-
"glob": "^7.1.1",
|
|
39
|
-
"js-yaml": "^3.7.0",
|
|
40
|
-
"ramda": "^0.23.0",
|
|
41
|
-
"xlf-translate": "^2.0.5"
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/telerik/kendo-angular-messages/issues"
|
|
42
36
|
},
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
"ghooks": {
|
|
48
|
-
"pre-commit": "npm run lint",
|
|
49
|
-
"commit-msg": "validate-commit-msg"
|
|
50
|
-
},
|
|
51
|
-
"validate-commit-msg": {
|
|
52
|
-
"types": [
|
|
53
|
-
"feat",
|
|
54
|
-
"fix",
|
|
55
|
-
"docs",
|
|
56
|
-
"style",
|
|
57
|
-
"refactor",
|
|
58
|
-
"perf",
|
|
59
|
-
"test",
|
|
60
|
-
"chore",
|
|
61
|
-
"revert"
|
|
62
|
-
],
|
|
63
|
-
"warnOnFail": false,
|
|
64
|
-
"maxSubjectLength": 100
|
|
65
|
-
}
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/telerik/kendo-angular-messages.git"
|
|
66
40
|
},
|
|
67
41
|
"release": {
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"verifyRelease": "@telerik/semantic-prerelease/verifyRelease"
|
|
42
|
+
"branches": [
|
|
43
|
+
{
|
|
44
|
+
"name": "master",
|
|
45
|
+
"channel": "latest"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "develop",
|
|
49
|
+
"prerelease": true,
|
|
50
|
+
"channel": "dev"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
80
53
|
},
|
|
81
54
|
"files": [
|
|
82
55
|
"bin",
|
|
83
56
|
"messages"
|
|
84
57
|
]
|
|
85
|
-
}
|
|
58
|
+
}
|