more for international language support
authorClaus Gittinger <cg@exept.de>
Tue, 12 Dec 1995 17:56:56 +0100
changeset 281 7b73ea8b2faa
parent 280 4775fe6326a0
child 282 a2d8e9cc28c9
more for international language support
Launcher.st
--- a/Launcher.st	Tue Dec 12 17:00:36 1995 +0100
+++ b/Launcher.st	Tue Dec 12 17:56:56 1995 +0100
@@ -11,10 +11,10 @@
 "
 
 ApplicationModel subclass:#NewLauncher
-	 instanceVariableNames:'myMenu buttonPanel transcript infoView infoProcess helpIsOn'
-	 classVariableNames:'CachedAboutIcon'
-	 poolDictionaries:''
-	 category:'Interface-Smalltalk'
+	instanceVariableNames:'myMenu buttonPanel transcript infoView infoProcess helpIsOn'
+	classVariableNames:'CachedAboutIcon'
+	poolDictionaries:''
+	category:'Interface-Smalltalk'
 !
 
 !NewLauncher class methodsFor:'documentation'!
@@ -864,35 +864,39 @@
 !
 
 languageSetting 
-    |listOfLanguages box|
+    |listOfLanguages translatedLanguages idx language  box|
 
     "
      hardwiring here is stupid - need a resource file
      which lists languagenames which have all texts available
      in resource files ...
     "
-    listOfLanguages := #('english'
-			 'german'
-			 'french'
-			 'spanish'
-			 'italian'
-			).
+    listOfLanguages := resources at:'LIST_OF_OFFERED_LANGUAGES'.
+    translatedLanguages := resources array:listOfLanguages.
 
     box := ListSelectionBox title:(resources string:'LANG_MSG') withCRs.
     box label:(resources string:'Language selection').
-    box list:listOfLanguages.
+    box list:translatedLanguages.
     box initialText:(Language).
     box action:[:newLanguage |
-	self withWaitCursorDo:[
-	    Transcript showCr:'change language to ' , newLanguage , ' ...'.
-	    Smalltalk at:#Language put:newLanguage asSymbol.
-	    Smalltalk changed:#Language.
-	    ResourcePack flushCachedResourcePacks
-	].
-	self reopenLauncher.
+        self withWaitCursorDo:[
+            Transcript showCr:'change language to ' , newLanguage , ' ...'.
+            idx := translatedLanguages indexOf:newLanguage withoutSeparators.
+            idx ~~ 0 ifTrue:[
+                language := listOfLanguages at:idx
+            ] ifFalse:[
+                language := newLanguage
+            ].
+            Smalltalk at:#Language put:language asSymbol.
+            Smalltalk changed:#Language.
+            ResourcePack flushCachedResourcePacks
+        ].
+        self reopenLauncher.
     ].    
     box showAtPointer.
     box destroy
+
+    "Modified: 12.12.1995 / 17:53:52 / cg"
 !
 
 messageSettings
@@ -1957,5 +1961,5 @@
 !NewLauncher class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.66 1995-12-09 20:10:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.67 1995-12-12 16:56:56 cg Exp $'
 ! !