Skip to content

Commit a16b067

Browse files
committed
fix: bug namespace fallback
1 parent df3bb84 commit a16b067

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/I18NextPipe.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ export class I18NextPipe implements PipeTransform {
4747
let keysWithScope = [];
4848
for (let i = 0; i < key.length; i++) {
4949
const k = key[i];
50-
if (this.keyContainsNsSeparator(k, nsSeparator)) { // Не подставлять scope, если в ключе указан namespace
51-
keysWithScope.push(k);
52-
} else {
50+
if (!this.keyContainsNsSeparator(k, nsSeparator)) {// Не подставлять scope, если в ключе указан namespace
5351
keysWithScope.push(...scope.map(sc => this.joinStrings(keySeparator, sc, k)));
5452
}
53+
keysWithScope.push(k);
5554
}
5655
return keysWithScope;
5756
}
@@ -66,12 +65,10 @@ export class I18NextPipe implements PipeTransform {
6665
let keysWithNamespace = [];
6766
for (let i = 0; i < key.length; i++) {
6867
const k = key[i];
69-
if (this.keyContainsNsSeparator(k, nsSeparator)) // Не подставлять namespace, если он уже указан в ключе
70-
{
71-
keysWithNamespace.push(k);
72-
} else {
68+
if (!this.keyContainsNsSeparator(k, nsSeparator)) { // Не подставлять namespace, если он уже указан в ключе
7369
keysWithNamespace.push(...ns.map(n => this.joinStrings(nsSeparator, n, k)));
7470
}
71+
keysWithNamespace.push(k);
7572
}
7673
return keysWithNamespace;
7774
}

src/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-i18next",
3-
"version": "3.1.0",
3+
"version": "3.1.1",
44
"homepage": "https://github.com/Romanchuk/angular-i18next#readme",
55
"author": {
66
"name": "Sergey Romanchuk"

0 commit comments

Comments
 (0)