-
Notifications
You must be signed in to change notification settings - Fork 845
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #961 from chrisgarrity/gh940-missing-i18n
[Master] Hotfix - update build-locales script
- Loading branch information
Showing
10 changed files
with
89 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"2ec20d41b181e1a41c071e13f414a74d": "test.id1", | ||
"37ba6d5ef524504215f478912155f9ba": "test.id2" | ||
"2ec20d41b181e1a41c071e13f414a74d": ["test.id1"], | ||
"37ba6d5ef524504215f478912155f9ba": ["test.id2"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var merge = require('lodash.merge'); | ||
var tap = require('tap'); | ||
|
||
var buildLocales = require('../../bin/lib/locale-compare'); | ||
|
||
tap.test('buildIcuMap', function (t) { | ||
var ids1 = { | ||
'first.test1' : 'We know where we\'re going, but we don\'t know where we\'ve been', | ||
'first.test2' : 'You may find yourself living in a shotgun shack' | ||
}; | ||
var ids2 = { | ||
'second.test1' : 'We know where we\'re going, but we don\'t know where we\'ve been', | ||
'second.test2' : 'Gadji beri bimba clandridi' | ||
}; | ||
|
||
var testicuMap = buildLocales.icuToIdMap('first', ids1); | ||
testicuMap = merge(testicuMap, buildLocales.icuToIdMap('second', ids2), buildLocales.customMerge); | ||
|
||
t.ok(testicuMap['We know where we\'re going, but we don\'t know where we\'ve been'].length === 2); | ||
t.ok(testicuMap['You may find yourself living in a shotgun shack'].length === 1); | ||
t.ok(testicuMap['Gadji beri bimba clandridi'].length === 1); | ||
t.end(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var tap = require('tap'); | ||
|
||
var buildLocales = require('../../bin/lib/locale-compare'); | ||
|
||
tap.test('buildLocalesMergeDupStrings', function (t) { | ||
var existingTranslations = { | ||
'test.test1': 'It\'s like raaayaaain, on your wedding day', | ||
'test.test2': 'Free to flyyy, when you already paid', | ||
'test.test4': 'Free to flyyy, when you already paid' | ||
}; | ||
var newTranslations = { | ||
'Isn\'t it ironic? No.': 'Es irónico? No.' | ||
}; | ||
var md5map = { | ||
'c21ce5ceefe167028182032d4255a384': ['test.test1'], | ||
'9c40648034e467e16f8d6ae24bd610ab': ['test.test2', 'test.test4'], | ||
'6885a345adafb3a9dd43d9f549430c88': ['test.test3', 'test.test5'] | ||
}; | ||
|
||
var mergedTranslations = buildLocales.mergeNewTranslations(existingTranslations, newTranslations, {}, md5map); | ||
t.ok(mergedTranslations['test.test2'] !== undefined); | ||
t.ok(mergedTranslations['test.test3'] !== undefined); | ||
t.ok(mergedTranslations['test.test5'] !== undefined); | ||
t.end(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters