locize-cli 10.0.0 → 10.0.2
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/parseLocalLanguage.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
Project versioning adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|
7
7
|
|
|
8
|
+
## [10.0.2](https://github.com/locize/locize-cli/compare/v10.0.1...v10.0.2) - 2025-07-02
|
|
9
|
+
|
|
10
|
+
- respect opt.namespace when parsing local namespaces
|
|
11
|
+
|
|
12
|
+
## [10.0.1](https://github.com/locize/locize-cli/compare/v10.0.0...v10.0.1) - 2025-07-02
|
|
13
|
+
|
|
14
|
+
- respect opt.namespaces when parsing local namespaces
|
|
15
|
+
|
|
8
16
|
## [10.0.0](https://github.com/locize/locize-cli/compare/v9.1.4...v10.0.0) - 2025-06-30
|
|
9
17
|
|
|
10
18
|
- replace old/unmaintained yaml dependency
|
package/package.json
CHANGED
package/parseLocalLanguage.js
CHANGED
|
@@ -124,6 +124,8 @@ const parseLocalLanguage = (opt, lng, cb) => {
|
|
|
124
124
|
fPath = path.join(opt.path, dirPath.replace(nsMask, namespace), file);
|
|
125
125
|
}
|
|
126
126
|
if (!namespace) return clb(new Error(`namespace could not be found in ${fPath}`));
|
|
127
|
+
if (opt.namespaces && opt.namespaces.indexOf(namespace) < 0) return clb(null);
|
|
128
|
+
if (opt.namespace && opt.namespace !== namespace) return clb(null);
|
|
127
129
|
fs.readFile(fPath, (err, data) => {
|
|
128
130
|
if (err) return clb(err);
|
|
129
131
|
|
|
@@ -186,7 +188,7 @@ const parseLocalLanguage = (opt, lng, cb) => {
|
|
|
186
188
|
}, (err, ret) => {
|
|
187
189
|
if (err) return cb(err);
|
|
188
190
|
// xcstrings, returns array in array
|
|
189
|
-
const r = ret.reduce((prev, cur) => {
|
|
191
|
+
const r = ret.filter((r) => r !== undefined).reduce((prev, cur) => {
|
|
190
192
|
if (Array.isArray(cur)) {
|
|
191
193
|
prev = prev.concat(cur);
|
|
192
194
|
} else {
|