Tools__InternationalLanguageTranslationEditor.st
author Claus Gittinger <cg@exept.de>
Mon, 15 May 2006 15:49:52 +0200
changeset 2048 dcec4e818069
parent 2047 5f9b26862c57
child 2049 d10762e5d924
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:libtool2' }"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ NameSpace: Tools }"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
ApplicationModel subclass:#InternationalLanguageTranslationEditor
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:'languagesList keyStringsToLanguageMappings languageTextHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
		originalTextHolder modified shownLanguages selectedKeyRow
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
		showMissingTranslationsOnly
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
		keyStringAndLanguageSelectionTableColumnDescriptionHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
		languageShownHolders dataSetView lastExtractedClass
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
		lastExtractedApplicationClass stopApplicationIconVisibleHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
		monitoredApplication originalTextModifiedHolder
2048
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
    13
		languageTextModifiedHolder languageTextAcceptHolder
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
    14
		inSingleFileMode lastExtractedProject lastLanguage
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
    15
		lastSelectedKey'
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
    16
	classVariableNames:'LastExtractedClass LastExtractedApplicationClass
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
    17
		LastExtractedProject'
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'Interface-UIPainter'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
Object subclass:#AccessCollectingPseudoResourcePack
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
	instanceVariableNames:'collectedKeys realResourcePack'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
	classVariableNames:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
	poolDictionaries:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
	privateIn:InternationalLanguageTranslationEditor
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
Collection subclass:#KeyStringsToLanguageMappings
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
    30
	instanceVariableNames:'keys keyInfo perLanguageInfo perLanguageMappings languageMappings
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
    31
		languages'
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
	classVariableNames:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
	poolDictionaries:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
	privateIn:InternationalLanguageTranslationEditor
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
Object subclass:#LanguageMappingRow
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
	instanceVariableNames:'key mappings'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
	classVariableNames:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
	poolDictionaries:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
	privateIn:InternationalLanguageTranslationEditor
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
Visitor subclass:#UISpecVisitor
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
	instanceVariableNames:'translatedLabels'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
	classVariableNames:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
	poolDictionaries:''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
	privateIn:InternationalLanguageTranslationEditor
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
!InternationalLanguageTranslationEditor class methodsFor:'documentation'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
documentation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    documentation to be added.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    [author:]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
        cg (cg@FUSI)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    [instance variables:]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    [class variables:]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    [see also:]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
examples
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
  Starting the application:
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
                                                                [exBegin]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    InternationalLanguageTranslationEditor open
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
                                                                [exEnd]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
  more examples to be added:
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
                                                                [exBegin]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    ... add code fragment for 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    ... executable example here ...
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
                                                                [exEnd]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
history
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "Created: / 04-03-2006 / 09:07:19 / cg"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
! !
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
!InternationalLanguageTranslationEditor class methodsFor:'interface specs'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
windowSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
    "This resource specification was automatically generated
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
     by the UIPainter of ST/X."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "Do not manually edit this!! If it is corrupted,
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
     the UIPainter may not be able to read the specification."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    "
2048
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
    99
     UIPainter new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#windowSpec
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   100
     Tools::InternationalLanguageTranslationEditor new openInterface:#windowSpec
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   101
     Tools::InternationalLanguageTranslationEditor open
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    "
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    <resource: #canvas>
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    ^ 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
     #(FullSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
        name: windowSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
        window: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
       (WindowSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
          label: 'InternationalLanguageTranslationEditor'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
          name: 'InternationalLanguageTranslationEditor'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
          min: (Point 10 10)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
          max: (Point 1024 768)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
          bounds: (Rectangle 0 0 640 400)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
          menu: mainMenu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
        )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
        component: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
       (SpecCollection
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
          collection: (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
           (MenuPanelSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
              name: 'ToolBar'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
              layout: (LayoutFrame 0 0 0 0 0 1 30 0)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
              menu: menuToolBar
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
              textDefault: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
            )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
           (VariableVerticalPanelSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
              name: 'VariableVerticalPanel1'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
              layout: (LayoutFrame 0 0 30 0 0 1 0 1)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
              component: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
             (SpecCollection
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
                collection: (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
                 (DataSetSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
                    name: 'KeyStringAndLanguageSelectionTable'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
                    model: selectedKeyRow
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
                    hasHorizontalScrollBar: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
                    hasVerticalScrollBar: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
                    dataList: keyStringAndLanguageSelectionTable
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
                    columnHolder: keyStringAndLanguageSelectionTableColumnDescriptionHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
                    columnAdaptor: yourself
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
                    postBuildCallback: postBuildDataSet:
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
                  )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
                 (ViewSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
                    name: 'Box1'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
                    component: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
                   (SpecCollection
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
                      collection: (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
                       (LabelSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
                          label: 'Original String (Key):'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
                          name: 'Label2'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
                          layout: (LayoutFrame 0 0 0 0 0 1 30 0)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
                          translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
                          adjust: left
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
                        )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
                       (TextEditorSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
                          name: 'OriginalText'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
                          layout: (LayoutFrame 0 0 30 0 0 1 0 1)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
                          model: originalTextHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
                          hasHorizontalScrollBar: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
                          hasVerticalScrollBar: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
                          modifiedChannel: originalTextModifiedHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
                        )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
                       )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
                     
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
                    )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
                  )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
                 (ViewSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
                    name: 'Box2'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
                    component: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
                   (SpecCollection
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
                      collection: (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
                       (LabelSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
                          label: 'Translated String:'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
                          name: 'Label1'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
                          layout: (LayoutFrame 0 0 0 0 0 1 30 0)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
                          translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
                          adjust: left
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
                        )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
                       (TextEditorSpec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
                          name: 'LanguageText'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
                          layout: (LayoutFrame 0 0 30 0 0 1 0 1)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
                          model: languageTextHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
                          hasHorizontalScrollBar: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
                          hasVerticalScrollBar: true
2048
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   185
                          acceptChannel: languageTextAcceptHolder
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
                          modifiedChannel: languageTextModifiedHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
                        )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
                       )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
                     
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
                    )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
                  )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
                 )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
               
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
              )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
              handles: (Any 0.33333333333333 0.66666666666667 1.0)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
            )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
           )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
         
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
        )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
      )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
! !
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
!InternationalLanguageTranslationEditor class methodsFor:'menu specs'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
mainMenu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    "This resource specification was automatically generated
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
     by the MenuEditor of ST/X."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    "Do not manually edit this!! If it is corrupted,
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
     the MenuEditor may not be able to read the specification."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    "
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
     MenuEditor new openOnClass:InternationalLanguageTranslationEditor andSelector:#mainMenu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
     (Menu new fromLiteralArrayEncoding:(InternationalLanguageTranslationEditor mainMenu)) startUp
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
    "
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
    <resource: #menu>
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    ^ 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
     #(Menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
        (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
            label: 'File'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
            submenu: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
           (Menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
              (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
                  label: 'New'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
                  itemValue: menuNew
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
                  label: '-'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
                  label: 'Open Resource File...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
                  itemValue: menuOpen
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
                  label: '-'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
                  label: 'Save Resource File'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
                  itemValue: menuSave
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
                  label: 'Save Resource File As...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
                  itemValue: menuSaveAs
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
                  label: '-'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
                  label: 'Exit'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
                  itemValue: closeRequest
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
               )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
            )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
            label: 'View'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
            submenu: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
           (Menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
              (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
                  label: 'Show Missing Translations Only'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
                  indication: showMissingTranslationsOnly
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
                  label: '-'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
                  label: 'Shown Languages'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
                  submenuChannel: shownLanguagesMenu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
               )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
            )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
            label: 'Languages'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
            submenu: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
           (Menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
              (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
                  label: 'Add Language...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
                  itemValue: addLanguage
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
                  label: 'Remove Language...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
                  itemValue: removeLanguage
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
               )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
            )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
            label: 'Translations'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
            submenu: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
           (Menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
              (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
                  label: 'Add Translation...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
                  itemValue: addTranslation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
                  label: 'Remove Translation...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
                  itemValue: removeTranslation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
                  label: '-'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
                  label: 'Extract from Class...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
                  itemValue: extractTranslationsFromClass
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
               (MenuItem
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   337
                  label: 'Extract from Project...'
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   338
                  itemValue: extractTranslationsFromProject
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   339
                  translateLabel: true
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   340
                )
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   341
               (MenuItem
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   342
                  label: '-'
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   343
                )
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   344
               (MenuItem
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
                  label: 'Run Application and Collect Translations...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
                  itemValue: runApplicationAndCollectTranslations
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
               )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
            )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
            label: 'Help'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
            startGroup: right
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
            submenu: 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
           (Menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
              (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
                  label: 'Documentation'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
                  itemValue: openDocumentation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
                  label: '-'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
               (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
                  label: 'About this Application...'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
                  itemValue: openAboutThisApplication
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
                  translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
                )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
               )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
              nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
            )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
         )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
        nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
        nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
      )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
menuToolBar
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
    "This resource specification was automatically generated
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
     by the MenuEditor of ST/X."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
    "Do not manually edit this!! If it is corrupted,
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
     the MenuEditor may not be able to read the specification."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
    "
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
     MenuEditor new openOnClass:InternationalLanguageTranslationEditor andSelector:#menuToolBar
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
     (Menu new fromLiteralArrayEncoding:(InternationalLanguageTranslationEditor menuToolBar)) startUp
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
    "
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
    <resource: #menu>
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
    ^ 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
     #(Menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
        (
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
            label: 'Save'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
            labelImage: (ResourceRetriever XPToolbarIconLibrary saveImageIcon)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
            label: '-'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
            label: 'Add Translation'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
            itemValue: addTranslation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
            labelImage: (ResourceRetriever XPToolbarIconLibrary newRowIcon)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
            label: 'Remove Translation'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
            itemValue: removeTranslation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
            labelImage: (ResourceRetriever XPToolbarIconLibrary removeRowIcon)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
            label: ''
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
         (MenuItem
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
            label: 'Stop Application'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
            itemValue: stopApplication
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
            translateLabel: true
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
            isVisible: stopApplicationIconVisibleHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
            labelImage: (ResourceRetriever XPToolbarIconLibrary stop16x16Icon)
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
          )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
         )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
        nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
        nil
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
      )
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
! !
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
2047
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   438
!InternationalLanguageTranslationEditor class methodsFor:'tableColumns specs'!
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   439
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   440
keyTableColumn
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   441
    "This resource specification was automatically generated
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   442
     by the DataSetBuilder of ST/X."
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   443
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   444
    "Do not manually edit this!! If it is corrupted,
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   445
     the DataSetBuilder may not be able to read the specification."
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   446
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   447
    "
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   448
     DataSetBuilder new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#keyTableColumn
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   449
    "
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   450
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   451
    <resource: #tableColumns>
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   452
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   453
    ^#(
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   454
      (DataSetColumnSpec
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   455
         label: 'Key'
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   456
         labelButtonType: Button
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   457
         minWidth: 50
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   458
         model: keyStringInRow:
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   459
       )
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   460
      )
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   461
!
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   462
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   463
languageTableColumn
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   464
    "This resource specification was automatically generated
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   465
     by the DataSetBuilder of ST/X."
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   466
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   467
    "Do not manually edit this!! If it is corrupted,
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   468
     the DataSetBuilder may not be able to read the specification."
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   469
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   470
    "
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   471
     DataSetBuilder new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#keyTableColumn
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   472
    "
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   473
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   474
    <resource: #tableColumns>
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   475
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   476
    ^#(
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   477
              #(DataSetColumnSpec
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   478
                 label: #lang
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   479
                 labelAlignment: center
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   480
                 labelButtonType: Button
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   481
                 minWidth: 50
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   482
                 model: #columnInRow:at:
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   483
                 canSelect: true
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   484
                 isResizeable: true
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   485
                 showRowSeparator: true
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   486
                 showColSeparator: true
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   487
                 backgroundSelector: #getBackgroundForRow:rowNr:col:
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   488
               )
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   489
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   490
      )
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   491
! !
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   492
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
!InternationalLanguageTranslationEditor methodsFor:'aspects'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
keyStringAndLanguageSelectionTable
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
    keyStringsToLanguageMappings isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
        keyStringsToLanguageMappings := KeyStringsToLanguageMappings new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
    ^ keyStringsToLanguageMappings.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
keyStringAndLanguageSelectionTableColumnDescriptionHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
    keyStringAndLanguageSelectionTableColumnDescriptionHolder isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
        keyStringAndLanguageSelectionTableColumnDescriptionHolder := ValueHolder new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
        keyStringAndLanguageSelectionTableColumnDescriptionHolder value:(self keyStringAndLanguageSelectionTableColumnDescription).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
    ^ keyStringAndLanguageSelectionTableColumnDescriptionHolder.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
languageAtCol:colNr
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
    ^ shownLanguages at:colNr-1.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
languageShownHolderFor:lang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
    |holder|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
    languageShownHolders isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
        languageShownHolders := Dictionary new
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
    holder := languageShownHolders 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
                at:lang 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
                ifAbsentPut:[ 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
                    |h|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
                    h := true asValue.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
                    h onChangeEvaluate:[ 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
                        h value ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
                           self enableLanguageDisplayFor:lang     
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
                        ] ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
                           self disableLanguageDisplayFor:lang     
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
                        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
                    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
                    h
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
                ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
    ^ holder.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
2048
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   538
languageTextAcceptHolder
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   539
    languageTextAcceptHolder isNil ifTrue:[
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   540
        languageTextAcceptHolder := false asValue.
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   541
    ].
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   542
    ^ languageTextAcceptHolder.
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   543
!
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   544
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
languageTextHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
    languageTextHolder isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
        languageTextHolder := '' asValue.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
    ^ languageTextHolder.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
languageTextModifiedHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
    languageTextModifiedHolder isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
        languageTextModifiedHolder := false asValue.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
    ^ languageTextModifiedHolder.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
languagesList
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
    languagesList isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
        languagesList := List withAll:(self keyStringAndLanguageSelectionTable languages).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
    ^ languagesList.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   566
originalTextHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
    originalTextHolder isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
        originalTextHolder := '' asValue.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
    ^ originalTextHolder.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
originalTextModifiedHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
    originalTextModifiedHolder isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
        originalTextModifiedHolder := false asValue.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
    ^ originalTextModifiedHolder.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   578
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
selectedKeyRow
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
    selectedKeyRow isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   582
        selectedKeyRow := ValueHolder new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
        selectedKeyRow onChangeSend:#selectionChanged to:self.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
    ^ selectedKeyRow.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
showMissingTranslationsOnly
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
    showMissingTranslationsOnly isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
        showMissingTranslationsOnly := false asValue.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   591
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   592
    ^ showMissingTranslationsOnly.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
shownLanguages
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
    shownLanguages isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
        shownLanguages := List new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
        shownLanguages addAll:(self languagesList).
2048
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   599
        "/ shownLanguages addDependent:self. 
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
        shownLanguages onChangeSend:#shownLanguagesChanged to:self.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
    ^ shownLanguages.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
stopApplicationIconVisibleHolder
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
    stopApplicationIconVisibleHolder isNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
        stopApplicationIconVisibleHolder := false asValue.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
    ^ stopApplicationIconVisibleHolder.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
! !
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
2048
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   612
!InternationalLanguageTranslationEditor methodsFor:'change & update'!
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   613
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   614
update:something with:aParameter from:changedObject
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   615
    changedObject == shownLanguages ifTrue:[
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   616
         self shownLanguagesChanged.
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   617
         ^ self.
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   618
    ].
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   619
! !
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   620
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
!InternationalLanguageTranslationEditor methodsFor:'initialization & release'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
closeRequest
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
    "asks for permission before closing"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
    self hasUnsavedChanges ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
        (Dialog 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
            confirm:(resources string:'Close without saving ?')
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
            default:false) ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
            ^ self
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   631
        ]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   632
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   634
    super closeRequest
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   635
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
initialize
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
    modified := false.
2031
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   639
    inSingleFileMode := false.
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
    super initialize
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
postBuildDataSet:aView
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
    dataSetView := aView
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
! !
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
!InternationalLanguageTranslationEditor methodsFor:'menu actions'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
addLanguage
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
    |lang|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
    lang := Dialog request:'New language (ISO symbol):'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
    lang isEmptyOrNil ifTrue:[^ self].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
    (keyStringsToLanguageMappings includesLanguage:lang) ifTrue:[^ self ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   656
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
    keyStringsToLanguageMappings addLanguage:lang.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
    self languagesList add:lang.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   659
    self shownLanguages add:lang.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
    modified := true.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
addTranslation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
    |key index|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
    key := Dialog request:'New Key:'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
    (keyStringsToLanguageMappings includesKey:key) ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
        keyStringsToLanguageMappings addKey:key.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
        modified := true.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   671
    index := keyStringsToLanguageMappings indexOfKey:key.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   672
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   673
    self selectedKeyRow value:index
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   674
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   675
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   676
extractTranslationsFromClass
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   677
    |aClass newTranslations|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   678
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   679
    aClass := Dialog 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   680
                requestClass:'Class to extract translations from:'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   681
                okLabel:'OK' 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   682
                initialAnswer:(lastExtractedClass ? LastExtractedClass).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
    aClass isNil ifTrue:[^ self ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   685
    lastExtractedClass := LastExtractedClass := aClass.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   687
    newTranslations := self extractTranslationsFromClass:aClass.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   688
    self addAllTranslations:newTranslations.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   689
!
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   690
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   691
extractTranslationsFromProject
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   692
    |box projectID newTranslations|
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   693
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   694
    box := ListSelectionBox new.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   695
"/    box useComboBoxWithList:(Smalltalk allProjectIDs).
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   696
    box title:(resources string:'Project to extract translations from:').
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   697
    box list:Smalltalk allProjectIDs.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   698
    box okAction:[:sel | projectID := sel].
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   699
    box initialText:(lastExtractedProject ? LastExtractedProject).
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   700
    box label:'Find Translations in Project'.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   701
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   702
    box showAtPointer.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   703
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   704
    projectID notNil ifTrue:[
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   705
        projectID := projectID withoutSeparators asSymbol.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   706
    ].
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   707
    projectID isEmptyOrNil ifTrue:[^ self ].
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   708
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   709
    lastExtractedProject := LastExtractedProject := projectID.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   710
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   711
    newTranslations := Set new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   712
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   713
    Smalltalk allClassesDo:[:eachClass |
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   714
        eachClass theNonMetaclass package == projectID ifTrue:[
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   715
"/ eachClass isLoaded ifTrue:[ self halt. ].
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   716
            newTranslations addAll:( self extractTranslationsFromClass:eachClass theNonMetaclass).
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   717
        ]
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   718
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   719
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   720
    self addAllTranslations:newTranslations.
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   721
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   722
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   723
menuNew
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   724
    modified ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   725
        (Dialog 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
            confirm:(resources stringWithCRs:'Modified translations have not been changed.\\Create new translations set anyway ?')
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
            default:false) ifFalse:[^ self].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   729
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
    keyStringsToLanguageMappings initialize.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
    keyStringsToLanguageMappings changed.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   733
    self languagesList contents:self keyStringAndLanguageSelectionTable languages.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   734
    self shownLanguages contents:self keyStringAndLanguageSelectionTable languages.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   735
    modified := false.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   737
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   738
menuOpen
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
    |fn|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   740
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   741
    fn := Dialog 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   742
        requestFileName:'Name of resource file:'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   743
        default:nil 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   744
        pattern:'*.rs'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   746
    fn isEmptyOrNil ifTrue:[^ self ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
    fn := fn asFilename.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   748
    fn exists ifFalse:[^ self ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   749
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   750
    self readResourceFile:fn
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   751
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
menuSave
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
    "This method was generated by the Browser.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
     It will be invoked when the menu-item 'save' is selected."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   757
    "/ change below and add any actions as required here ...
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   758
    self warn:'no action for ''save'' available.'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   759
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   761
menuSaveAs
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   762
    "This method was generated by the Browser.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   763
     It will be invoked when the menu-item 'saveAs' is selected."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   764
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   765
    "/ change below and add any actions as required here ...
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   766
    self warn:'no action for ''saveAs'' available.'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   767
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
openAboutThisApplication
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   770
    "This method was generated by the Browser.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   771
     It will be invoked when the menu-item 'help-about' is selected."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
    "/ could open a customized aboutBox here ...
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
    super openAboutThisApplication
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   776
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   777
openDocumentation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   778
    "This method was generated by the Browser.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
     It will be invoked when the menu-item 'help-documentation' is selected."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
    "/ change below as required ...
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
    "/ to open an HTML viewer on some document (under 'doc/online/<language>/' ):
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   784
    HTMLDocumentView openFullOnDocumentationFile:'TOP.html'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
    "/ add application-specific help files under the 'doc/online/<language>/help/appName'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
    "/ directory, and open a viewer with:
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
    "/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   790
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
readResourceFile:aFilename
2031
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   792
    |lang|
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   793
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   794
    lang := Dialog choose:'For which language ?' fromList:languagesList lines:10.
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   795
    lang isNil ifTrue:[^ self ].
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   796
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   797
    self readResourceFile:aFilename asLanguage:lang asSymbol
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   798
!
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   799
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   800
readResourceFile:aFilename asLanguage:lang
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   801
    |resourcePack inStream lineString encoding decoder sortedKeys remainingKeys|
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   802
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   803
    aFilename exists ifFalse:[^ self ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   804
2031
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   805
    resourcePack := ResourcePack new.
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   806
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   807
    inStream := aFilename readStream.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   808
    [inStream atEnd] whileFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   809
        lineString := inStream nextLine.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   810
        (lineString notEmpty 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   811
        and:[ (lineString startsWith:';') not ]) ifTrue:[
2031
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   812
            ((lineString startsWith:'#') and:[(lineString startsWith:'#(') not]) ifTrue:[
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   813
                lineString := (lineString copyFrom:2) withoutSeparators.
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   814
                (lineString startsWith:'encoding ') ifTrue:[
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   815
                    encoding := ResourcePack extractEncodingFromLine:lineString.
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   816
                    decoder := CharacterEncoder encoderFor:encoding ifAbsent:nil.
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   817
                ].
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
            ] ifFalse:[
2031
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   819
                ResourcePack
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   820
                    processResourceLine:lineString 
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   821
                    encoding:decoder 
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   822
                    file:aFilename pathName 
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   823
                    printErrorWith:[:msg | Transcript showCR:msg ] 
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   824
                    for:resourcePack
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   825
                    keepUselessTranslations:true.
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
            ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
    inStream close.
2031
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   830
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   831
    sortedKeys := (resourcePack keys select:[:k | k isString]) asSortedCollection.
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   832
    remainingKeys := resourcePack keys select:[:k | k isString not].
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   833
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   834
    sortedKeys do:[:k |
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   835
        keyStringsToLanguageMappings at:k language:lang put:(resourcePack at:k)
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   836
    ].
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   837
    remainingKeys do:[:k |
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   838
        keyStringsToLanguageMappings at:k language:lang put:(resourcePack at:k)
85947c4c6502 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2015
diff changeset
   839
    ].
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   840
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   842
removeLanguage
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   843
    "automatically generated by UIEditor ..."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   844
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   845
    "*** the code below performs no action"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   846
    "*** (except for some feedback on the Transcript)"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
    "*** Please change as required and accept in the browser."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   848
    "*** (and replace this comment by something more useful ;-)"
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   849
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   850
    "action to be added ..."
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   851
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   852
    Transcript showCR:self class name, ': action for #removeLanguage ...'.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   853
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   854
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   855
removeTranslation
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   856
    |rowSelectionIndex selectedKey|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   857
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   858
    rowSelectionIndex := self selectedKeyRow value.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   859
    rowSelectionIndex ~~ 0 ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   860
        selectedKey := keyStringsToLanguageMappings keyAt:rowSelectionIndex ifAbsent:nil.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   861
        (Dialog confirm:(resources string:'Really remove key %1' with:selectedKey)) ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   862
            keyStringsToLanguageMappings removeKey:selectedKey.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   863
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   864
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   865
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
runApplicationAndCollectTranslations
2047
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   868
    |applicationClass newTranslations pseudoPack app startSelector|
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   869
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   870
    monitoredApplication notNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   871
        monitoredApplication terminate.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   872
        [monitoredApplication notNil] whileTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   873
            Delay waitForSeconds:0.1
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   875
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   877
    applicationClass := Dialog 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   878
                requestClass:'Application class to start and collect translations from:'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   879
                okLabel:'OK' 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   880
                initialAnswer:(lastExtractedApplicationClass ? LastExtractedApplicationClass ).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   881
    applicationClass isNil ifTrue:[^ self ].
2047
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   882
    applicationClass isNamespace ifTrue:[
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   883
        Dialog warn:'Entered class is a NameSpace'.
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   884
        ^ self.
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   885
    ].
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   886
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   887
    applicationClass isVisualStartable ifTrue:[
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   888
        startSelector := #open
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   889
    ] ifFalse:[
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   890
        startSelector := Dialog
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   891
                    request:'Entered class seems to be no application class. Ok to start using selector:'
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   892
                    initialAnswer:((applicationClass respondsTo:#'start')
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   893
                                        ifTrue:#'start'
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   894
                                        ifFalse:#'new')
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   895
                    okLabel:'START'
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   896
                    title:'Start Application'.
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   897
        startSelector isNil ifTrue:[
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   898
            ^ self
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   899
        ].
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   900
        startSelector := startSelector asSymbol.
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   901
    ].
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   902
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   903
    lastExtractedApplicationClass := LastExtractedApplicationClass := applicationClass.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   904
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
    newTranslations := Set new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
    pseudoPack := AccessCollectingPseudoResourcePack new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
    pseudoPack realResourcePack:(applicationClass classResources).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   909
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   910
    self stopApplicationIconVisibleHolder value:true.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   912
    monitoredApplication := [
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   913
        [
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
            app := applicationClass new.
2047
5f9b26862c57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2035
diff changeset
   915
            app perform:startSelector.
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
            app window waitUntilVisible.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
            app window waitUntilClosed.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   918
        ] ensure:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
            app closeRequest.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   920
            self stopApplicationIconVisibleHolder value:false.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   921
            monitoredApplication := nil.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
    ] fork.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
! !
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   925
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   926
!InternationalLanguageTranslationEditor methodsFor:'menus dynamic'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   927
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   928
disableLanguageDisplayFor:lang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   929
    self shownLanguages remove:lang ifAbsent:[]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   930
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   931
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   932
enableLanguageDisplayFor:newLang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   933
    |shownLanguagesInOrder|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   934
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   935
    (self shownLanguages includes:newLang) ifFalse:[
2048
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   936
"/        shownLanguagesInOrder := self languagesList
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   937
"/                                    select:[:lang | (self shownLanguages includes:lang)
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   938
"/                                                    or:[ lang = newLang ]].
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   939
"/        self shownLanguages contents:shownLanguagesInOrder.
dcec4e818069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2047
diff changeset
   940
        self shownLanguages add:newLang.
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   941
    ]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   942
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   943
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   944
isLanguageShown:lang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   945
    ^ self shownLanguages includes:lang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   946
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   947
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   948
shownLanguagesMenu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   949
    <resource: #programMenu >
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   950
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   951
    ^ [
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
        |m selected|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
        m := Menu new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   956
        self languagesList do:[:lang |
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   957
            |item|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   958
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   959
            item := MenuItem label:lang.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   960
            item indication:(self languageShownHolderFor:lang).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   961
            item hideMenuOnActivated:false.    
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   962
            m addItem:item.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   963
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   964
        m
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   967
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
toggleLanguageDisplayFor:lang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
    (self shownLanguages includes:lang) ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   970
        self disableLanguageDisplayFor:lang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   971
    ] ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
        self enableLanguageDisplayFor:lang
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
! !
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
!InternationalLanguageTranslationEditor methodsFor:'private-key extraction'!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   977
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   978
addAllTranslations:newTranslations
2034
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   979
    |newTranslationKeys stringKeys nonStringKeys|
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   980
2034
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   981
    newTranslationKeys := newTranslations select:[:k | k notEmpty and:[k isString not or:[k isBlank not]]].
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   982
    newTranslationKeys := newTranslationKeys select:[:k | (keyStringsToLanguageMappings includesKey:k) not].
2034
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   983
    newTranslationKeys := newTranslationKeys 
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   984
                                collect:[:k | 
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   985
                                        (k endsWith:'...') ifTrue:[
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   986
                                            k copyWithoutLast:3.
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   987
                                        ] ifFalse:[
2035
ea8ec7c3fbeb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2034
diff changeset
   988
                                            ('.:?' includes:k last) ifTrue:[
2034
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   989
                                                k copyWithoutLast:1.
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   990
                                            ] ifFalse:[
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   991
                                                k
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   992
                                        ]]].
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   993
    newTranslationKeys := newTranslationKeys asSet.
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   994
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
   995
    newTranslationKeys notEmpty ifTrue:[
2034
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   996
        stringKeys := newTranslationKeys select:[:k | k isString].
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   997
        nonStringKeys := newTranslationKeys select:[:k | k isString not].
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   998
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
   999
        stringKeys := stringKeys asSortedCollection.
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
  1000
        keyStringsToLanguageMappings addKeys:stringKeys.
23d558e4d32e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2033
diff changeset
  1001
        keyStringsToLanguageMappings addKeys:nonStringKeys.
2032
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1002
        modified := true.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1003
    ].
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1004
!
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1005
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1006
extractTranslationsFromClass:aClass
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1007
    |newTranslations|
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1008
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1009
    newTranslations := Set new.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1010
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1011
    self withWaitCursorDo:[
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1012
        "/ now, the hard part:
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1013
        "/ possible translations are in the specs,
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1014
        "/ and all arguments to (resources string:) messages.
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1015
        aClass instAndClassMethodsDo:[:eachMethod |
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1016
            newTranslations addAll:( self extractTranslationsFromMethod:eachMethod ).
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1017
        ].
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1018
    ].
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1019
    ^ newTranslations
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1020
!
cc2edbb9ebfc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2031
diff changeset
  1021
2015
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1022
extractTranslationsFromHelpSpecMethod:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1023
    |codeStrings matcher parseTree resourceKeys|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1024
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1025
    parseTree := RBParser 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1026
            parseMethod:aMethod source 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1027
            onError: [:str :pos | Transcript showCR:str. Transcript showCR:pos.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1028
                                  nil].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1029
    parseTree isNil ifTrue:[^ #() ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1030
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1031
    codeStrings  := 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1032
        #(
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1033
                '`@dict addPairsFrom: `#helpKeysAndStrings'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1034
        ).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1035
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1036
    resourceKeys := Set new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
    matcher := ParseTreeSearcher new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1039
    matcher 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
        matchesAnyOf: codeStrings 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1041
        do: [:aNode :answer |
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1042
                |sel argNode arg|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1043
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1044
                sel := aNode selector.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1045
                (sel startsWith:'addPairsFrom:') ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1046
                    argNode := aNode arguments at:1.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1047
                    argNode isLiteral ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1048
                        arg := argNode value.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1049
                        arg isArray ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1050
                            arg doWithIndex:[:el :index |
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1051
                                index even ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1052
                                    el isString ifTrue:[    
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1053
                                        resourceKeys add:el.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1054
                                    ]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1055
                                ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1056
                            ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1057
                        ] ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1058
                            Transcript 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1059
                                showCR:(resources 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
                                        string:'Cannot derive resourceKey from non-array in %1 in %2'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
                                        with:argNode formattedCode
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
                                        with:aMethod selector).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1063
                        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1064
                    ] ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1065
                        Transcript 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1066
                            showCR:(resources 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1067
                                        string:'Cannot derive resourceKey from non-literal: %1 in %2'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1068
                                        with:argNode formattedCode
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1069
                                        with:aMethod selector).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1070
                    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1071
                ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1072
                aNode
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1073
            ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1074
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1075
    matcher executeTree: parseTree initialAnswer: nil.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1076
    ^ resourceKeys
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1077
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1078
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1079
extractTranslationsFromMenuSpecMethod:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1080
    |menu resourceKeys|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1081
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1082
    menu := aMethod mclass theNonMetaclass perform:aMethod selector.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1083
    menu isNil ifTrue:[ ^ #() ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1084
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1085
    (menu isKindOf:Menu) ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1086
        menu := Menu new fromLiteralArrayEncoding:menu
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1089
    resourceKeys := Set new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
    menu allItemsDo:[:aMenuItem |
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
        aMenuItem translateLabel ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
            aMenuItem isSeparatorItem ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
                resourceKeys add:aMenuItem label.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1094
            ]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1095
        ]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1097
    ^ resourceKeys
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
extractTranslationsFromMethod:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
    |mResources|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
    mResources := aMethod resources.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
    mResources notNil ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
        (mResources includesKey:#menu) ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
             ^ self extractTranslationsFromMenuSpecMethod:aMethod.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
        (mResources includesKey:#canvas) ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
             ^ self extractTranslationsFromUISpecMethod:aMethod.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
        (mResources includesKey:#help) ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
             ^ self extractTranslationsFromHelpSpecMethod:aMethod.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
        (mResources includesKey:#tableColumns) ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
             ^ self extractTranslationsFromTableColumnsSpecMethod:aMethod.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
        ^ self extractTranslationsFromSpecMethod:aMethod.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1119
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1120
    ^ self extractTranslationsFromMethodsCode:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1121
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
extractTranslationsFromMethodsCode:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1124
"/method:mthd selector:sel inClass:cls matchesParseTreeMatcher:aMatcher
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
    |codeStrings matcher parseTree resourceKeys|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1126
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
    parseTree := RBParser 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
            parseMethod:aMethod source 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1129
            onError: [:str :pos | Transcript showCR:str. Transcript showCR:pos.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1130
                                  nil].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1131
    parseTree isNil ifTrue:[^ #() ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1132
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1133
    codeStrings  := 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1134
        #(
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1135
                'resources `@msg: `@args'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1136
                'self resources `@msg: `@args'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1137
                'self class resources `@msg: `@args'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1138
                'self classResources `@msg: `@args'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1139
        ).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1140
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1141
    resourceKeys := Set new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1142
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1143
    matcher := ParseTreeSearcher new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1144
    matcher 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1145
        matchesAnyOf: codeStrings 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1146
        do: [:aNode :answer |
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1147
                |sel keyStringArgNode keyStringArg|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1148
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
                sel := aNode selector.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
                ((sel startsWith:'string:') or:[(sel startsWith:'at:')]) ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
                    keyStringArgNode := aNode arguments at:1.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
                    keyStringArgNode isLiteral ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1153
                        keyStringArg := keyStringArgNode value.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1154
                        keyStringArg isString ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
                            resourceKeys add:keyStringArg.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
                        ] ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
                            Transcript 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
                                showCR:(resources 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1159
                                        string:'Cannot derive resourceKey from non-string: %1 in %2'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
                                        with:keyStringArgNode formattedCode
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
                                        with:aMethod selector).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
                        ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1163
                    ] ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1164
                        Transcript 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
                            showCR:(resources 
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
                                        string:'Cannot derive resourceKey from non-literal: %1 in %2'
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1167
                                        with:keyStringArgNode formattedCode
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1168
                                        with:aMethod selector).
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1169
                    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1170
                ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1171
                aNode
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1172
            ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1173
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1174
    matcher executeTree: parseTree initialAnswer: nil.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1175
    ^ resourceKeys
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1176
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1177
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1178
extractTranslationsFromSpecMethod:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1179
    ^ #()
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1180
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1181
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1182
extractTranslationsFromTableColumnsSpecMethod:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1183
    |columnDescription resourceKeys|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1184
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1185
    columnDescription := aMethod mclass theNonMetaclass perform:aMethod selector.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1186
    columnDescription isNil ifTrue:[ ^ #() ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1187
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1188
    (columnDescription first isKindOf:DataSetColumnSpec) ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1189
        columnDescription := columnDescription collect:[:el | DataSetColumnSpec new fromLiteralArrayEncoding:el].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1190
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1191
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1192
    resourceKeys := Set new.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1193
    columnDescription do:[:aColumnSpec |
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1194
        aColumnSpec translateLabel ifTrue:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1195
            resourceKeys add:aColumnSpec label.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1196
        ]
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1197
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1198
    ^ resourceKeys
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1199
!
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
extractTranslationsFromUISpecMethod:aMethod
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1202
    |spec resourceKeys visitor|
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1203
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
    spec := aMethod mclass theNonMetaclass perform:aMethod selector.
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1205
    spec isNil ifTrue:[ ^ #() ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1206
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1207
    (spec isKindOf:UISpecification) ifFalse:[
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1208
        spec := UISpecification from:spec
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1209
    ].
8f226ff9b5e6 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1210
8f226ff9b5e6 initial checkin
Claus Gitt