m17n ready to go

Michael Rueger michael at squeakland.org
Thu Jul 29 05:45:47 UTC 2004


Hi all,
the m17n stuff is finally ready for prime time.
I've uploaded the change sets plus a install do-it to:

http://impara.de/drop/m17n/install-m17n.zip


After some discussion Yoshiki and I decided that the best way to deal 
with translations would be to not have them in the standard image but 
have them as packages on SqueakMap. This way they are easy to update and 
load. Basically all that needs to be in such a packet is the translation 
file. I've uploaded the latest German translation file (I hope it's the 
latest) on SqueakMap as an example.

http://map1.squeakfoundation.org/sm/account/package/ecf67f1d-181e-4daa-b5ec-1932f3e75ed0/autoversion/1

The translation files should be named according to the ISO language and 
country codes, e.g. fr, de, sv, es, es-cat, en-us, en-gb etc.

The translation files can be created with Diego's language editor (a 
preliminary unpackaged version is here 
(http://impara.de/drop/m17n/LanguageEditor.st). I've adopted it to work 
with the refactored locale and translation framework. Strings in the 
files need to be in UTF-8. For converting files created with older 
versions of Squeak see the method snippet below.

And thansk again for Yoshiki to making m17n possible!!!

Enjoy :-)

Michael


----------

convertTranslationToUTF: fileName
	"NaturalLanguageTranslator convertTranslationToUTF: 'de.translation' "

	| stream refStream loadedArray translations untranslated converted |
	stream := FileStream readOnlyFileNamed: fileName.
	[refStream := ReferenceStream on: stream.
	loadedArray := refStream next]
		ensure: [stream close].

	translations := Dictionary new: loadedArray first basicSize.
	loadedArray first keysAndValuesDo: [:key :value |
		translations at: key put: (value convertFromWithConverter: 
MacRomanTextConverter new)].
	untranslated := Dictionary new: loadedArray second basicSize.
	loadedArray second keysAndValuesDo: [:key :value |
		converted := key convertToWithConverter: UTF8TextConverter new.
		untranslated at: converted put: converted].

	stream := ReferenceStream fileNamed: fileName , '-utf8'.
	stream nextPut: {translations. untranslated}.
	stream close




More information about the Squeak-dev mailing list