@l10nmonster/helpers-ios 1.0.0 → 3.0.0-alpha.10
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/.releaserc.json +31 -0
- package/CHANGELOG.md +6 -0
- package/index.js +7 -6
- package/package.json +16 -15
package/.releaserc.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"main",
|
|
4
|
+
{
|
|
5
|
+
"name": "next",
|
|
6
|
+
"prerelease": "alpha"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "beta",
|
|
10
|
+
"prerelease": "beta"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"tagFormat": "@l10nmonster/helpers-ios@${version}",
|
|
14
|
+
"plugins": [
|
|
15
|
+
"@semantic-release/commit-analyzer",
|
|
16
|
+
"@semantic-release/release-notes-generator",
|
|
17
|
+
{
|
|
18
|
+
"path": "@semantic-release/changelog",
|
|
19
|
+
"changelogFile": "CHANGELOG.md"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "@semantic-release/npm",
|
|
23
|
+
"npmPublish": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "@semantic-release/git",
|
|
27
|
+
"assets": ["CHANGELOG.md", "package.json"],
|
|
28
|
+
"message": "chore(release): @l10nmonster/helpers-ios@${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
package/CHANGELOG.md
ADDED
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import i18nStringsFiles from '@l10nmonster/i18n-strings-files';
|
|
2
|
+
import { regex } from '@l10nmonster/core';
|
|
3
3
|
|
|
4
4
|
// filter for iOS .strings file (in utf-8)
|
|
5
|
-
|
|
5
|
+
export class StringsFilter {
|
|
6
6
|
constructor(params) {
|
|
7
7
|
this.emitComments = params?.emitComments || false;
|
|
8
8
|
}
|
|
@@ -43,7 +43,7 @@ const iosControlCharsToDecode = {
|
|
|
43
43
|
r: '\r',
|
|
44
44
|
f: '\f',
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
export const escapesDecoder = regex.decoderMaker(
|
|
47
47
|
'iosEscapesDecoder',
|
|
48
48
|
/(?<node>\\(?<escapedChar>['"\\])|\\(?<escapedControl>[tbnrf])|\\U(?<codePoint>[0-9A-Za-z]{4}))/g, // note that in ios the \U is uppercase!
|
|
49
49
|
(groups) => (groups.escapedChar ??
|
|
@@ -54,7 +54,7 @@ exports.escapesDecoder = regex.decoderMaker(
|
|
|
54
54
|
)
|
|
55
55
|
);
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
export const escapesEncoder = regex.encoderMaker(
|
|
58
58
|
'iosEscapesEncoder',
|
|
59
59
|
// eslint-disable-next-line prefer-named-capture-group
|
|
60
60
|
/(\t)|(\n)|(\r)|(\f)/g,
|
|
@@ -71,8 +71,9 @@ exports.escapesEncoder = regex.encoderMaker(
|
|
|
71
71
|
// and https://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html
|
|
72
72
|
// loosely based on https://stackoverflow.com/questions/45215648/regex-capture-type-specifiers-in-format-string
|
|
73
73
|
// space and quote tags have been omitted to avoid matching unexpected combinations
|
|
74
|
-
|
|
74
|
+
export const phDecoder = regex.decoderMaker(
|
|
75
75
|
'iosPHDecoder',
|
|
76
76
|
/(?<tag>%(?:\d\$)?[0#+-]?[0-9*]*\.?\d*[hl]{0,2}[jztL]?[diuoxXeEfgGaAcpsSn@])/g,
|
|
77
77
|
(groups) => ({ t: 'x', v: groups.tag })
|
|
78
78
|
);
|
|
79
|
+
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
2
|
+
"name": "@l10nmonster/helpers-ios",
|
|
3
|
+
"version": "3.0.0-alpha.10",
|
|
4
|
+
"description": "Helpers to deal with iOS file formats",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node --test"
|
|
9
|
+
},
|
|
10
|
+
"author": "Diego Lagunas",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@l10nmonster/i18n-strings-files": "^3.0.0"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@l10nmonster/core": "^3.0.0-alpha.0"
|
|
17
|
+
}
|
|
17
18
|
}
|