Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1059057 - Copy localization indexes in pseudolocales. r=gandalf
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Aug 28, 2014
1 parent 007f3c5 commit 857cf20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 7 additions & 7 deletions apps/sharedtest/test/unit/l10n/lib/util_test.js
Expand Up @@ -93,9 +93,9 @@ describe('walkContent', function() {
assert.strictEqual(walked.foo._.other, 2);
});

it('does not walk the index', function(){
it('does not modify the index', function(){
var walked = L10n.walkContent(ast, digest);
assert.strictEqual(walked.foo._index, undefined);
assert.deepEqual(walked.foo._index, ['plural', 'n']);
});

});
Expand Down Expand Up @@ -124,10 +124,10 @@ describe('walkContent', function() {
assert.strictEqual(walked.foo._.other._.other, 2);
});

it('does not walk the indexes', function(){
it('does not modify the indexes', function(){
var walked = L10n.walkContent(ast, digest);
assert.strictEqual(walked.foo._index, undefined);
assert.strictEqual(walked.foo._.other._index, undefined);
assert.deepEqual(walked.foo._index, ['plural', 'n']);
assert.deepEqual(walked.foo._.other._index, ['plural', 'n']);
});

});
Expand All @@ -154,9 +154,9 @@ describe('walkContent', function() {
assert.strictEqual(walked.foo.attr._.other, 2);
});

it('does not walk the indexes', function(){
it('does not modify the indexes', function(){
var walked = L10n.walkContent(ast, digest);
assert.strictEqual(walked.foo.attr._index, undefined);
assert.deepEqual(walked.foo.attr._index, ['plural', 'n']);
});

});
Expand Down
4 changes: 3 additions & 1 deletion shared/js/l10n.js
Expand Up @@ -875,7 +875,9 @@

var rv = {};
for (var key in node) {
if (key !== '_index' && (key in node)) {
if (key === '_index') {
rv[key] = node[key];
} else {
rv[key] = walkContent(node[key], fn);
}
}
Expand Down

0 comments on commit 857cf20

Please sign in to comment.