'From etoys2.3 of 1 December 2007 [latest update: #1829] on 12 December 2007 at 1:16:26 pm'! "Change Set: newLineInGetText-KR Date: 12 December 2007 Author: Korakurider TRAC#5462: '\n' in MO is represented as Line feed. To make gettext emulation work for new line in Squeak's format (i.e. carriage return) , all LFs in MO need to be converted to CR. Test case: | o t | o := 'View web page as source Cancel'. t := o translated. inspect t. self assert: (o ~= t). "! Object subclass: #MOFile instanceVariableNames: 'localeID fileName isLittleEndian magic revision nStrings originalTableOffset translatedTableOffset hashTableSize hashTableOffset hashTable originalStrings translatedStrings translations ' classVariableNames: 'Cr Lf ' poolDictionaries: '' category: 'System-Localization'! !MOFile methodsFor: 'private' stamp: 'KR 12/12/2007 13:14'! loadString: strm pointer: top length: len | str | str _ ByteString new: len. strm position: top. strm nextInto: str. ^str replaceAll: Lf with: Cr. ! ! !MOFile class methodsFor: 'class initialization' stamp: 'KR 12/12/2007 13:13'! initialize Cr := Character cr. Lf := Character lf. ! ! MOFile initialize! !MOFile class reorganize! ('instance creation' fileName:localeID:) ('class initialization' initialize) ! Object subclass: #MOFile instanceVariableNames: 'localeID fileName isLittleEndian magic revision nStrings originalTableOffset translatedTableOffset hashTableSize hashTableOffset hashTable originalStrings translatedStrings translations' classVariableNames: 'Cr Lf' poolDictionaries: '' category: 'System-Localization'! "Postscript: " MOFile initialize. !