Conversation
scripts/diff-lang.js will check translation coverage of languages against src/locales/en, however src/locales/en has fallen out of sync with the source code. This new test aims to restore the sync. There are 52 errors identified by the test. They will be addressed in subsequent commits.
This text was removed from source in "Remove the search-strains UI" (ece581d) with no replacement.
This allows detection through the new translations.test.js.
The new casing is actually used in the code.
jameshadfield
left a comment
There was a problem hiding this comment.
Briefly read through things as it popped up on my notifications. This is a good direction to head in tho!
There was a problem hiding this comment.
I haven't worked my way through translations.test.js yet, but what is it about the previous code in this commit that wasn't able to be picked up by traversing the AST?
There was a problem hiding this comment.
The translation test file traverses the AST to find instances of t() and the first argument passed to it. If the argument is a literal string, we can get the value simply through traversal. If the argument is a variable, traversal is insufficient to determine the value and some form of evaluation would be necessary. It may be possible, but seems like a fundamentally different approach so I haven't tried it.
| "Collection date": "Collection date", | ||
| "Inferred collection date": "Inferred collection date", | ||
| "Inferred Date": "Inferred Date", | ||
| "Inferred date": "Inferred date", |
There was a problem hiding this comment.
We use both...
auspice/src/components/tree/infoPanels/hover.js
Lines 53 to 54 in c4768dd
auspice/src/components/tree/infoPanels/click.js
Lines 180 to 186 in c4768dd
I prefer the capitalised form (i.e. prefer the style of the hover code over the click code).
There was a problem hiding this comment.
Oh thanks, not sure how I missed that yesterday. I'll replace e69bec2 with a commit that swaps Inferred date to Inferred Date.
Description of proposed changes
scripts/diff-lang.jswill check translation coverage of languages againstsrc/locales/en, howeversrc/locales/enhas fallen out of sync with the source code. I've added a new test to uncover what is out of sync (52 errors) and will address them in this PR since they are now exposed as failing tests in CI.Related issue(s)
Closes #1960
Checklist