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

Cleaned en.json with checking scripts #331

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

yuanwang04
Copy link
Collaborator

@yuanwang04 yuanwang04 commented Jul 27, 2020

fix #328

Wrote scripts to check for missing keys and extra keys in en.json and es.json. It will automatically remove extra keys.

For this script to work, keys in en.json and es.json should only include [a-zA-Z0-9-_]. Especially it should NOT include '.'

The script is based on jest. To run, use npm run test.

A cleaned version of en.json/es.json will be created in locales/newEn.json and locales/newEs.json

The following keys seem to be missing in es.json:
[
"missing_locations.title",
"missing_locations.description",
"missing_locations.import_button",
"disclaimer.title",
"disclaimer.content",
"location.unknown",
"data_storage_modal.title",
"data_storage_modal.desc_1",
"data_storage_modal.desc_2",
"data_storage_modal.delete_success",
"data_storage_modal.delete_failure",
"data_storage_modal.delete_button",
"export.message",
"export.title",
"export.description"
]

Copy link
Contributor

@cheng-tan cheng-tan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we only have three test cases in this file and break down this PR:

  1. There is no unused keys (only check the en.json file, make sure all the keys is used in the app)
  2. There is no missing keys (all the keys used in the app are having values in en.json)
  3. Every language has same keys (Load in all translations file and check if their keys are the same)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up en.json for content update
2 participants