-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GH 1102: Don’t allow duplicate strings in a single l10n file #1150
Fix GH 1102: Don’t allow duplicate strings in a single l10n file #1150
Conversation
Added check_duplicate_strings to test for duplicates in a single file. removed duplicates - tried to keep the more generic ‘key’
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just some minor comments on your test, but otherwise this is 👍
* Check that there are no duplicate strings in any individual l10n json file. | ||
*/ | ||
var path = require('path'); | ||
//var fs = require('fs'); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
subdir.pop(); | ||
var name = routes[v].name; | ||
try { | ||
var ids = require(path.resolve(__dirname, '../../src/views/' + subdir.join('/') +'/l10n.json')); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Still needs try/catch because readFileSync throws an error if file doesn’t exist.
ebc0f23
to
152fa80
Compare
Check duplicates was added to prevent errors in the conversion to/from PO files back before we switched to Transifex. See scratchfoundation#1150
Added check_duplicate_strings to test for duplicates in a single file.
removed duplicates - tried to keep the more generic ‘key’
Testing:
Make sure that strings appear not ids. E.g., 'Tutorial' not 'ttt.tutorial'