Last modified: 2009-02-28 19:16:21 UTC
Created attachment 3771 [details] Update to rebuildLanguage system I experienced this bug a few times today, when I edited a MessagesXX.php file in Windows environment, then used rebuildLanguage.php and after that, the final messages file contained both Linux (\n) and Windows (\r\n) line endings in it. Because of this, svn could not create a patch file. I figured that I can create a very tiny PHP file for myself, that would replace all \r\n combinations with \n (that is to convert all line endings to Linux type). This way, the above problem was sovled. I believed there would be no harm in updating rebuildLangauges system in a way that it would perform that operation prior to writing the messages to the file, so I created a patch for that.
Created attachment 3772 [details] Update to rebuildLanguage system fixed a typo
Created attachment 3774 [details] Fixed the issues in previous patch Fixed the issues in previous patch. It still needs being reviewed.
The sensible thing is probably to: a) Normalize \r\n to \n on input b) Normalize \n to the local newline sequence on output You could use the PHP_EOL constant (available since PHP 5.0.2), or try detecting it from the source file for consistency.
Well I didn't understand what you are concerned about in the (b) section. Could you please give an example?
Fixed with r24423 by Rotem.
Raimond, I'm not sure if r24423 is what I actually meant here. I think what Brion said is a better idea: To change all \r\n to \n. Then to change them back to the local newline sequence (this second part is not necessary). The benefit is, if the file contains a mixture of \n newlines and \r\n newlines, they will be all made similar.
Hmmm maybe... In the past I got SVN commit errors after running rebuildLanguage.php due to a mixture of newlines. With r24423 SVN doesn't whine anymore :) Ok, let's check again :)
Good idea. I may test it later on as well, when I manage to translate some of the new messages for MessagesFa.
seems fixed a while ago.