Text pasted from Google Translate is formatted within a pre element, which prevents line wrapping and requires readers to scroll left and right to see all the text

I can’t recreate this myself but:

- this has happened many times

- when it happens, it’s either obviously translated text, and/or the poster confirms it was translated

- some forum members have expressed annoyance, not realizing that it’s unintentional on the part of the poster

- this is one of those issues that’s been around forever, has probably annoyed countless people, but everyone just lives with it because nobody expects the forums to work properly

EDIT: actually this can be recreating by manually copying text from the translated text field in Google Translate, as opposed to pressing the copy to clipboard button

See: forums.garmin.com/.../1912036

I have no idea how this can be fixed (maybe offer to strip formatting on paste? maybe automatically strip pre tags?), but it’s just another fun thing about using the Garmin forums.

https://forums.garmin.com/outdoor-recreation/outdoor-recreation/f/fenix-7-series/406604/where-can-i-find-version-19-46-for-my-fenix-7x-pro-ss-versions-20-16-and-20-22-don-t-work-properly-with-distance-in-the-activity

https://forums.garmin.com/sports-fitness/running-multisport/f/forerunner-955-series/406038/cadence/1911064

  • It's a bit of a strange issue. What would we prefer? If I intentionally copy&paste a structured html to the forum? I'd prefer it to be displayed as close as possible to the html I pasted. So the problem with the above pastes is maybe not the forum but the way Google translate copies it's text to the clipboard

  • I'd prefer it to be displayed as close as possible to the html I pasted. So the problem with the above pastes is maybe not the forum but the way Google translate copies it's text to the clipboard

    So by the same logic, you are ok with the fact that if you type or paste a url as plain text, then follow it with trailing punctuation such as a comma or period, the forum will include the trailing punctuation in the link (producing a broken link), because that's what you typed and the forum isn't in the business of trying to be smart about how it does things, right?

    No ofc not.

    In fact, modern apps and OSs try to be smart about this stuff all the time:

    - slack and ios will intentionally exclude trailing punctuation after a bare url, when they linkify urls. Even this forum is smart enough to ignore parens after a url

    - iOS will add a period if you type two spaces, but only if there wasn't already a period at the cursor, so you don't unintentionally get 2 periods in a row (I'm sure android is similar)

    - in iOS, if you hold down the period key, in some cases (like typing a URL in Safari's address bar), you can select a common domain suffix, like ".com", ".org", etc. If you choose one of these suffixes, the leading period will only be included if there isn't already a period at the cursor, again to avoid having a double period

    Even more to the point, the Garmin forums is pretty much the only community where I've seen this problem happen. I guess anyone else who's using this wonderful forum platform would have this problem, though.

    I suspect that more modern platforms like nodebb and discourse (which are like 10 years old at this point) may not have the same issue, either because they use a markdown editor, or because their rich text editor is smarter than this one.

    Then again, I can't reproduce this problem, all I know is that others are having it.

    If I intentionally copy&paste a structured html to the forum?

    Yeah, the crux of the problem is to guess the user's intention. In the examples above, apps and OSs are absolutely guessing the user's intention by avoiding double periods, and avoiding including trailing commas and periods when linkifying a URL. Ofc those are very straightforward examples as people rarely want a 2nd period (inserted automatically) after they've already typed 1 period, and very few (or 0) URLs contain a trailing comma or period.

  • but the way Google translate copies it's text to the clipboard

    Actually I am now able to reproduce the problem and it's the opposite of what you suspect.

    The problem only happens if you try to directly select text from Google Translate (in a browser), copy it and paste it here.

    If you use the actual copy-to-clipboard button provided by Google, everything is fine (Google just copies the text as plain text.)

  • Example of the problem:

    Here I selected the translated text, right-clicked, and selected Copy. (Of course CTRL/CMD-C would also work)

    Then I pasted the text into this comment.

    I love Garmin forums!!!1!
    
    
  • Example of avoiding the problem:

    Here I just pressed the copy to clipboard button and pasted the text below:

    I love Garmin forums!!!1!

  • So the only way for Google to avoid this problem would be to:

    1) somehow prevent users from manually copying text from the translation field

    or

    2) change the HTML of the field so it's not a pre

    Yeah 1) is not practical (yes sites have tried to prevent users from manually copying and pasting stuff, but nobody likes it) and 2) probably won't happen. Even if they did 2), who's to say that whatever they use instead of pre won't also cause problems?

  • A better solution could be for the forum to *guess the user's intention* and strip pre tags, or at least ask the user if they want formatting to be stripped.