google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.45k stars 3.71k forks source link

scripts/i18n/js_to_json.py should preserve .json metadata #5001

Open cpcallen opened 3 years ago

cpcallen commented 3 years ago

Describe the bug

Running scripts/i18n/js_to_json.py (e.g. via npm run build:langfiles) overwrites certain bits of metadata that we'd prefer to conserve.

It would be nice if it did not do that.

To Reproduce

Steps to reproduce the behavior:

  1. Start with a clean repository.
  2. Run npm run build:langfiles
  3. Run git diff and note spurious metadata modifications:

    • The "@metadata": {"authors": … section is deleted from msg/json/qqq.json.
    • The "lastupdated": entry in msg/json/en.json is updated even if the file is otherwise unchanged.

Expected behavior

Ideally the authors list is preserved and the lastupdated date is only updated if there are other changes.

cpcallen commented 3 years ago

@NeilFraser: Is there an upstream for this script? If so a more recent version might have already fixed these issues.

NeilFraser commented 3 years ago

@NeilFraser: Is there an upstream for this script? If so a more recent version might have already fixed these issues.

Nope. Custom to Blockly.