Skip to content

LG-12756 Spell canceled consistently#10320

Merged
vrajmohan merged 4 commits intomainfrom
spell-canceled-consistently
Mar 28, 2024
Merged

LG-12756 Spell canceled consistently#10320
vrajmohan merged 4 commits intomainfrom
spell-canceled-consistently

Conversation

@vrajmohan
Copy link
Contributor

@vrajmohan vrajmohan commented Mar 26, 2024

Why:

  • Use the standard TTS practice of American English spelling everywhere.

How:

  • Change only the user-facing text in this commit.

changelog: User-Facing Improvements, Messages, Use the American spelling of canceled consistently

=

🎫 Ticket

LG-12756

Copy link
Contributor

Choose a reason for hiding this comment

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

might be good to rename the key (and at its callsites as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am tracking this ticket in https://docs.google.com/document/d/1w6WJbvEI_pWoGmqwLDRlBO3AF7nirehcVDw5ywvG5P8/edit (as I don't have Jira access). In my weakly held opinion, 2 - 5 should be taken up in a separate PR/commit.

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

I'd wonder if it's worth testing for "common misspellings", like a spec in spec/i18n_spec.rb. This feels like the sort of thing that'll be easy to regress with future content revisions.

@vrajmohan
Copy link
Contributor Author

@aduth's suggestion is great and could also be employed for other languages (which don't benefit from having as many eyes looking at the strings). With that said, this story (which hasn't gone through backlog refinement) was picked to keep me busy and is tracked in https://docs.google.com/document/d/1w6WJbvEI_pWoGmqwLDRlBO3AF7nirehcVDw5ywvG5P8/edit?usp=sharing. There's another thread within it about handling the misspelling in the code itself...

**Why**:
- Use the standard TTS practice of American English spelling
  everywhere.

**How**:
- Change only the user-facing text in this commit.

changelog: User-Facing Improvements, Messages, Use the American spelling of canceled consistently
@vrajmohan vrajmohan force-pushed the spell-canceled-consistently branch from f0efcbb to c43fd10 Compare March 27, 2024 18:10
@vrajmohan vrajmohan force-pushed the spell-canceled-consistently branch from 0ae43fa to 7342330 Compare March 28, 2024 15:24
@vrajmohan vrajmohan marked this pull request as ready for review March 28, 2024 15:44
@vrajmohan vrajmohan requested review from aduth and zachmargolis March 28, 2024 17:20
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM 👍

it 'does not contain commonly misspelled words' do
flattened_yaml_data.each do |key, value|
locale = key.split('.', 2).first.to_sym
if COMMONLY_MISSPELLED_WORDS.key?(locale)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the whole describe block is about testing an individual locale's file, I'd wonder if we could avoid running the spec at all for locales we're not interested in testing, to avoid evaluating and iterating through each key of the French and Spanish files. Maybe an early return (next?) before the loop, or a condition around the whole it block, or RSpec conditional metadata.

# Add additional words using the regex union operator '|'.
COMMONLY_MISSPELLED_WORDS = {
en: /\b(cancelled|occured|seperated?)\b/i,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Since this is constant, we could freeze it as we're doing above to avoid any unintended changes?

Suggested change
}
}.freeze

In addition:
1. Freeze the hash
2. Refactor `locale` variable assignment
@vrajmohan vrajmohan merged commit 23f11ae into main Mar 28, 2024
@vrajmohan vrajmohan deleted the spell-canceled-consistently branch March 28, 2024 18:44
@aduth aduth mentioned this pull request Apr 2, 2024
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.

3 participants