Wikimedia Developer Support

Blank lines appended to messages



Hi all Some translations arriving in are only because one or several blanks lines have been added to EN text. What is the rule for developpers ? Are the appended lines allowed in the messages ? Should the messages end with last non blank character ? Thanks.



# Fetch received by "$1", forwarding to cluster host.



Unfortunately, the example link you posted doesn’t show anything any more. I would like to understand better what you mean when you say “blank lines have been added”? Added to the end of a message, or somewhere in the middle? Can you provide an example where this happened, ideally by naming the message key?


Given that it’s a Phabricator message, probably not point in asking here. Phabricator is not a Wikimedia project, they have their own rules and probably no one here is familiar with them. Translatewiki might be a better place to ask.


The question is generic; if I encounter a format imposed by the developper (here adding a newline), should the translated text keep the same format ? that means insert the new line or restricts only to the text being translated ? If I have your position of about how it should be rendered, then I can forward the problem to the support team. Thanks.


Ok added a snapshot of what I see on my screen. The newline impose a new translation.

     if ($device) {
    	            "# Fetch received by \"%s\", forwarding to cluster host.\n",

The link to code is the one shown in the message documentation


I believe the answer must be a yes, always keep the original formatting intact. A newline at the end is typically used for messages that are meant to be printed on a terminal screen. Removing it would result in possibly unreadable output.

The only option you, as a translator, have is to tell the maintainers of the code to keep these extra newlines out of the localizable text. Instead of:

pht( "Translatable message\n" );

It should be:

pht( "Translatable message" ) . "\n";


I agree with you. The newlines are ignored when presented to translators.

Task created:



I would like to add a summary of my thoughts:

  • Trailing whitespace is stripped from translations, so you cannot add it even if you wanted to.
  • The Gettext file format support automatically adds a \ at the end of the message if there is a trailing whitespace, and those should be kept in translation. This does not happen with other file formats.
  • Whether the trailing whitespace is significant or not really depends on the project and the context of the message. In most cases there is no need to have trailing whitespace in the translation and it can be added in the code, but those need to be reported to upstream and hope they fix it.


…so Nike what about the ‘\n’ of the developper ? should it show a backslash to the translator at the end of the text ? but there is none. More of that it is impossible (i agree with you) to add whitespace to the translation. So i cannot correct the proposed message and it is presented again and again for translation.


Another case of new line still proposed for translation in a Media message -> cannot be corrected since trailing blanks are not taken into account.


The latest case is better suited for Phabricator so that the extension developer can fix it.