Avoid hard-coded line breaks

Avoid hard-coded line breaks whenever possible in text that is to be shown with variable width fonts, if you can use a toolkit that allows for automatic line wrapping, such as GTK+. In other words, don't do it like this:

   message = _("GFoo is an excellent frobnicator\n"
               "application that supports many\n"
               "different frobnicators. It was\n"
               "written by F. Foo and B. Bar\n"
               "with help from B. Baz.");

Instead, use automatic line wrapping and make the message have no line breaks:

   message = _("GFoo is an excellent frobnicator "
               "application that supports many "
               "different frobnicators. It was "
               "written by F. Foo and B. Bar "
               "with help from B. Baz.");

The reasons for this is that making the lines have the appropriate width with some variable-width font that is different from the one used when editing is not only a difficult task for the developer, it's also a very difficult task for all translators. Also, the danger of line breaks "moving around" when the developer changes the hard-coded wrapping (and thus all translations needing updates) is eliminated when line breaks are removed.

Automatic line wrapping is also very useful for users that need accessibility and other users that want to use different fonts or bigger fonts.

TranslationProject/DevGuidelines/Avoid hard-coded line breaks (last edited 2008-02-03 14:46:07 by localhost)