Fix accidental double spaces in locale data#3306
Open
benoitcalin wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix accidental double spaces in locale data
Problem
Several locale entries contain runs of consecutive spaces between words, e.g.
Leo HamonandLouis Bleriotinfr/address.yml. These flow straight into generated values (Faker::Address.street_name,full_address, …).Browsers collapse consecutive whitespace when rendering HTML, so any downstream test that asserts exact text against a generated address becomes flaky: the expected string carries a double space that the rendered page no longer has. This bit us on a Capybara feature spec (
expect(page).to have_content(record.address)) roughly 0.5% of the time on the:frlocale, with no way to fix it cleanly on the consumer side.Changes
Collapsed the accidental double/triple spaces in these entries:
fr/address.yml—street_suffix:Leo Hamonsk.yml—address.street:Búdkova cestaen/opera.yml— 9 Rossini titles (… ossia …,Elisabetta regina …,Ugo re d'Italia)en/dumb_and_dumber.yml— one quote (LA LA LA LA LA LA! LLOYD!)en/restaurant.yml—description(citizen to provide) andreview(neglected. Seen)Added
test/test_locale_data_integrity.rb: a guard that walks every locale YAML and fails on any string value containing consecutive spaces between words, so this class of typo can't creep back in across locales.Intentionally left untouched:
en/crypto_coin.yml, whose entries use aligned spaces inside a comma-separated string thatFaker::CryptoCoinsplits andstrips before returning. Those spaces never reach generated output, so the test explicitly excludes that key.Console output
Faker::Base.translatefor the affected keys, after the fix (no entry contains consecutive spaces anymore), and crypto_coin still returning stripped values:The new test fails on
main(14 offending entries reported) and passes with the data fixes applied.