Skip to content

Commit

Permalink
Remove noisy test output logging we've never cared about
Browse files Browse the repository at this point in the history
Technically, we could try to fix this and get the translators to update their data to have
this fixed, but it's possible there are situations where this happens again and it's not
an actual problem for gettext.

Even the original PR that added this said this overall number of newlines check
could flag intentionally changed values.  Since we've never reacted to this output,
we can remove it.

From that PR (we care about the 3rd check below):

1. if original string starts with a newline, translation needs to start with a newline too
2. if original string ends with a newline, translated string also needs to end with a newline
3. overal amount of newlines in original and translated string needs to match

In this PR, I am introducing a new test, which tests the above rules. The exception is the
3rd rule, since it seems that in some places the newline might have been added (or omitted)
intentionaly. So we're just logging these.

Reference:: #20815
  • Loading branch information
jrafanie committed Sep 27, 2024
1 parent 9637774 commit e590ce0
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions spec/shared/i18n/newlines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ def add_string_chevrons(input)
if (translation[0] == "\n" && original[0] != "\n") || (translation[0] != "\n" && original[0] == "\n")
boundary_errors.store_path(po_file.to_s, add_string_chevrons(original), add_string_chevrons(translation))
end

# Check that overall amount of newlines in original and translation matches
if original.scan("\n").length != translation.scan("\n").length
overall_errors.store_path(po_file.to_s, add_string_chevrons(original), add_string_chevrons(translation))
end
end
end

Expand Down

0 comments on commit e590ce0

Please sign in to comment.