Comment 0 for bug 1548128

Revision history for this message
Mingye Wang (artoria2e5) wrote : spaces-as-circle-imgs in translations does not cover all whitespace cases

In launchpad translations, when the original text starts with
whitespaces, launchpad will show something like:

En: ·--help-xxx foo bar…
        ···········The xxx help printed is formatted in…
[i] · represents a space character. Enter a space in the equivalent
        position in the translation.

Unfortunately, non-leading/trailing spaces are still discarded by the
browser, since they are not transformed to the circles. Additionally,
this is not enabled for suggestions.

(There are supposed to be 2 spaces before 'foo'.)

Suggestion
----------

1. Use monospace fonts for all translation strings
2. Use `white-space: pre;` rule to deal with whitespaces effortlessly.
3. Remove the spaces-as-images feature. The newlines look fine to me
   (so far). You might want to change the rest too:
  a. Perhaps add an explicit end-of-string marker like a red paragraph-
     sign or a red dollar-sign.
  b. If you still want to emphasize spaces, consider using some grey/
     blue/green/whatever '·' characters, but please make sure it does
     not break alignment. (you definitely want to do so)
  c. There is a unicode 'Enter' character for newlines, but it doesn't
     have wide support in fonts. Consider going Vim-ish and using a
     yellow dollar-sign, or just keep using the enter image (the absense
     of spaces-replacements makes it look lonely though.)

Rationale
---------

As a translator who cares about console-column alignment, I use the
following custom CSS rules on translations.launchpad.net to use monospace
fonts and make everything work as I wish:

*[id^=msgset] {
    font-family: monospace; /* console-ish monospace */
    white-space: pre; /* console-ish as-is whitespaces */
}

div[id^=msgset] > br {
    display: none; /* kill the extra linebreaks */
}

.translation samp {
    background: none; /* now kill the circle */
    padding: 0; /* and its extra space */
}

The image-circles always annoyed me since it breaks the alignment, and
rarely work well (as reported above). Since launchpad mainly deals with
program translations, why not just make the default fit better with
programs?