More localized strings in ProfessorJ and the wizard.

svn: r6176
This commit is contained in:
Mike Sperber 2007-05-08 13:55:50 +00:00
parent d1c4d0e269
commit 59e805d518
6 changed files with 103 additions and 33 deletions

View File

@ -2846,7 +2846,7 @@ module browser threading seems wrong.
(string-constant kill-menu-item-help-string))
(when (custodian-memory-accounting-available?)
(new menu-item%
[label "Limit memory..."]
[label (string-constant limit-memory-menu-item-label)]
[parent scheme-menu]
[callback
(λ (item b)
@ -3283,15 +3283,15 @@ module browser threading seems wrong.
[parent parent]))
(define msg1 (new message%
[parent d]
[label "The limit will take effect the next time the program"]))
[label (string-constant limit-memory-msg-1)]))
(define msg1.5 (new message%
[parent d]
[label "is Run, and it must be at least 100 megabytes."]))
[label (string-constant limit-memory-msg-2)]))
(define outer-hp (new horizontal-panel% [parent d] [alignment '(center bottom)]))
(define rb (new radio-box%
[label #f]
[choices '("Unlimited" "Limited")]
[choices (list (string-constant limit-memory-unlimited) (string-constant limit-memory-limited))]
[callback (λ (a b) (grayizie))]
[parent outer-hp]))
@ -3339,7 +3339,7 @@ module browser threading seems wrong.
[(0) (send ok-button enable #t)]
[(1) (send ok-button enable (is-valid-number? (send tb get-editor)))]))
(define msg2 (new message% [parent hp] [label "Megabytes"]))
(define msg2 (new message% [parent hp] [label (string-constant limit-memory-megabytes)]))
(define bp (new horizontal-panel% [parent d]))
(define-values (ok-button cancel-button)
(gui-utils:ok/cancel-buttons

View File

@ -223,7 +223,6 @@
#f))
;Create the ProfessorJ settings selection panel
;Note: Should add strings to string constants
(define/public (config-panel _parent)
(letrec ([parent (instantiate vertical-panel% ()
(parent _parent)
@ -241,7 +240,7 @@
(lambda (x y) update-pf)))]
[print-style (make-object radio-box%
(string-constant profj-language-config-display-style)
(list "Class" (string-constant profj-language-config-display-field));"Graphical")
(list (string-constant profj-language-config-class) (string-constant profj-language-config-display-field));"Graphical")
print-prefs
(lambda (x y) (update-ps)))]
[testing-prefs (instantiate group-box-panel% ()
@ -254,7 +253,7 @@
testing-prefs
(lambda (x y) update-at)))]
[allow-test (when (eq? level 'full)
(make-object check-box% "Support test Language extension?"
(make-object check-box% (string-constant profj-language-config-support-test-language)
testing-prefs (lambda (x y) update-at2)))]
[display-testing
(make-object check-box% (string-constant profj-language-config-testing-enable)
@ -275,7 +274,7 @@
[cp-panel (instantiate group-box-panel% ()
(parent parent)
(alignment '(left center))
(label "Classpath"))]
(label (string-constant profj-language-config-classpath)))]
[tp-panel (instantiate horizontal-panel% ()
(parent cp-panel)
(alignment '(center center))
@ -319,7 +318,7 @@
(send lower-button enable (and lb-selection enable? (not (= lb-selection (- lb-tot 1)))))))]
[add-callback
(lambda ()
(let ([dir (get-directory "Choose the directory to add to class path"
(let ([dir (get-directory (string-constant profj-language-config-choose-classpath-directory)
(send parent get-top-level-window))])
(when dir
(send lb append dir #f)
@ -550,13 +549,13 @@
(regexp-match "Eaxmple" (car names)))
(class-loop (cdr names)
ex
(cons (format "Class ~a's name contains a phrase close to Example."
(cons (format (string-constant profj-test-name-close-to-example)
(car names))
ne)))
((regexp-match "example" (car names))
(class-loop (cdr names)
ex
(cons (format "Class ~a's name contains a miscapitalized example."
(cons (format (string-constant profj-test-name-example-miscapitalized)
(car names))
ne)))
(else
@ -747,20 +746,20 @@
(define/public (create-executable fn parent . args)
;(printf "create-exe called~n")
(message-box "Unsupported"
"Sorry - executables are not supported for Java at this time"
(message-box (string-constant profj-unsupported)
(string-constant profj-executables-unsupported)
parent))
(define/public (get-one-line-summary) one-line)
(super-instantiate ())))
;Create the ProfessorJ languages
(define full-lang% (java-lang-mixin 'full "Full" 4 "Like Java 1.0 (some 1.1)" #f))
(define advanced-lang% (java-lang-mixin 'advanced "Advanced" 3 "Java-like Advanced teaching language" #f))
(define full-lang% (java-lang-mixin 'full (string-constant profj-full-lang) 4 (string-constant profj-full-lang-one-line-summary) #f))
(define advanced-lang% (java-lang-mixin 'advanced (string-constant profj-advanced-lang) 3 (string-constant profj-advanced-lang-one-line-summary) #f))
(define intermediate-lang%
(java-lang-mixin 'intermediate "Intermediate" 2 "Java-like Intermediate teaching language" #f))
(define beginner-lang% (java-lang-mixin 'beginner "Beginner" 1 "Java-like Beginner teaching language" #f))
(define dynamic-lang% (java-lang-mixin 'full "Java+dynamic" 5 "Java with dynamic typing capabilities" #t))
(java-lang-mixin 'intermediate (string-constant profj-intermediate-lang) 2 (string-constant profj-intermediate-lang-one-line-summary) #f))
(define beginner-lang% (java-lang-mixin 'beginner (string-constant profj-beginner-lang) 1 (string-constant profj-beginner-lang-one-line-summary) #f))
(define dynamic-lang% (java-lang-mixin 'full (string-constant profj-dynamic-lang) 5 (string-constant profj-dynamic-lang-one-summary) #t))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@ -784,7 +783,7 @@
(class* decorated-editor-snip% ()
(inherit get-admin get-editor)
(define/public (get-comment) "// ")
(define/public (get-mesg) "Convert to text comment")
(define/public (get-mesg) (string-constant profj-convert-to-text-comment))
(define/override get-text
(opt-lambda (offset num [flattened? #t])
@ -920,7 +919,7 @@
(define/override (make-editor) (new ((drscheme:unit:get-program-editor-mixin) color:text%)))
(define/override (make-snip) (make-object java-interactions-box%))
(define/override (get-corner-bitmap) ji-gif)
(define/override (get-mesg) "Convert to comment")
(define/override (get-mesg) (string-constant profj-convert-to-comment))
(define level 'full)
(define type-recs (create-type-record))
(define ret-list? #f)
@ -1036,7 +1035,8 @@
[(module name lang (#%plain-module-begin bodies ...))
(let ([execute-body (if (car (main))
`(lambda (x)
(display "executing main - ")
(display (string-constant profj-executing-main))
(display " - ")
(display (,(string->symbol (string-append (cadr (main)) "-main_java.lang.String1")) x)))
'void)])
(with-syntax ([main (datum->syntax-object #f execute-body #f)])

View File

@ -22,11 +22,13 @@
#cs
(module data-defs mzscheme
(require (lib "string-constant.ss" "string-constants"))
;; Those languages for which methods that satisfy an interface
;; don't have to be decorated with public ---
(define BEGINNER "Beginner")
(define INTERMEDIATE "Intermediate")
(define PROFESSIONAL "Professional")
(define BEGINNER (string-constant profj-beginner-lang))
(define INTERMEDIATE (string-constant profj-intermediate-lang))
(define PROFESSIONAL (string-constant profj-full-lang))
(define *languages* (list BEGINNER INTERMEDIATE PROFESSIONAL))
(define Language
(flat-named-contract "<Language>" (lambda (x) (member x *languages*))))

View File

@ -16,10 +16,6 @@
(provide tool@)
;; Strings
(define INSERT-JAVA-CLASS "Insert Java Class")
(define INSERT-JAVA-UNION "Insert Java Union")
(define tool@
(unit
(import drscheme:tool^)
@ -95,9 +91,9 @@
(callback A)
(demand-callback enable)))
(make-menu-item% INSERT-JAVA-CLASS get-class-info make-class class-draw)
(make-menu-item% (string-constant profjWizward-insert-java-class) get-class-info make-class class-draw)
(register-capability-menu-item 'profjWizard:special:java-class (get-special-menu))
(make-menu-item% INSERT-JAVA-UNION get-union-info make-union dt-draw)
(make-menu-item% (string-constant profjWizard-insert-java-union) get-union-info make-union dt-draw)
(register-capability-menu-item 'profjWizard:special:java-union (get-special-menu))))
(drscheme:get/extend:extend-unit-frame java-class-wizard-mixin)

View File

@ -815,6 +815,12 @@ please adhere to these guidelines:
(break-menu-item-help-string "Break the current evaluation")
(kill-menu-item-label "Kill")
(kill-menu-item-help-string "Kill the current evaluation")
(limit-memory-menu-item-label "Limit memory...")
(limit-memory-msg-1 "The limit will take effect the next time the program")
(limit-memory-msg-2 "is Run, and it must be at least 100 megabytes.")
(limit-memory-unlimited "Unlimited")
(limit-memory-limited "Limited")
(limit-memory-megabytes "Megabytes")
(clear-error-highlight-menu-item-label "Clear Error Highlight")
(clear-error-highlight-item-help-string "Removes the pink error highlighting")
(reindent-menu-item-label "&Reindent")
@ -1222,6 +1228,17 @@ please adhere to these guidelines:
(profj-java "Java")
(profj-java-mode "Java mode")
(profj-beginner-lang "Beginner")
(profj-beginner-lang-one-line-summary "Java-like Beginner teaching language")
(profj-full-lang "Full")
(profj-full-lang-one-line-summary "Like Java 1.0 (some 1.1)")
(profj-advanced-lang "Advanced")
(profj-advanced-lang-one-line-summary "Java-like Advanced teaching language")
(profj-intermediate-lang "Intermediate")
(profj-intermediate-lang-one-line-summary "Java-like Intermediate teaching language")
(profj-dynamic-lang "Java+dynamic")
(profj-dynamic-lang-one-summary "Java with dynamic typing capabilities")
(profj-java-mode-color-heading "Edit Colors") ; Heading for preference to choose editing colors
(profj-java-mode-color-keyword "keyword")
(profj-java-mode-color-string "string")
@ -1237,23 +1254,41 @@ please adhere to these guidelines:
(profj-language-config-display-preferences "Display Preferences") ; Heading for preferences controlling printing
(profj-language-config-display-style "Display style")
(profj-language-config-display-field "Class + Fields") ; Class should not be translated
(profj-language-config-display-field "Class + Fields")
(profj-language-config-class "Class")
(profj-language-config-display-array "Print entire contents of arrays?")
(profj-language-config-testing-preferences "Testing Preferences") ; Heading for preferences controlling test behavior
(profj-language-config-testing-enable "Display testing results on Run?") ; Run should be the word found on the Run button
(profj-language-config-testing-coverage "Collect coverage information for tests?")
(profj-language-config-support-test-language "Support test Language extension?")
(profj-language-config-testing-check "Allow check expression?") ; check should not be translated
(profj-language-config-classpath "Classpath")
(profj-language-config-choose-classpath-directory "Choose the directory to add to class path")
(profj-language-config-classpath-display "Show current") ; Button label to print the current classpath
(profj-test-name-close-to-example "Class ~a's name contains a phrase close to Example.")
(profj-test-name-example-miscapitalized "Class ~a's name contains a miscapitalized example.")
;; Close testing window and do not run test cases any more
(profj-test-results-close-and-disable "Close and Disable Testing")
;; Hide docked testing window and do not run test cases any more
(profj-test-results-hide-and-disable "Hide and Disable Testing")
(profj-test-results-window-title "Test Results")
(profj-unsupported "Unsupported")
(profj-executables-unsupported "Sorry - executables are not supported for Java at this time")
(profj-convert-to-text-comment "Convert to text comment")
(profj-convert-to-comment "Convert to comment")
(profj-executing-main "executing main")
(profj-insert-java-comment-box "Insert Java Comment Box")
(profj-insert-java-interactions-box "Insert Java Interactions Box")
(profjWizward-insert-java-class "Insert Java Class")
(profjWizard-insert-java-union "Insert Java Union")
;; The Test Suite Tool
;; Errors
(test-case-empty-error "Empty test case")

View File

@ -708,6 +708,13 @@
(break-menu-item-help-string "Momentane Auswertung unterbrechen")
(kill-menu-item-label "Abbrechen")
(kill-menu-item-help-string "Momentante Auswertung abbrechen")
(limit-memory-menu-item-label "Speicherverbrauch einschänken...")
(limit-memory-msg-1 "Das Limit wird beim nächsten Programmstart aktiv")
(limit-memory-msg-2 "und muß mindestens 100 Megabytes betragen.")
(limit-memory-unlimited "nicht einschränken")
(limit-memory-limited "einschränken")
(limit-memory-megabytes "Megabytes")
(clear-error-highlight-menu-item-label "Fehlermarkierung entfernen")
(clear-error-highlight-item-help-string "Entfernt die rosa Fehlermarkierung")
(reindent-menu-item-label "&Einrücken")
@ -1105,6 +1112,18 @@
;; Profj
(profj-java "Java")
(profj-java-mode "Java-Modus")
(profj-beginner-lang "Anfänger")
(profj-beginner-lang-one-line-summary "Java-ähnliche Lehrsprache für Anfänger")
(profj-full-lang "Voller Sprachumfang")
(profj-full-lang-one-line-summary "Wie Java 1.0 (einige 1.1-Erweiterungen)")
(profj-advanced-lang "Fortgeschritten")
(profj-advanced-lang-one-line-summary "Java-ähnliche Lehrsprache für Fortgeschrittene")
(profj-intermediate-lang "Zwischenstufe")
(profj-intermediate-lang-one-line-summary "Java-ähnliche Lehrsprache, Zwischenstufe")
(profj-dynamic-lang "Java+dynamic")
(profj-dynamic-lang-one-summary "Java mit dynamischen Typen")
(profj-java-mode-color-heading "Farben ändern") ; Heading for preference to choose editing colors
(profj-java-mode-color-keyword "Schlüsselwort")
(profj-java-mode-color-string "Zeichenkette")
@ -1120,23 +1139,41 @@
(profj-language-config-display-preferences "Einstellungen Anzeige") ; Heading for preferences controlling printing
(profj-language-config-display-style "Art der Anzeige")
(profj-language-config-display-field "Klassen + Felder") ; Class should not be translated
(profj-language-config-display-field "Klasse + Felder")
(profj-language-config-class "Klasse")
(profj-language-config-display-array "Gesamten Inhalt von Arrays ausdrucken?")
(profj-language-config-testing-preferences "Einstellungen Testen") ; Heading for preferences controlling test behavior
(profj-language-config-testing-enable "Testresultate bei Start anzeigen?") ; Run should be the word found on the Run button
(profj-language-config-testing-coverage "Abdeckungsinformationen für Tests sammeln?")
(profj-language-config-support-test-language "Spracherweiterung \"test\" unterstützen?")
(profj-language-config-testing-check "Check-Ausdruck zulassen?") ; check should not be translated
(profj-language-config-classpath "Klassenpfad")
(profj-language-config-choose-classpath-directory "Verzeichnis für den Klassenpfad auswählren")
(profj-language-config-classpath-display "Aktuellen Wert anzeigen") ; Button label to print the current classpath
(profj-test-name-close-to-example "Der Name von Klasse ~a enhält etwas, das so ähnlich wie \"Example\" aussieht.")
(profj-test-name-example-miscapitalized "Das \"example\" im Namen der Klasse ~a sollte \"Example\" geschrieben werden.")
;; Close testing window and do not run test cases any more
(profj-test-results-close-and-disable "Schließen und Testen deaktivieren")
;; Hide docked testing window and do not run test cases any more
(profj-test-results-hide-and-disable "Ausblenden und Testen deaktivieren")
(profj-test-results-window-title "Testresultate")
(profj-unsupported "Nicht unterstützt")
(profj-executables-unsupported "Programmdateien sind für Java bisher noch nicht unterstützt")
(profj-convert-to-text-comment "Hier Textkommentar einfügen")
(profj-convert-to-comment "Hier Kommentar einfügen")
(profj-executing-main "main ausführen")
(profj-insert-java-comment-box "Java-Kommentarkasten einfügen")
(profj-insert-java-interactions-box "Java-Interaktions-Kasten einfügen")
(profjWizward-insert-java-class "Java-Klasse einfügen")
(profjWizard-insert-java-union "Java-Vereinigung einfügen")
;; The Test Suite Tool
;; Errors
(test-case-empty-error "Leerer Testfall")