Skip to content

Commit

Permalink
fix: bug namespace fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanchuk committed Jan 1, 2018
1 parent df3bb84 commit a16b067
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/I18NextPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ export class I18NextPipe implements PipeTransform {
let keysWithScope = [];
for (let i = 0; i < key.length; i++) {
const k = key[i];
if (this.keyContainsNsSeparator(k, nsSeparator)) { // Не подставлять scope, если в ключе указан namespace
keysWithScope.push(k);
} else {
if (!this.keyContainsNsSeparator(k, nsSeparator)) {// Не подставлять scope, если в ключе указан namespace
keysWithScope.push(...scope.map(sc => this.joinStrings(keySeparator, sc, k)));
}
keysWithScope.push(k);
}
return keysWithScope;
}
Expand All @@ -66,12 +65,10 @@ export class I18NextPipe implements PipeTransform {
let keysWithNamespace = [];
for (let i = 0; i < key.length; i++) {
const k = key[i];
if (this.keyContainsNsSeparator(k, nsSeparator)) // Не подставлять namespace, если он уже указан в ключе
{
keysWithNamespace.push(k);
} else {
if (!this.keyContainsNsSeparator(k, nsSeparator)) { // Не подставлять namespace, если он уже указан в ключе
keysWithNamespace.push(...ns.map(n => this.joinStrings(nsSeparator, n, k)));
}
keysWithNamespace.push(k);
}
return keysWithNamespace;
}
Expand Down
2 changes: 1 addition & 1 deletion src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-i18next",
"version": "3.1.0",
"version": "3.1.1",
"homepage": "https://github.com/Romanchuk/angular-i18next#readme",
"author": {
"name": "Sergey Romanchuk"
Expand Down

0 comments on commit a16b067

Please sign in to comment.