Skip to content
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

Merged

Conversation

chrisgarrity
Copy link
Contributor

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'

  • Teacher registration strings present: 'Phone Number', 'Organization'
  • Student registration 'Create a Scratch Account'
  • Developers: 'Projects'
  • Educators: 'Who uses Scratch?'
  • Things to Try modal: 'Tutorial'

Added check_duplicate_strings to test for duplicates in a single file.
removed duplicates - tried to keep the more generic ‘key’
Copy link
Contributor

@thisandagain thisandagain left a 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.

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.

Still needs try/catch because readFileSync throws an error if file doesn’t exist.
@chrisgarrity chrisgarrity merged commit e1a0e9f into scratchfoundation:develop Jan 19, 2017
@chrisgarrity chrisgarrity deleted the gh1102-dup-strings branch January 19, 2017 23:24
chrisgarrity added a commit to chrisgarrity/scratch-www that referenced this pull request May 4, 2020
Check duplicates was added to prevent errors in the conversion to/from PO files back before we switched to Transifex. See scratchfoundation#1150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants