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