Tools__InternationalLanguageTranslationEditor.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Apr 2016 22:36:49 +0200
changeset 3286 1ea9a6fbe2b4
parent 3285 5b8697869e72
child 3312 84084dd13f11
permissions -rw-r--r--
#FEATURE by cg
class: Tools::InternationalLanguageTranslationEditor
class definition
added:5 methods
comment/format in:
#extractTranslationsFromClass:
#extractTranslationsFromMethod:
#search
changed:15 methods
many improvements;
extract remembers methods; browse-button to navigate there;
recorder working;
cg@2015
     1
"{ Package: 'stx:libtool2' }"
cg@2015
     2
cg@2015
     3
"{ NameSpace: Tools }"
cg@2015
     4
cg@2015
     5
ApplicationModel subclass:#InternationalLanguageTranslationEditor
cg@2015
     6
	instanceVariableNames:'languagesList keyStringsToLanguageMappings languageTextHolder
cg@2015
     7
		originalTextHolder modified shownLanguages selectedKeyRow
cg@2015
     8
		showMissingTranslationsOnly
cg@2015
     9
		keyStringAndLanguageSelectionTableColumnDescriptionHolder
cg@2015
    10
		languageShownHolders dataSetView lastExtractedClass
cg@2015
    11
		lastExtractedApplicationClass stopApplicationIconVisibleHolder
cg@2015
    12
		monitoredApplication originalTextModifiedHolder
cg@2048
    13
		languageTextModifiedHolder languageTextAcceptHolder
cg@2048
    14
		inSingleFileMode lastExtractedProject lastLanguage
fm@2050
    15
		lastSelectedKey autoAcceptHolder languageEditor
fm@2050
    16
		selectedColIndexHolder exampleLanguageSelectionHolder
fm@2051
    17
		exampleLanguageTextHolder pastePreviousTranslationEnableHolder
fm@2163
    18
		searchForSimilarTranslationEnableHolder alwaysWriteUTF8Holder
fm@2327
    19
		lastNameSpace pasteOriginalEnableHolder ignoreCaseHolder
fm@2327
    20
		closeSearchBar searchTextModifiedHolder searchNextText
fm@2327
    21
		searchBarImageInfoLabelHolder searchPreviousText searchBoxVisible
fm@2327
    22
		searchBarInfoLabelHolder searchTextHolder searchTextView
cg@3286
    23
		searchBoxView translationsPanel lastPackage methodsUsingKey'
cg@2032
    24
	classVariableNames:'LastExtractedClass LastExtractedApplicationClass
cg@2410
    25
		LastExtractedProject LastProject'
cg@2015
    26
	poolDictionaries:''
cg@2015
    27
	category:'Interface-UIPainter'
cg@2015
    28
!
cg@2015
    29
cg@2015
    30
Object subclass:#AccessCollectingPseudoResourcePack
cg@3286
    31
	instanceVariableNames:'collectedKeys realResourcePack watchingTranslationEditor'
cg@2015
    32
	classVariableNames:''
cg@2015
    33
	poolDictionaries:''
cg@2015
    34
	privateIn:InternationalLanguageTranslationEditor
cg@2015
    35
!
cg@2015
    36
cg@2015
    37
Collection subclass:#KeyStringsToLanguageMappings
cg@2032
    38
	instanceVariableNames:'keys keyInfo perLanguageInfo perLanguageMappings languageMappings
fm@2049
    39
		languages rowPerKey'
cg@2015
    40
	classVariableNames:''
cg@2015
    41
	poolDictionaries:''
cg@2015
    42
	privateIn:InternationalLanguageTranslationEditor
cg@2015
    43
!
cg@2015
    44
cg@2015
    45
Object subclass:#LanguageMappingRow
cg@2015
    46
	instanceVariableNames:'key mappings'
cg@2015
    47
	classVariableNames:''
cg@2015
    48
	poolDictionaries:''
cg@2015
    49
	privateIn:InternationalLanguageTranslationEditor
cg@2015
    50
!
cg@2015
    51
cg@2015
    52
Visitor subclass:#UISpecVisitor
cg@2015
    53
	instanceVariableNames:'translatedLabels'
cg@2015
    54
	classVariableNames:''
cg@2015
    55
	poolDictionaries:''
cg@2015
    56
	privateIn:InternationalLanguageTranslationEditor
cg@2015
    57
!
cg@2015
    58
cg@2015
    59
!InternationalLanguageTranslationEditor class methodsFor:'documentation'!
cg@2015
    60
cg@2015
    61
documentation
cg@2015
    62
"
cg@2015
    63
    documentation to be added.
cg@2015
    64
cg@2015
    65
    [author:]
cg@2434
    66
	cg (cg@FUSI)
cg@2015
    67
cg@2015
    68
    [instance variables:]
cg@2015
    69
cg@2015
    70
    [class variables:]
cg@2015
    71
cg@2015
    72
    [see also:]
cg@2015
    73
cg@2015
    74
"
cg@2015
    75
!
cg@2015
    76
cg@2015
    77
examples
cg@2015
    78
"
cg@2015
    79
  Starting the application:
cg@2434
    80
								[exBegin]
cg@2015
    81
    InternationalLanguageTranslationEditor open
cg@2015
    82
cg@2434
    83
								[exEnd]
cg@2015
    84
cg@2015
    85
  more examples to be added:
cg@2434
    86
								[exBegin]
cg@2434
    87
    ... add code fragment for
cg@2015
    88
    ... executable example here ...
cg@2434
    89
								[exEnd]
cg@2015
    90
"
cg@2015
    91
!
cg@2015
    92
cg@2015
    93
history
cg@2015
    94
    "Created: / 04-03-2006 / 09:07:19 / cg"
cg@2015
    95
! !
cg@2015
    96
cg@3286
    97
!InternationalLanguageTranslationEditor class methodsFor:'help spec'!
cg@3286
    98
cg@3286
    99
flyByHelpSpec
cg@3286
   100
    <resource: #help>
cg@3286
   101
cg@3286
   102
    ^ super flyByHelpSpec addPairsFrom:#(
cg@3286
   103
cg@3286
   104
#searchBox
cg@3286
   105
'Show a search box at the bottom to search for substrings in the string keys'
cg@3286
   106
cg@3286
   107
#browseReferringMethods
cg@3286
   108
'Browse methods which refer to this string'
cg@3286
   109
cg@3286
   110
)
cg@3286
   111
! !
cg@3286
   112
cg@3286
   113
!InternationalLanguageTranslationEditor class methodsFor:'help specs'!
cg@3286
   114
cg@3286
   115
helpSpec
cg@3286
   116
    "This resource specification was automatically generated
cg@3286
   117
     by the UIHelpTool of ST/X."
cg@3286
   118
cg@3286
   119
    "Do not manually edit this!! If it is corrupted,
cg@3286
   120
     the UIHelpTool may not be able to read the specification."
cg@3286
   121
cg@3286
   122
    "
cg@3286
   123
     UIHelpTool openOnClass:Tools::InternationalLanguageTranslationEditor    
cg@3286
   124
    "
cg@3286
   125
cg@3286
   126
    <resource: #help>
cg@3286
   127
cg@3286
   128
    ^ super helpSpec addPairsFrom:#(
cg@3286
   129
cg@3286
   130
#searchBox
cg@3286
   131
''
cg@3286
   132
cg@3286
   133
)
cg@3286
   134
! !
cg@3286
   135
fm@2327
   136
!InternationalLanguageTranslationEditor class methodsFor:'image specs'!
fm@2327
   137
fm@2327
   138
closeSearchBarIcon
fm@2327
   139
    "This resource specification was automatically generated
fm@2327
   140
     by the ImageEditor of ST/X."
fm@2327
   141
fm@2327
   142
    "Do not manually edit this!! If it is corrupted,
fm@2327
   143
     the ImageEditor may not be able to read the specification."
fm@2327
   144
fm@2327
   145
    "
fm@2327
   146
     self closeSearchBar inspect
fm@2327
   147
     ImageEditor openOnClass:self andSelector:#closeSearchBar
fm@2327
   148
     Icon flushCachedIcons
fm@2327
   149
    "
fm@2327
   150
fm@2327
   151
    <resource: #image>
fm@2327
   152
fm@2327
   153
    ^Icon
cg@2434
   154
	constantNamed:#'Psiware::SystemManagement class closeSearchBar'
cg@2434
   155
	ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
fm@2327
   156
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@GQ\SD1LSD1LSD1LSD1LWGP@@@@@@
fm@2327
   157
@ATGA@HA@PDA@PDA@PHDA1T@@@@@@@@TAENG!!(VB XA?_''57QPPT@@@@@@@@E NJ^V)&X%)UTT5IV7 KE @@@@@@@A A"7Q,#&9VS%^MQ$E<DQ @@@@@@@@Z
fm@2327
   158
@X%-#9NRX52R$80:^1@Z@@@@@@@@F0FHY6>R$9JR$9ION''(PF0@@@@@@@A<A 5ABT)FS$9D=KR13C1<@@@@@@@@)@WUCND*Q$9NQM"T!!XP8)@@@@@@@@K E2
fm@2327
   159
O4RQ$9FQ$9@2G%8JK @@@@@@@CLA\S2D$9D9M)BS]!!1]BSL@@@@@@@@7@W@5LXP6J2\2]"P"VP 7@@@@@@@@O U+R3@*I2T#HA0&N5 RO @@@@@@@D LPF%(
fm@2327
   160
YVQ W59]VU 4CD @@@@@@@AGFP4F@PDA@PDA@PDFCQ%G@@@@@@@@K41TUEQTUEQTUEQTUEQLK0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   161
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 167 25 15 170 49 40 171 50 39 174 68 60 176 56 48 176 58 49 183 118 110 184 45 32 184 46 32 184 47 34 184 71 58 184 85 78 184 86 79 185 53 39 186 57 42 186 59 43 186 60 45 186 68 58 190 187 180 192 188 181 193 189 182 194 190 183 195 192 184 197 194 186 202 148 142 202 199 191 205 202 195 207 64 48 207 203 195 208 65 49 208 205 198 209 65 49 209 66 49 209 69 52 210 66 49 210 78 64 211 67 51 211 71 54 212 69 51 212 208 200 212 208 202 213 69 52 213 70 52 213 79 57 215 80 59 215 212 206 217 214 207 218 79 62 218 84 67 219 107 95 219 216 210 221 84 63 221 84 67 221 109 96 221 218 213 222 76 56 222 110 96 222 113 79 223 87 67 223 87 70 223 115 99 224 221 216 225 89 72 225 105 91 225 117 84 227 89 64 227 91 73 227 112 98 227 115 95 227 122 92 227 224 219 227 225 219 228 113 83 228 113 99 229 102 87 229 226 221 230 115 84 230 117 81 230 142 117 231 102 80 231 116 86 231 120 103 231 131 119 231 228 224 232 118 88 232 119 82 233 143 117 234 99 76 234 102 79 234 119 89 234 127 100 234 145 119 235 104 82 235 106 86 236 108 89 236 110 92 236 113 92 236 121 91 236 146 119 237 113 95 237 115 98 237 122 92 237 132 100 238 117 101 238 119 104 238 123 93 238 123 109 238 131 98 238 133 102 238 146 120 238 148 121 239 125 112 239 127 115 239 129 118 239 131 105 239 134 102 240 135 122 240 200 196 242 135 113 242 141 116 242 141 119 242 145 116 242 147 118 242 148 120 243 137 115 243 138 118 243 141 121 243 142 123 243 144 126 243 145 129 243 151 134 243 202 197 244 147 132 244 149 135 244 152 137 244 163 142 244 164 145 245 160 143 245 164 146 245 213 204 246 213 203 248 215 205 249 215 206 252 244 243 253 244 243 253 247 245 255 255 255]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@G?? G?? G?? G?? G?? G?? G?? G?? G?? G?? G?? G?? G?? G?? G?? G?? @@@@@@@@@@@@') ; yourself); yourself]
fm@2327
   162
fm@2327
   163
    "Created: / 15-06-2007 / 18:04:38 / Administrador"
fm@2327
   164
!
fm@2327
   165
fm@2327
   166
restartSearchBarIcon
fm@2327
   167
    "This resource specification was automatically generated
fm@2327
   168
     by the ImageEditor of ST/X."
fm@2327
   169
fm@2327
   170
    "Do not manually edit this!! If it is corrupted,
fm@2327
   171
     the ImageEditor may not be able to read the specification."
fm@2327
   172
fm@2327
   173
    "
fm@2327
   174
     self restartSearchBarIcon inspect
fm@2327
   175
     ImageEditor openOnClass:self andSelector:#restartSearchBarIcon
fm@2327
   176
     Icon flushCachedIcons
fm@2327
   177
    "
fm@2327
   178
fm@2327
   179
    <resource: #image>
fm@2327
   180
fm@2327
   181
    ^Icon
cg@2434
   182
	constantNamed:#'Psiware::SystemManagement class restartSearchBarIcon'
cg@2434
   183
	ifAbsentPut:[(Depth24Image new) width: 20; height: 20; photometric:(#rgb); bitsPerSample:(#[8 8 8]); samplesPerPixel:(3); bits:(ByteArray fromPackedString:'
fm@2327
   184
@@@@@@@@@@@@@@@@@@@@@@@@?>SX?>''V?>;)?>O!!?>G]?>WY@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?=3\:[>''5;JF/Y-.+XY),(U.
fm@2327
   185
6JZK?=J1?>V<>.+I@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?>?'':+:!!19]U6*-Q?]Y/?>RC?>*!!?>F_>+=939UL2Y!!L>MJT??W[@@@@@@@@@@@@@@@@@@@@
fm@2327
   186
@@@@??[-=\^&1IEP=<Q[?>1/?=5$?=52?>NT?=^Q?>BP?>FG>;1]6JEO8;^H?]3I@@@@@@@@@@@@@@@@@@@@?\*95Y-)<+!!$??.F?>)17+-U8,E40Y-.09I)
fm@2327
   187
:Z1-?=I??=)8?<1.>K597;NL??K,@@@@@@@@@@@@?=#M6I>B>+:@?>2U=,]]5[IN7,^C5LB[<MWL?]#O=,BZ7)=\>;Y[??FP?=>O1YEW8<B$;=WH@@@@@@@@
fm@2327
   188
>,"%8Z:A?>N#?>._5KA$9-JW7=+FX6M+V%U3"''*T0Y>V4ZA7595T=;1"?=&D?=&L,W(93IU\:KE9=LBG9[Q9;K1<?=^R:K591*-6??''[@@@@RE%37>7?=?/?
fm@2327
   189
>^_''3*.M0YAU<K5,?>ZO?=>G?<!!6?<Y6>+U(69YI3:IG?=Z@?>NU5:=19,6%@@@@@@@@OU5*2.+7;O??5-KF2;JS?=*&?>&"?=.E?>2R?=&F?>"X8I-N5)ED
fm@2327
   190
29$&?>M:?=*F3:E&>]/A@@@@@@@@O5=.7O??5^/(?O++<M.>0I-/;LNE??2)?=&B?>^%,W)A8:14?=FX3)TR?>U/?=Q:3IAZ?=?T@@@@@@@@P5Y68_#?7.70
fm@2327
   191
??[1??C_:,F%6;A=>MJA?>6":,6+&G91?>+^?>+]79<$?<1\?=:C5IM[?<;F@@@@@@@@Q$1>6N_?<?+?<.W.?>3*??S(=,.(2Z!!#=-:^+9>P4,[P<>''46=O^
fm@2327
   192
=+MX;Z)O?>^Q:Z]*;+Z''@@@@@@@@TD:O9^/?;/C??>???>/:?>71?>7Z;]^%0+JA7=CI8]O"0+[D8=#&?<&V79="?=2L?\E88[BG@@@@@@@@VU&M=_3?9N''?
fm@2327
   193
>/C???K??NK/??[1???#9M?B??3;(IV#/[WD;^_5@@@@;KR]<[10?=Q68[9,8,>W@@@@TU9&;/??9__9:.;/?_#<??/?>?[==?79>_?=<_S9T5M[0,WN7^G*
fm@2327
   194
@@@@@@@@1Y= >=!!>9,]-3[],6]B''TEH=;O_''=O?6>O77>O''=>//?=_+?:O_?:_''?>O??SEM[/<[P6.O,@@@@@@@@8-F%1*%/9[>@?>R(7+VG_%,;\E]CW$=H
fm@2327
   195
U5AWV5%.U5);R5M:Q5M;S%-=TE]*[GI>):696M;*@@@@@@@@@@@@6\F[2Y914)9.;[VF?L"!!8[^_3J>''0KB:0;?V0,_''-<C),K/(,;7!!+[OI,K[D2=G_9N+8
fm@2327
   196
@@@@@@@@@@@@@@@@@@@@?\*_7*]>3))5/II9+9FF+9> 0;7I5-#-7NO?7^#?8^/?:/G?7NK07>W3@@@@@@@@@@@@@@@@@@@@@@@@?>N;?>N;?=:9?>7T?>#X
fm@2327
   197
>^_%=N?6<OK?@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; mask:((Depth1Image new) width: 20; height: 20; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@?@OC?0OO?8O_?<O_?>O???O?????_??>_??>_??>_??>_??>_??>_??__??O???O???G???A??/A? O') ; yourself); yourself]
fm@2327
   198
!
fm@2327
   199
fm@2327
   200
searchNextIcon
fm@2327
   201
    "This resource specification was automatically generated
fm@2327
   202
     by the ImageEditor of ST/X."
fm@2327
   203
fm@2327
   204
    "Do not manually edit this!! If it is corrupted,
fm@2327
   205
     the ImageEditor may not be able to read the specification."
fm@2327
   206
fm@2327
   207
    "
fm@2327
   208
     self searchNextIcon inspect
fm@2327
   209
     ImageEditor openOnClass:self andSelector:#searchNextIcon
fm@2327
   210
     Icon flushCachedIcons
fm@2327
   211
    "
fm@2327
   212
fm@2327
   213
    <resource: #image>
fm@2327
   214
fm@2327
   215
    ^Icon
cg@2434
   216
	constantNamed:#'Psiware::SystemManagement class searchNextIcon'
cg@2434
   217
	ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
fm@2327
   218
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ZE)ZZ@@@@@@@@@@@@@@@
fm@2327
   219
@@@@@@AFF XA@PXUQ @@@@@@@@@@@@@@@@@*@Q5G^WX6E0D*@@@@@@@@@@@@@@@,AVQ?\&1#W&X8@20@@@@@@@@@@@A[@U==\F-"VUQOUSLAV0@@@@@@@@@@
fm@2327
   220
G19-D <NCP0KB!!@7D1<@@@@@@@@@  ]MT5JY&Y&Y&Y%RLR4G  @@@@@@@H\A WL $)&Y&Y&RF35B@X\@@@@@@@BK@XA1WA"X&Y&XE#T:P@FK@@@@@@@@# !!H
fm@2327
   221
]F$<II&YH3H>N2 H# @@@@@@@@@''GG)*Y2$9NRIDO4DQHP@@@@@@@@@@!!@EP[6U]I"UIQTL.@XP@@@@@@@@@@@ALAD-.XE]VS$(/@$0@@@@@@@@@@@@@@EDA
fm@2327
   222
FSQ!!VC@T@UD@@@@@@@@@@@@@@@@@#R,I@PDIJ84@@@@@@@@@@@@@@@@@@@@@%)^W% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   223
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 48 54 77 55 63 87 56 64 89 57 67 90 59 67 90 64 69 89 71 74 92 72 76 96 76 81 100 80 89 118 82 90 119 83 91 120 84 92 122 86 94 123 87 96 124 89 97 126 92 104 132 97 106 136 97 110 138 97 112 138 100 102 112 101 107 130 104 118 144 105 113 135 105 124 146 107 109 118 107 116 144 110 127 148 112 126 148 113 129 148 117 119 129 118 130 156 119 123 133 125 140 174 127 131 146 127 132 148 127 146 178 130 151 181 131 132 143 133 149 185 133 152 182 134 134 138 137 140 150 138 138 142 139 156 191 141 160 195 143 164 199 143 169 198 144 157 197 144 158 197 152 173 208 153 184 209 155 167 210 156 180 208 157 179 215 157 180 211 160 162 171 160 173 216 160 174 216 160 182 214 161 173 217 161 174 217 161 176 219 161 179 220 161 180 220 163 182 222 163 184 222 164 182 222 164 184 223 166 164 161 166 189 212 166 194 211 167 190 228 167 194 229 167 200 221 169 170 174 169 195 212 169 196 232 170 181 228 170 203 221 171 171 176 171 173 182 171 193 220 173 182 232 173 192 232 173 200 234 175 206 239 175 210 240 176 188 237 178 175 168 178 175 173 178 202 234 178 206 240 179 195 238 180 205 223 180 214 243 180 216 244 181 193 242 181 195 239 181 204 223 181 212 243 182 206 242 182 209 243 184 180 173 184 211 244 184 215 245 185 198 246 185 200 244 188 215 233 188 225 249 189 226 249 190 206 250 190 219 248 191 209 249 191 217 248 191 222 248 192 188 181 192 221 249 194 190 184 195 191 184 196 226 251 196 232 251 199 196 189 202 198 191 202 226 253 203 199 193 203 229 253 203 237 252 203 237 253 204 202 196 206 202 195 206 205 204 207 203 196 208 204 197 208 205 201 212 208 200 212 208 201 212 208 202 212 209 205 213 210 202 213 212 213 214 211 206 215 212 207 216 213 206 218 215 210 220 221 223 221 219 214 222 219 215 222 220 215 230 228 225 236 235 232 243 243 244 255 255 255]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@C@@@C@@@C@G C@_8C@?<CA?>CC??CC??CG??#G??#G??#G??#C??CC??CA?>C@?<C@_8C@G C@@@C@@@C@@@C') ; yourself); yourself]
fm@2327
   224
!
fm@2327
   225
fm@2327
   226
searchPreviousIcon
fm@2327
   227
    "This resource specification was automatically generated
fm@2327
   228
     by the ImageEditor of ST/X."
fm@2327
   229
fm@2327
   230
    "Do not manually edit this!! If it is corrupted,
fm@2327
   231
     the ImageEditor may not be able to read the specification."
fm@2327
   232
fm@2327
   233
    "
fm@2327
   234
     self searchPreviousIcon inspect
fm@2327
   235
     ImageEditor openOnClass:self andSelector:#searchPreviousIcon
fm@2327
   236
     Icon flushCachedIcons
fm@2327
   237
    "
fm@2327
   238
fm@2327
   239
    <resource: #image>
fm@2327
   240
fm@2327
   241
    ^Icon
cg@2434
   242
	constantNamed:#'Psiware::SystemManagement class searchPreviousIcon'
cg@2434
   243
	ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
fm@2327
   244
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%)^W% @@@@@@@@@@@@@@
fm@2327
   245
@@@@@@BMJ0$A@P$+#P@@@@@@@@@@@@@@@@AQ@Q$4XU 0E@EQ@@@@@@@@@@@@@@ALAD-.XE]VS$(/@$0@@@@@@@@@@@BD@UA/YU4&IT%EP28A!!@@@@@@@@@@@
fm@2327
   246
I11:Z&\)NS$"QC=ADRD@@@@@@@@@# !!H]F$<II&YH3H>N2 H# @@@@@@@H,A GE\FI"Y&Y VMS)@@X,@@@@@@@BG@XE3HIJY&Y&Y$!!,=P FG@@@@@@@@  ]M
fm@2327
   247
T5JY&Y&Y&Y%RLR4G  @@@@@@@@@_G&4RC08MC@,JDC\SG0@@@@@@@@@@V0E__WA+X%%TS5T3@U,@@@@@@@@@@@@,AVQ?\&1#W&X8@20@@@@@@@@@@@@@@B(A
fm@2327
   248
GT]9]#XW@R(@@@@@@@@@@@@@@@@@Q!!(F@PDFETX@@@@@@@@@@@@@@@@@@@@@ZE)ZZ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   249
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 48 54 77 55 63 87 56 64 89 57 67 90 59 67 90 64 69 89 71 74 92 72 76 96 76 81 100 80 89 118 82 90 119 83 91 120 84 92 122 86 94 123 87 96 124 89 97 126 92 104 132 97 106 136 97 110 138 97 112 138 100 102 112 101 107 130 104 118 144 105 113 135 105 124 146 107 109 118 107 116 144 110 127 148 112 126 148 113 129 148 117 119 129 118 130 156 119 123 133 125 140 174 127 131 146 127 132 148 127 146 178 130 151 181 131 132 143 133 149 185 133 152 182 134 134 138 137 140 150 138 138 142 139 156 191 141 160 195 143 164 199 143 169 198 144 157 197 144 158 197 152 173 208 153 184 209 155 167 210 156 180 208 157 179 215 157 180 211 160 162 171 160 173 216 160 174 216 160 182 214 161 173 217 161 174 217 161 176 219 161 179 220 161 180 220 163 182 222 163 184 222 164 182 222 164 184 223 166 164 161 166 189 212 166 194 211 167 190 228 167 194 229 167 200 221 169 170 174 169 195 212 169 196 232 170 181 228 170 203 221 171 171 176 171 173 182 171 193 220 173 182 232 173 192 232 173 200 234 175 206 239 175 210 240 176 188 237 178 175 168 178 175 173 178 202 234 178 206 240 179 195 238 180 205 223 180 214 243 180 216 244 181 193 242 181 195 239 181 204 223 181 212 243 182 206 242 182 209 243 184 180 173 184 211 244 184 215 245 185 198 246 185 200 244 188 215 233 188 225 249 189 226 249 190 206 250 190 219 248 191 209 249 191 217 248 191 222 248 192 188 181 192 221 249 194 190 184 195 191 184 196 226 251 196 232 251 199 196 189 202 198 191 202 226 253 203 199 193 203 229 253 203 237 252 203 237 253 204 202 196 206 202 195 206 205 204 207 203 196 208 204 197 208 205 201 212 208 200 212 208 201 212 208 202 212 209 205 213 210 202 213 212 213 214 211 206 215 212 207 216 213 206 218 215 210 220 221 223 221 219 214 222 219 215 222 220 215 230 228 225 236 235 232 243 243 244 255 255 255]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@C@@@C@@@C@G C@_8C@?<CA?>CC??CC??CG??#G??#G??#G??#C??CC??CA?>C@?<C@_8C@G C@@@C@@@C@@@C') ; yourself); yourself]
fm@2327
   250
!
fm@2327
   251
fm@2327
   252
searchToolBarIcon
fm@2327
   253
    "This resource specification was automatically generated
fm@2327
   254
     by the ImageEditor of ST/X."
fm@2327
   255
fm@2327
   256
    "Do not manually edit this!! If it is corrupted,
fm@2327
   257
     the ImageEditor may not be able to read the specification."
fm@2327
   258
fm@2327
   259
    "
fm@2327
   260
     self searchToolBarIcon inspect
fm@2327
   261
     ImageEditor openOnClass:self andSelector:#searchToolBarIcon
fm@2327
   262
     Icon flushCachedIcons
fm@2327
   263
    "
fm@2327
   264
fm@2327
   265
    <resource: #image>
fm@2327
   266
fm@2327
   267
    ^Icon
cg@2434
   268
	constantNamed:#'Psiware::SystemManagement class searchToolBarIcon'
cg@2434
   269
	ifAbsentPut:[(Depth24Image new) width: 22; height: 22; photometric:(#rgb); bitsPerSample:(#[8 8 8]); samplesPerPixel:(3); bits:(ByteArray fromPackedString:'
fm@2327
   270
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   271
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   272
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@4][>4][>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   273
@@@@@@@@@@@@@@@@@@@@@@@@@@@@;>#8/L#+!!:KS!!:KS/,'',;>''9@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@2];>^)WH
fm@2327
   274
NE:+KU*:J5&9NE6*_I#K4^S>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@4][>RV3DLER"SWR6$K#0#;[.SGJ4L5"''UG_N4][>@@@@
fm@2327
   275
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*K''\JT*,U6Z7:^S?>/C*;.3,6>C>RFF(KEZ"3-_-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   276
@@@@@@@@@@@@&Z''HFTF &Z7">N#:7NK?7NK?6=W>!!Y''YH4N -+3T@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%I>;FDV)#ZWU??''57NK?
fm@2327
   277
7NK?:>_?\8WKFCN".K#T@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@1L;.A#V[O5")3=W;=/[4</W:1,??K$JVI4Z\7-''4@@@@@@@@@@@@
fm@2327
   278
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7NK?-,[1E#:&C"ZZH3F U6_EU63FHS^XHS.K JOX7-''4@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7NK?
fm@2327
   279
,K_*O5ZTCRBLPU&0FCBHDB&RDR6RH$NI Y#I4][>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7NK?-;#%ND&KC">BYV.*4=;>7.+>-<K!!,K/!!7NK?
fm@2327
   280
:^C;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7NK?/K3^PT%<CBI/NE>==O;8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   281
@@@@@@@@@@@@7NK? (J9GB1SZV>W:M3?@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@5MS&++3H6M/#@@@@
fm@2327
   282
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7NK?@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   283
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   284
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   285
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   286
@@@@@@@@@@@@@@@@') ; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@C@@@C@@@C@A C@G8C@O<C@_>C@_>C@_>C@_>C@_>C@?>CA?<CC?8CG8@CG0@CC @CA@@C@@@C@@@C@@@C@@@C') ; yourself); yourself]
fm@2327
   287
!
fm@2327
   288
fm@2327
   289
warningSearchBarIcon
fm@2327
   290
    "This resource specification was automatically generated
fm@2327
   291
     by the ImageEditor of ST/X."
fm@2327
   292
fm@2327
   293
    "Do not manually edit this!! If it is corrupted,
fm@2327
   294
     the ImageEditor may not be able to read the specification."
fm@2327
   295
fm@2327
   296
    "
fm@2327
   297
     self warningSearchBarIcon inspect
fm@2327
   298
     ImageEditor openOnClass:self andSelector:#warningSearchBarIcon
fm@2327
   299
     Icon flushCachedIcons
fm@2327
   300
    "
fm@2327
   301
fm@2327
   302
    <resource: #image>
fm@2327
   303
fm@2327
   304
    ^Icon
cg@2434
   305
	constantNamed:#'Psiware::SystemManagement class warningSearchBarIcon'
cg@2434
   306
	ifAbsentPut:[(Depth24Image new) width: 22; height: 19; photometric:(#rgb); bitsPerSample:(#[8 8 8]); samplesPerPixel:(3); bits:(ByteArray fromPackedString:'
fm@2327
   307
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?:.+<Y"P??C\@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@>_;?@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   308
@@@@?]SZ)5]X.6!! -HM2??''*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?>39-7*B4H&G>[N+%%MJ>\#A@@@@@@@@
fm@2327
   309
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<+R?*U1&?=CN?>W^4HJ@+FY$?>+"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   310
@@@@@@@@@@@@@@@@@@@@?>G_)U!!^>Z^->,B><+"4?*^-%C8?;;Z+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@??#1-(E;.65+?<#H
fm@2327
   311
?=_T?=GP?::65W-=(EQF?>WQ@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?\#D*VAY?;61<;"0;,C@6J^+;*"0>ZN$&CX)6(-:@@@@@@@@
fm@2327
   312
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?>#+/7Q148E6?<"4<L&:W#(:G@@@392!!48^G9WM(%24_?=WN@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fm@2327
   313
??C?7Y&$.E5\?;V*=<:8??K_R3X5DP@@4+R49ZZ!!7VIZ/#85)%UR??G/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@?=7.2&)6=IJQ?;..=]W@??7*PS$7E@,N
fm@2327
   314
4<OC?>K^>(M=1S8;)$ID8Y6^@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;HNR4U%%<)&S?<^9??_(??;3REEN@P,J2<[C??K/?:R!!/C8?&R(0(T-N?>GZ@@@@
fm@2327
   315
@@@@@@@@@@@@@@@@@@@@?<;H,31B3T9U2'')1?L3@?>3&=^7*XWE0@@<M7=;\??S3?=_U46-,#Q(!!$B,/18"A@@@@@@@@@@@@@@@@@@@@??G&1G!!*,S03)SP,
fm@2327
   316
3()?>=WL??_:<>33[G:@D2T%;^/,??#8??K19Y6^&R(0!!QPX#S8:;K22@@@@@@@@@@@@@@@@<*RZ+5I@*$D+*T48<[N&?>C_7,+U??3?7N''/(J.-?/+;??W5
fm@2327
   317
;.O!!?>G_3&]+ 0(O#B8.(U9X@@@@@@@@@@@@?<?Y/%MM.487%$P^7I)7?<&=?=+ <^W3;?C?YV]3JR .-*60=/W35.[#<>W"?:*+*3@3$R\)^R ''2)^T@@@@
fm@2327
   318
?>K2;(ZO2DQ@-SP!!,5H/?<F!!?<V=?;3B?=_"?>7:)72EUBT+<,GD?>?,<M;Z>]GO?<#J8VM& P4P_A0^ C(:?>+''?:"+34%H13L/02("13T(13\,5$H>3S<=
fm@2327
   319
1TMC0DQD/$IB/D@>.S4;-S,8,C(:,C 9-3X:(A4""@4R_1DT RH&/6%*?82D/S8503873C<85C<923H,23@+/RP\-"HX,"HW+"DX*"@V)10U)1(S)!!XU)AXU
fm@2327
   320
(Q0_$1XZ#1X["A(]^QPX&34>?;&).&-Z/6]Y06MU1&AR/5UG15-N0EYF1&EO0&EN/&EP.6AN.%5N.5-M.5%P/UYQ.$)I.4)L0UQW/U-\+5YX5XFA') ; mask:((Depth1Image new) width: 22; height: 19; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@C G@G0C@O0C@O8C@_8C@?<C@?<CA?>CC??CC??CC??#G??#O??3O??3_??;????????????????') ; yourself); yourself]
fm@2327
   321
! !
fm@2327
   322
cg@2015
   323
!InternationalLanguageTranslationEditor class methodsFor:'interface specs'!
cg@2015
   324
cg@2015
   325
windowSpec
cg@2015
   326
    "This resource specification was automatically generated
cg@2015
   327
     by the UIPainter of ST/X."
cg@2015
   328
cg@2015
   329
    "Do not manually edit this!! If it is corrupted,
cg@2015
   330
     the UIPainter may not be able to read the specification."
cg@2015
   331
cg@2015
   332
    "
cg@2048
   333
     UIPainter new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#windowSpec
cg@2048
   334
     Tools::InternationalLanguageTranslationEditor new openInterface:#windowSpec
cg@2048
   335
     Tools::InternationalLanguageTranslationEditor open
cg@2015
   336
    "
cg@2015
   337
cg@2015
   338
    <resource: #canvas>
cg@2015
   339
sv@3245
   340
    ^ 
sv@3245
   341
    #(FullSpec
sv@3245
   342
       name: windowSpec
sv@3245
   343
       window: 
sv@3245
   344
      (WindowSpec
sv@3245
   345
         label: 'InternationalLanguageTranslationEditor'
sv@3245
   346
         name: 'InternationalLanguageTranslationEditor'
sv@3245
   347
         min: (Point 10 10)
sv@3245
   348
         bounds: (Rectangle 0 0 774 610)
sv@3245
   349
         menu: mainMenu
sv@3245
   350
       )
sv@3245
   351
       component: 
sv@3245
   352
      (SpecCollection
sv@3245
   353
         collection: (
sv@3245
   354
          (MenuPanelSpec
sv@3245
   355
             name: 'ToolBar'
sv@3245
   356
             layout: (LayoutFrame 0 0 0 0 0 1 30 0)
sv@3245
   357
             menu: menuToolBar
sv@3245
   358
             textDefault: true
sv@3245
   359
           )
sv@3245
   360
          (VariableVerticalPanelSpec
sv@3245
   361
             name: 'TranslationsVariableVerticalPanel'
sv@3245
   362
             layout: (LayoutFrame 0 0 30 0 0 1 -32 1)
sv@3245
   363
             component: 
sv@3245
   364
            (SpecCollection
sv@3245
   365
               collection: (
sv@3245
   366
                (DataSetSpec
sv@3245
   367
                   name: 'KeyStringAndLanguageSelectionTable'
sv@3245
   368
                   model: selectedKeyRow
sv@3245
   369
                   menu: keyStringAndLanguageSelectionTableMenu
sv@3245
   370
                   hasHorizontalScrollBar: true
sv@3245
   371
                   hasVerticalScrollBar: true
sv@3245
   372
                   dataList: keyStringAndLanguageSelectionTable
sv@3245
   373
                   columnHolder: keyStringAndLanguageSelectionTableColumnDescriptionHolder
sv@3245
   374
                   beDependentOfRows: true
sv@3245
   375
                   columnAdaptor: yourself
sv@3245
   376
                   postBuildCallback: postBuildDataSet:
sv@3245
   377
                 )
sv@3245
   378
                (VariableVerticalPanelSpec
sv@3245
   379
                   name: 'VariableVerticalPanel1'
sv@3245
   380
                   component: 
sv@3245
   381
                  (SpecCollection
sv@3245
   382
                     collection: (
sv@3245
   383
                      (ViewSpec
sv@3245
   384
                         name: 'Box1'
sv@3245
   385
                         component: 
sv@3245
   386
                        (SpecCollection
sv@3245
   387
                           collection: (
sv@3245
   388
                            (LabelSpec
sv@3245
   389
                               label: 'Original String (Key):'
sv@3245
   390
                               name: 'Label2'
sv@3245
   391
                               layout: (LayoutFrame 0 0 -2 0 0 1 28 0)
sv@3245
   392
                               translateLabel: true
sv@3245
   393
                               adjust: left
sv@3245
   394
                             )
sv@3245
   395
                            (TextEditorSpec
sv@3245
   396
                               name: 'OriginalText'
sv@3245
   397
                               layout: (LayoutFrame 0 0 27 0 0 1 -2 1)
sv@3245
   398
                               model: originalTextHolder
sv@3245
   399
                               hasHorizontalScrollBar: true
sv@3245
   400
                               hasVerticalScrollBar: true
sv@3245
   401
                               modifiedChannel: originalTextModifiedHolder
sv@3245
   402
                               acceptCallBack: languageTextAccepted
sv@3245
   403
                               hasKeyboardFocusInitially: false
sv@3245
   404
                             )
sv@3245
   405
                            )
sv@3245
   406
                          
sv@3245
   407
                         )
sv@3245
   408
                       )
sv@3245
   409
                      (ViewSpec
sv@3245
   410
                         name: 'Box3'
sv@3245
   411
                         component: 
sv@3245
   412
                        (SpecCollection
sv@3245
   413
                           collection: (
sv@3245
   414
                            (LabelSpec
sv@3245
   415
                               label: 'Select Another Language as example:'
sv@3245
   416
                               name: 'Label3'
sv@3245
   417
                               layout: (LayoutFrame 0 0 -6 0 0 1 24 0)
sv@3245
   418
                               translateLabel: true
sv@3245
   419
                               adjust: left
sv@3245
   420
                             )
sv@3245
   421
                            (ComboBoxSpec
sv@3245
   422
                               name: 'ComboBox1'
sv@3245
   423
                               layout: (LayoutFrame 281 0 -2 0 406 0 18 0)
sv@3245
   424
                               model: exampleLanguageSelectionHolder
sv@3245
   425
                               immediateAccept: false
sv@3245
   426
                               acceptOnLeave: true
sv@3245
   427
                               acceptOnLostFocus: true
sv@3245
   428
                               acceptOnPointerLeave: false
sv@3245
   429
                               comboList: shownLanguages
sv@3245
   430
                               useIndex: false
sv@3245
   431
                             )
sv@3245
   432
                            (TextEditorSpec
sv@3245
   433
                               name: 'ExampleLanguageText'
sv@3245
   434
                               layout: (LayoutFrame 0 0 30 0 0 1 0 1)
sv@3245
   435
                               model: exampleLanguageTextHolder
sv@3245
   436
                               hasHorizontalScrollBar: true
sv@3245
   437
                               hasVerticalScrollBar: true
sv@3245
   438
                               isReadOnly: true
sv@3245
   439
                               hasKeyboardFocusInitially: false
sv@3245
   440
                             )
sv@3245
   441
                            )
sv@3245
   442
                          
sv@3245
   443
                         )
sv@3245
   444
                       )
sv@3245
   445
                      (ViewSpec
sv@3245
   446
                         name: 'Box2'
sv@3245
   447
                         component: 
sv@3245
   448
                        (SpecCollection
sv@3245
   449
                           collection: (
sv@3245
   450
                            (LabelSpec
sv@3245
   451
                               label: 'Translated String:'
sv@3245
   452
                               name: 'Label1'
sv@3245
   453
                               layout: (LayoutFrame 0 0 0 0 0 1 30 0)
sv@3245
   454
                               translateLabel: true
sv@3245
   455
                               adjust: left
sv@3245
   456
                             )
sv@3245
   457
                            (TextEditorSpec
sv@3245
   458
                               name: 'LanguageText'
sv@3245
   459
                               layout: (LayoutFrame 0 0 30 0 0 1 0 1)
sv@3245
   460
                               model: languageTextHolder
sv@3245
   461
                               hasHorizontalScrollBar: true
sv@3245
   462
                               hasVerticalScrollBar: true
sv@3245
   463
                               acceptChannel: languageTextAcceptHolder
sv@3245
   464
                               modifiedChannel: languageTextModifiedHolder
sv@3245
   465
                               acceptCallBack: languageTextAccepted
sv@3245
   466
                               hasKeyboardFocusInitially: false
sv@3245
   467
                               postBuildCallback: languageEditorBuilt:
sv@3245
   468
                             )
sv@3245
   469
                            (ActionButtonSpec
sv@3245
   470
                               label: 'Paste Previous'
sv@3245
   471
                               name: 'pastePreviousTranslation'
sv@3245
   472
                               layout: (LayoutOrigin 0 0.83085250338295003 0 0.034482758620689995)
sv@3245
   473
                               translateLabel: true
sv@3245
   474
                               model: pastePreviousTranslationInLanguageText
sv@3245
   475
                               enableChannel: pastePreviousTranslationEnableHolder
sv@3245
   476
                               disabledLogo: 'Paste Previous'
sv@3245
   477
                             )
sv@3245
   478
                            (ActionButtonSpec
sv@3245
   479
                               label: 'Paste Original'
sv@3245
   480
                               name: 'Button1'
sv@3245
   481
                               layout: (LayoutOrigin -95 0.83085250338295003 0 0.034482758620689995)
sv@3245
   482
                               translateLabel: true
sv@3245
   483
                               model: pasteOriginalInLanguageText
sv@3245
   484
                               enableChannel: pasteOriginalEnableHolder
sv@3245
   485
                               disabledLogo: 'Paste Original'
sv@3245
   486
                             )
sv@3245
   487
                            )
sv@3245
   488
                          
sv@3245
   489
                         )
sv@3245
   490
                       )
sv@3245
   491
                      )
sv@3245
   492
                    
sv@3245
   493
                   )
cg@3286
   494
                   handles: (Any 0.3333333333333301 0.66666666666667018 1.0)
sv@3245
   495
                 )
sv@3245
   496
                )
sv@3245
   497
              
sv@3245
   498
             )
sv@3245
   499
             handles: (Any 0.5 1.0)
sv@3245
   500
             postBuildCallback: postBuildTranslationsPanel:
sv@3245
   501
           )
sv@3245
   502
          (ViewSpec
sv@3245
   503
             name: 'SearchBox'
sv@3245
   504
             layout: (LayoutFrame 0 0 -32 1 0 1 0 1)
sv@3245
   505
             level: -1
sv@3245
   506
             visibilityChannel: searchBoxVisible
sv@3245
   507
             component: 
sv@3245
   508
            (SpecCollection
sv@3245
   509
               collection: (
sv@3245
   510
                (ActionButtonSpec
sv@3245
   511
                   label: 'closeSearchBarIcon'
sv@3245
   512
                   name: 'closeSearchBarButton'
sv@3245
   513
                   layout: (LayoutFrame 4 0 5 0 25 0 26 0)
sv@3245
   514
                   hasCharacterOrientedLabel: false
sv@3245
   515
                   translateLabel: true
sv@3245
   516
                   model: closeSearchBar
sv@3245
   517
                 )
sv@3245
   518
                (LabelSpec
sv@3245
   519
                   label: 'Search:'
sv@3245
   520
                   name: 'SearchLabel'
cg@3286
   521
                   layout: (LayoutFrame 30 0 5 0 100 0 27 0)
sv@3245
   522
                   translateLabel: true
sv@3245
   523
                   adjust: right
sv@3245
   524
                 )
sv@3245
   525
                (InputFieldSpec
sv@3245
   526
                   name: 'SearchEntryField'
cg@3286
   527
                   layout: (LayoutFrame 100 0 5 0 257 0 27 0)
sv@3245
   528
                   model: searchTextHolder
sv@3245
   529
                   immediateAccept: true
sv@3245
   530
                   acceptOnReturn: true
sv@3245
   531
                   acceptOnTab: true
sv@3245
   532
                   acceptOnLostFocus: true
sv@3245
   533
                   modifiedChannel: searchTextModifiedHolder
sv@3245
   534
                   acceptOnPointerLeave: false
sv@3245
   535
                   postBuildCallback: postBuildSearchTextView:
sv@3245
   536
                 )
sv@3245
   537
                (ActionButtonSpec
sv@3245
   538
                   label: 'searchNextIcon'
sv@3245
   539
                   name: 'SearchNextButton'
cg@3286
   540
                   layout: (LayoutFrame 264 0 5 0 285 0 26 0)
sv@3245
   541
                   hasCharacterOrientedLabel: false
sv@3245
   542
                   translateLabel: true
sv@3245
   543
                   model: searchNextText
sv@3245
   544
                 )
sv@3245
   545
                (ActionButtonSpec
sv@3245
   546
                   label: 'searchPreviousIcon'
sv@3245
   547
                   name: 'searchPreviousButton'
cg@3286
   548
                   layout: (LayoutFrame 292 0 5 0 313 0 26 0)
sv@3245
   549
                   hasCharacterOrientedLabel: false
sv@3245
   550
                   translateLabel: true
sv@3245
   551
                   model: searchPreviousText
sv@3245
   552
                 )
sv@3245
   553
                (CheckBoxSpec
sv@3245
   554
                   label: 'Ignore case'
sv@3245
   555
                   name: 'IgnoreCaseCheckBox'
cg@3286
   556
                   layout: (LayoutFrame 322 0 5 0 518 0 27 0)
sv@3245
   557
                   model: ignoreCaseHolder
sv@3245
   558
                   translateLabel: true
sv@3245
   559
                 )
sv@3245
   560
                (LabelSpec
sv@3245
   561
                   label: 'SearchBarImageInfoLabel'
sv@3245
   562
                   name: 'SearchBarImageInfoLabel'
cg@3286
   563
                   layout: (LayoutFrame 524 0 5 0 548 0 27 0)
sv@3245
   564
                   hasCharacterOrientedLabel: false
sv@3245
   565
                   translateLabel: true
sv@3245
   566
                   labelChannel: searchBarImageInfoLabelHolder
sv@3245
   567
                 )
sv@3245
   568
                (LabelSpec
sv@3245
   569
                   label: 'SearchBarInfoLabel'
sv@3245
   570
                   name: 'SearchBarInfoLabel'
cg@3286
   571
                   layout: (LayoutFrame 551 0 5 0 829 0 27 0)
sv@3245
   572
                   translateLabel: true
sv@3245
   573
                   labelChannel: searchBarInfoLabelHolder
sv@3245
   574
                   adjust: left
sv@3245
   575
                 )
sv@3245
   576
                )
sv@3245
   577
              
sv@3245
   578
             )
sv@3245
   579
             postBuildCallback: postBuildSearchBoxView:
sv@3245
   580
           )
sv@3245
   581
          )
sv@3245
   582
        
sv@3245
   583
       )
sv@3245
   584
     )
cg@2015
   585
! !
cg@2015
   586
cg@2015
   587
!InternationalLanguageTranslationEditor class methodsFor:'menu specs'!
cg@2015
   588
fm@2163
   589
keyStringAndLanguageSelectionTableMenu
fm@2163
   590
    "This resource specification was automatically generated
fm@2163
   591
     by the MenuEditor of ST/X."
fm@2163
   592
fm@2163
   593
    "Do not manually edit this!! If it is corrupted,
fm@2163
   594
     the MenuEditor may not be able to read the specification."
fm@2163
   595
fm@2163
   596
    "
fm@2163
   597
     MenuEditor new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#keyStringAndLanguageSelectionTableMenu
fm@2163
   598
     (Menu new fromLiteralArrayEncoding:(Tools::InternationalLanguageTranslationEditor keyStringAndLanguageSelectionTableMenu)) startUp
fm@2163
   599
    "
fm@2163
   600
fm@2163
   601
    <resource: #menu>
fm@2163
   602
cg@2434
   603
    ^
fm@2163
   604
     #(Menu
cg@3286
   605
        (
cg@3286
   606
         (MenuItem
cg@3286
   607
            label: 'Browse Methods Containing this String'
cg@3286
   608
            itemValue: browseReferringMethods
cg@3286
   609
            translateLabel: true
cg@3286
   610
          )
cg@3286
   611
         (MenuItem
cg@3286
   612
            label: '-'
cg@3286
   613
            isVisible: #false
cg@3286
   614
          )
cg@3286
   615
         (MenuItem
cg@3286
   616
            label: 'Set Current NameSpace...'
cg@3286
   617
            itemValue: changeLastNameSpace
cg@3286
   618
            translateLabel: true
cg@3286
   619
          )
cg@3286
   620
         (MenuItem
cg@3286
   621
            label: 'Search String in Current NameSpace'
cg@3286
   622
            itemValue: searchStringInLastNameSpace
cg@3286
   623
            translateLabel: true
cg@3286
   624
          )
cg@3286
   625
         (MenuItem
cg@3286
   626
            label: '-'
cg@3286
   627
            isVisible: #false
cg@3286
   628
          )
cg@3286
   629
         (MenuItem
cg@3286
   630
            label: 'Set Current Package...'
cg@3286
   631
            itemValue: changeLastPackage
cg@3286
   632
            translateLabel: true
cg@3286
   633
            isVisible: #false
cg@3286
   634
          )
cg@3286
   635
         (MenuItem
cg@3286
   636
            label: 'Search String in Current Package'
cg@3286
   637
            itemValue: searchStringInLastPackage
cg@3286
   638
            translateLabel: true
cg@3286
   639
            isVisible: #false
cg@3286
   640
          )
cg@3286
   641
         )
cg@3286
   642
        nil
cg@3286
   643
        nil
fm@2163
   644
      )
fm@2163
   645
!
fm@2163
   646
cg@2015
   647
mainMenu
cg@2015
   648
    "This resource specification was automatically generated
cg@2015
   649
     by the MenuEditor of ST/X."
cg@2015
   650
cg@2015
   651
    "Do not manually edit this!! If it is corrupted,
cg@2015
   652
     the MenuEditor may not be able to read the specification."
cg@2015
   653
jan@3189
   654
cg@2015
   655
    "
fm@2050
   656
     MenuEditor new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#mainMenu
fm@2050
   657
     (Menu new fromLiteralArrayEncoding:(Tools::InternationalLanguageTranslationEditor mainMenu)) startUp
cg@2015
   658
    "
cg@2015
   659
cg@2015
   660
    <resource: #menu>
cg@2015
   661
jan@3189
   662
    ^ 
cg@2015
   663
     #(Menu
jan@3189
   664
        (
jan@3189
   665
         (MenuItem
jan@3189
   666
            label: 'File'
jan@3189
   667
            submenu: 
jan@3189
   668
           (Menu
jan@3189
   669
              (
jan@3189
   670
               (MenuItem
jan@3189
   671
                  label: 'New'
jan@3189
   672
                  itemValue: menuNew
jan@3189
   673
                )
jan@3189
   674
               (MenuItem
jan@3189
   675
                  label: '-'
jan@3189
   676
                )
jan@3189
   677
               (MenuItem
jan@3189
   678
                  label: 'Open Resources for Package or Project...'
jan@3189
   679
                  itemValue: menuOpenByPackage
jan@3189
   680
                )
jan@3189
   681
               (MenuItem
jan@3189
   682
                  label: 'Open Resource File...'
jan@3189
   683
                  itemValue: menuOpen
jan@3189
   684
                )
jan@3189
   685
               (MenuItem
jan@3189
   686
                  label: '-'
jan@3189
   687
                )
jan@3189
   688
               (MenuItem
jan@3189
   689
                  label: 'Save All Resource Files'
jan@3189
   690
                  itemValue: menuSaveAll
jan@3189
   691
                )
jan@3189
   692
               (MenuItem
jan@3189
   693
                  label: 'Save Resource File'
jan@3189
   694
                  itemValue: menuSave
jan@3189
   695
                )
jan@3189
   696
               (MenuItem
jan@3189
   697
                  label: 'Save Resource File As...'
jan@3189
   698
                  itemValue: menuSaveAs
jan@3189
   699
                )
jan@3189
   700
               (MenuItem
jan@3189
   701
                  label: '-'
jan@3189
   702
                )
jan@3189
   703
               (MenuItem
jan@3189
   704
                  label: 'Import existing translations from file...'
jan@3189
   705
                  itemValue: importExistingTranslationsFromFile
jan@3189
   706
                )
jan@3189
   707
               (MenuItem
jan@3189
   708
                  label: '-'
jan@3189
   709
                )
jan@3189
   710
               (MenuItem
jan@3189
   711
                  label: 'Set Current NameSpace'
jan@3189
   712
                  itemValue: changeLastNameSpace
jan@3189
   713
                )
jan@3189
   714
               (MenuItem
jan@3189
   715
                  label: 'Set Current Package'
jan@3189
   716
                  itemValue: changeLastPackage
jan@3189
   717
                  isVisible: #false
jan@3189
   718
                )
jan@3189
   719
               (MenuItem
jan@3189
   720
                  label: '-'
jan@3189
   721
                )
jan@3189
   722
               (MenuItem
jan@3189
   723
                  label: 'Exit'
jan@3189
   724
                  itemValue: closeRequest
jan@3189
   725
                )
jan@3189
   726
               )
jan@3189
   727
              nil
jan@3189
   728
              nil
jan@3189
   729
            )
jan@3189
   730
          )
jan@3189
   731
         (MenuItem
jan@3189
   732
            label: 'View'
jan@3189
   733
            submenu: 
jan@3189
   734
           (Menu
jan@3189
   735
              (
jan@3189
   736
               (MenuItem
jan@3189
   737
                  label: 'Show Missing Translations Only'
jan@3189
   738
                  indication: showMissingTranslationsOnly
jan@3189
   739
                )
jan@3189
   740
               (MenuItem
cg@3286
   741
                  label: 'Show Search Box'
cg@3286
   742
                  indication: searchBoxVisible
cg@3286
   743
                )
cg@3286
   744
               (MenuItem
jan@3189
   745
                  label: '-'
jan@3189
   746
                )
jan@3189
   747
               (MenuItem
jan@3189
   748
                  label: 'Shown Languages'
jan@3189
   749
                  submenuChannel: shownLanguagesMenu
jan@3189
   750
                )
jan@3189
   751
               )
jan@3189
   752
              nil
jan@3189
   753
              nil
jan@3189
   754
            )
jan@3189
   755
          )
jan@3189
   756
         (MenuItem
jan@3189
   757
            label: 'Languages'
jan@3189
   758
            submenu: 
jan@3189
   759
           (Menu
jan@3189
   760
              (
jan@3189
   761
               (MenuItem
jan@3189
   762
                  label: 'Add Language...'
jan@3189
   763
                  itemValue: addLanguage
jan@3189
   764
                )
jan@3189
   765
               (MenuItem
jan@3189
   766
                  label: 'Remove Language...'
jan@3189
   767
                  itemValue: removeLanguage
jan@3189
   768
                )
jan@3189
   769
               )
jan@3189
   770
              nil
jan@3189
   771
              nil
jan@3189
   772
            )
jan@3189
   773
          )
jan@3189
   774
         (MenuItem
jan@3189
   775
            label: 'Translations'
jan@3189
   776
            submenuChannel: translationsMenuSpec
jan@3189
   777
          )
jan@3189
   778
         (MenuItem
jan@3189
   779
            label: 'Preferences'
jan@3189
   780
            submenu: 
jan@3189
   781
           (Menu
jan@3189
   782
              (
jan@3189
   783
               (MenuItem
jan@3189
   784
                  label: 'Auto Accept Changes'
jan@3189
   785
                  indication: autoAcceptHolder
jan@3189
   786
                )
jan@3189
   787
               (MenuItem
jan@3189
   788
                  label: 'Search For Similar Translations'
jan@3189
   789
                  indication: searchForSimilarTranslationEnableHolder
jan@3189
   790
                )
jan@3189
   791
               (MenuItem
jan@3189
   792
                  label: 'Always Write UTF8'
jan@3189
   793
                  indication: alwaysWriteUTF8Holder
jan@3189
   794
                )
jan@3189
   795
               )
jan@3189
   796
              nil
jan@3189
   797
              nil
jan@3189
   798
            )
jan@3189
   799
          )
jan@3189
   800
         (MenuItem
jan@3189
   801
            label: 'Help'
jan@3189
   802
            startGroup: right
jan@3189
   803
            submenu: 
jan@3189
   804
           (Menu
jan@3189
   805
              (
jan@3189
   806
               (MenuItem
jan@3189
   807
                  label: 'Documentation'
jan@3189
   808
                  itemValue: openDocumentation
jan@3189
   809
                )
jan@3189
   810
               (MenuItem
jan@3189
   811
                  label: '-'
jan@3189
   812
                )
jan@3189
   813
               (MenuItem
jan@3189
   814
                  label: 'About this Application...'
jan@3189
   815
                  itemValue: openAboutThisApplication
jan@3189
   816
                )
jan@3189
   817
               )
jan@3189
   818
              nil
jan@3189
   819
              nil
jan@3189
   820
            )
jan@3189
   821
          )
jan@3189
   822
         )
jan@3189
   823
        nil
jan@3189
   824
        nil
cg@2015
   825
      )
cg@2015
   826
!
cg@2015
   827
fm@2051
   828
menuItemsEditLanguage
fm@2051
   829
    "This resource specification was automatically generated
fm@2051
   830
     by the MenuEditor of ST/X."
fm@2051
   831
fm@2051
   832
    "Do not manually edit this!! If it is corrupted,
fm@2051
   833
     the MenuEditor may not be able to read the specification."
fm@2051
   834
fm@2051
   835
    "
fm@2051
   836
     MenuEditor new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#menu
fm@2051
   837
     (Menu new fromLiteralArrayEncoding:(Tools::InternationalLanguageTranslationEditor menu)) startUp
fm@2051
   838
    "
fm@2051
   839
fm@2051
   840
    <resource: #menu>
fm@2051
   841
cg@2434
   842
    ^
fm@2051
   843
     #(Menu
cg@2434
   844
	(
cg@2434
   845
	 (MenuItem
cg@2434
   846
	    enabled: pastePreviousTranslationEnableHolder
cg@2434
   847
	    label: 'Paste Previous Translation'
cg@2434
   848
	    itemValue: pastePreviousTranslationInLanguageText
cg@2434
   849
	    nameKey: pastePreviousTranslationInLanguageText
cg@2434
   850
	    translateLabel: true
cg@2434
   851
	  )
cg@2434
   852
	 )
cg@2434
   853
	nil
cg@2434
   854
	nil
fm@2051
   855
      )
fm@2051
   856
!
fm@2051
   857
cg@2015
   858
menuToolBar
cg@2015
   859
    "This resource specification was automatically generated
cg@2015
   860
     by the MenuEditor of ST/X."
cg@2015
   861
cg@2015
   862
    "Do not manually edit this!! If it is corrupted,
cg@2015
   863
     the MenuEditor may not be able to read the specification."
cg@2015
   864
cg@2880
   865
cg@2015
   866
    "
fm@2051
   867
     MenuEditor new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#menuToolBar
fm@2051
   868
     (Menu new fromLiteralArrayEncoding:(Tools::InternationalLanguageTranslationEditor menuToolBar)) startUp
cg@2015
   869
    "
cg@2015
   870
cg@2015
   871
    <resource: #menu>
cg@2015
   872
cg@2880
   873
    ^ 
cg@2015
   874
     #(Menu
cg@2880
   875
        (
cg@2880
   876
         (MenuItem
cg@2880
   877
            label: 'Save'
cg@2880
   878
            itemValue: menuSave
cg@2880
   879
            isButton: true
cg@2880
   880
            labelImage: (ResourceRetriever XPToolbarIconLibrary saveImageIcon)
cg@2880
   881
          )
cg@2880
   882
         (MenuItem
cg@2880
   883
            label: '-'
cg@2880
   884
          )
cg@2880
   885
         (MenuItem
cg@2880
   886
            label: 'Add Translation'
cg@2880
   887
            itemValue: addTranslation
cg@2880
   888
            isButton: true
cg@2880
   889
            labelImage: (ResourceRetriever XPToolbarIconLibrary newRowIcon)
cg@2880
   890
          )
cg@2880
   891
         (MenuItem
cg@2880
   892
            label: 'Remove Translation'
cg@2880
   893
            itemValue: removeTranslation
cg@2880
   894
            isButton: true
cg@2880
   895
            labelImage: (ResourceRetriever XPToolbarIconLibrary removeRowIcon)
cg@2880
   896
          )
cg@2880
   897
         (MenuItem
cg@2880
   898
            label: '-'
cg@2880
   899
          )
cg@2880
   900
         (MenuItem
cg@3286
   901
            activeHelpKey: browseReferringMethods
cg@3286
   902
            label: 'Browse'
cg@3286
   903
            itemValue: browseReferringMethods
cg@3286
   904
            labelImage: (ResourceRetriever ToolbarIconLibrary systemBrowserIcon)
cg@2880
   905
          )
cg@2880
   906
         (MenuItem
cg@2880
   907
            label: ''
cg@2880
   908
          )
cg@2880
   909
         (MenuItem
cg@2880
   910
            label: 'Stop Application'
cg@2880
   911
            itemValue: stopApplication
cg@2880
   912
            isButton: true
cg@2880
   913
            isVisible: stopApplicationIconVisibleHolder
cg@2880
   914
            labelImage: (ResourceRetriever XPToolbarIconLibrary stop16x16Icon)
cg@2880
   915
          )
cg@3286
   916
         (MenuItem
cg@3286
   917
            activeHelpKey: searchBox
cg@3286
   918
            label: 'Search'
cg@3286
   919
            isButton: true
cg@3286
   920
            startGroup: right
cg@3286
   921
            hideMenuOnActivated: false
cg@3286
   922
            indication: searchBoxVisible
cg@3286
   923
            shortcutKey: Ctrlf
cg@3286
   924
            labelImage: (ResourceRetriever #'Tools::InternationalLanguageTranslationEditor' searchToolBarIcon)
cg@3286
   925
          )
cg@2880
   926
         )
cg@2880
   927
        nil
cg@2880
   928
        nil
cg@2015
   929
      )
jan@3189
   930
!
jan@3189
   931
jan@3189
   932
translationsMenuSpec
jan@3189
   933
    "This resource specification was automatically generated
jan@3189
   934
     by the MenuEditor of ST/X."
jan@3189
   935
jan@3189
   936
    "Do not manually edit this!! If it is corrupted,
jan@3189
   937
     the MenuEditor may not be able to read the specification."
jan@3189
   938
jan@3189
   939
jan@3189
   940
    "
jan@3189
   941
     MenuEditor new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#translationsMenuSpec
jan@3189
   942
     (Menu new fromLiteralArrayEncoding:(Tools::InternationalLanguageTranslationEditor translationsMenuSpec)) startUp
jan@3189
   943
    "
jan@3189
   944
jan@3189
   945
    <resource: #menu>
jan@3189
   946
jan@3189
   947
    ^ 
jan@3189
   948
     #(Menu
jan@3189
   949
        (
jan@3189
   950
         (MenuItem
jan@3189
   951
            label: 'Add Translation...'
jan@3189
   952
            itemValue: addTranslation
jan@3189
   953
          )
jan@3189
   954
         (MenuItem
jan@3189
   955
            label: 'Remove Translation...'
jan@3189
   956
            itemValue: removeTranslation
jan@3189
   957
          )
jan@3189
   958
         (MenuItem
jan@3189
   959
            label: '-'
jan@3189
   960
          )
jan@3189
   961
         (MenuItem
cg@3286
   962
            label: 'Extract from Package...'
cg@3286
   963
            itemValue: extractTranslationsFromProject
cg@3286
   964
          )
cg@3286
   965
         (MenuItem
jan@3189
   966
            label: 'Extract from Class...'
jan@3189
   967
            itemValue: extractTranslationsFromClass
jan@3189
   968
          )
jan@3189
   969
         (MenuItem
jan@3189
   970
            label: 'Extract from NameSpace...'
jan@3189
   971
            itemValue: extractTranslationsFromNameSpace
jan@3189
   972
          )
jan@3189
   973
         (MenuItem
jan@3189
   974
            label: '-'
jan@3189
   975
          )
jan@3189
   976
         (MenuItem
jan@3189
   977
            label: 'Run Application and Collect Translations...'
jan@3189
   978
            itemValue: runApplicationAndCollectTranslations
jan@3189
   979
          )
jan@3189
   980
         (MenuItem
jan@3189
   981
            label: '-'
jan@3189
   982
          )
jan@3189
   983
         (MenuItem
jan@3189
   984
            label: 'Generate Missing Translations'
jan@3189
   985
            itemValue: generateMissingTranslations
jan@3189
   986
          )
jan@3189
   987
         (MenuItem
jan@3189
   988
            label: 'Generate Missing Translations Slice'
jan@3189
   989
            submenuChannel: menuSliceTranslateGenerate
jan@3189
   990
            isMenuSlice: true
jan@3189
   991
          )
jan@3189
   992
         )
jan@3189
   993
        nil
jan@3189
   994
        nil
jan@3189
   995
      )
cg@2015
   996
! !
cg@2015
   997
cg@2433
   998
!InternationalLanguageTranslationEditor class methodsFor:'startup'!
cg@2433
   999
cg@2433
  1000
openOnFile:aFilename
cg@2433
  1001
    |fn|
cg@2433
  1002
cg@2433
  1003
    fn := aFilename asFilename.
cg@2433
  1004
cg@3077
  1005
    ^ self new
cg@3077
  1006
        allButOpen;
cg@3077
  1007
        readResourceFile:fn asLanguage:fn withoutSuffix baseName;
cg@3077
  1008
        openWindow;
cg@3077
  1009
        yourself.
cg@3077
  1010
!
cg@3077
  1011
cg@3077
  1012
openOnPackage:aPackageId
cg@3077
  1013
    ^ self new
cg@3077
  1014
        allButOpen;
cg@3077
  1015
        readResourceFileForPackage:aPackageId;
cg@3077
  1016
        openWindow;
cg@3077
  1017
        yourself.
cg@2433
  1018
! !
cg@2433
  1019
cg@2047
  1020
!InternationalLanguageTranslationEditor class methodsFor:'tableColumns specs'!
cg@2047
  1021
cg@2047
  1022
keyTableColumn
cg@2047
  1023
    "This resource specification was automatically generated
cg@2047
  1024
     by the DataSetBuilder of ST/X."
cg@2047
  1025
cg@2047
  1026
    "Do not manually edit this!! If it is corrupted,
cg@2047
  1027
     the DataSetBuilder may not be able to read the specification."
cg@2047
  1028
cg@2047
  1029
    "
cg@2047
  1030
     DataSetBuilder new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#keyTableColumn
cg@2047
  1031
    "
cg@2047
  1032
cg@2047
  1033
    <resource: #tableColumns>
cg@2047
  1034
cg@2047
  1035
    ^#(
cg@2047
  1036
      (DataSetColumnSpec
cg@2434
  1037
	 label: 'Key'
cg@2434
  1038
	 labelButtonType: Button
cg@2434
  1039
	 minWidth: 50
cg@2434
  1040
	 model: keyStringInRow:
cg@2047
  1041
       )
cg@2047
  1042
      )
cg@2047
  1043
!
cg@2047
  1044
cg@2047
  1045
languageTableColumn
cg@2047
  1046
    "This resource specification was automatically generated
cg@2047
  1047
     by the DataSetBuilder of ST/X."
cg@2047
  1048
cg@2047
  1049
    "Do not manually edit this!! If it is corrupted,
cg@2047
  1050
     the DataSetBuilder may not be able to read the specification."
cg@2047
  1051
cg@2047
  1052
    "
fm@2049
  1053
     DataSetBuilder new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#languageTableColumn
cg@2047
  1054
    "
cg@2047
  1055
cg@2047
  1056
    <resource: #tableColumns>
cg@2047
  1057
cg@2047
  1058
    ^#(
fm@2049
  1059
      (DataSetColumnSpec
cg@2434
  1060
	 label: lang
cg@2434
  1061
	 labelButtonType: Button
cg@2434
  1062
	 minWidth: 50
cg@2434
  1063
	 editorType: None
cg@2434
  1064
	 model: columnInRow:at:
cg@2434
  1065
	 backgroundSelector: getBackgroundForRow:rowNr:col:
fm@2049
  1066
       )
fm@2049
  1067
      )
fm@2049
  1068
! !
cg@2047
  1069
fm@2049
  1070
!InternationalLanguageTranslationEditor methodsFor:'accessing'!
fm@2049
  1071
cg@2434
  1072
currentSelectionIndex
fm@2327
  1073
fm@2327
  1074
    ^ self selectedKeyRow value
fm@2327
  1075
fm@2327
  1076
    "Created: / 16-06-2007 / 09:04:11 / Administrador"
fm@2327
  1077
    "Modified: / 19-06-2007 / 17:28:38 / Administrador"
fm@2327
  1078
!
fm@2327
  1079
fm@2327
  1080
exists: anObject
fm@2327
  1081
fm@2327
  1082
    ^self objectsList includes: anObject
fm@2327
  1083
fm@2327
  1084
    "Created: / 19-06-2007 / 16:42:22 / Administrador"
fm@2327
  1085
!
fm@2327
  1086
fm@2327
  1087
indexOf: anObject
fm@2327
  1088
fm@2327
  1089
    ^self objectsList indexOf: anObject
fm@2327
  1090
fm@2327
  1091
    "Created: / 19-06-2007 / 16:39:44 / Administrador"
fm@2327
  1092
!
fm@2327
  1093
fm@2049
  1094
newLanguageText
fm@2049
  1095
"/   languageEditor accept
sv@3245
  1096
    ^self languageTextHolder value isEmptyOrNil
sv@3245
  1097
        ifTrue:['']
sv@3245
  1098
        ifFalse:[self languageTextHolder value asCollectionOfLines first.]
fm@2050
  1099
!
fm@2050
  1100
fm@2327
  1101
objectsList
fm@2327
  1102
cg@2434
  1103
    ^ keyStringsToLanguageMappings
fm@2327
  1104
!
fm@2327
  1105
fm@2327
  1106
selectListIndex: rowIndex
fm@2327
  1107
"/    |selection list|
fm@2327
  1108
"/    list := self objectsList.
fm@2327
  1109
"/    list isEmpty ifTrue:[^self].
fm@2327
  1110
"/    selection := list at:rowIndex ifAbsent:nil.
fm@2327
  1111
    self selectedKeyRow value: rowIndex.
fm@2327
  1112
fm@2327
  1113
    "Created: / 16-06-2007 / 09:06:46 / Administrador"
fm@2327
  1114
    "Modified: / 22-06-2007 / 13:45:54 / Administrador"
fm@2327
  1115
!
fm@2327
  1116
cg@2434
  1117
selectedKey
fm@2050
  1118
   "Returns the current selected key if there is one row seleted. Otherwise, returns nil"
fm@2050
  1119
     |rowSelectionIndex |
fm@2050
  1120
fm@2163
  1121
    keyStringsToLanguageMappings isNil ifTrue:[^nil].
fm@2163
  1122
    self selectedKeyRow value isNil ifTrue:[^nil].
fm@2050
  1123
    rowSelectionIndex := self selectedKeyRow value.
fm@2050
  1124
    rowSelectionIndex == 0 ifTrue:[^nil].
fm@2050
  1125
    ^ keyStringsToLanguageMappings keyAt:rowSelectionIndex.
fm@2327
  1126
!
fm@2327
  1127
fm@2327
  1128
tableView
fm@2327
  1129
fm@2327
  1130
    ^dataSetView scrolledView
fm@2327
  1131
fm@2327
  1132
    "Created: / 15-06-2007 / 18:59:51 / Administrador"
cg@2047
  1133
! !
cg@2047
  1134
fm@2051
  1135
!InternationalLanguageTranslationEditor methodsFor:'additionalFuncionalities'!
fm@2051
  1136
fm@2051
  1137
searchForSimilarTranslation
fm@2163
  1138
    "Looks for a quite similar translation for the key and display a dialog with available options"
fm@2327
  1139
    |similarTranslationsAssociations selectedTranslation key|
fm@2051
  1140
cg@2434
  1141
    self shouldSearchForSimilarTranslation ifFalse:[^self].
fm@2051
  1142
fm@2327
  1143
    key := self selectedKey.
fm@2327
  1144
    key isNil ifTrue:[^ self.].
fm@2327
  1145
    similarTranslationsAssociations := keyStringsToLanguageMappings searchForSimilarTranslation: key in: self currentLanguage.
cg@2434
  1146
    similarTranslationsAssociations isEmpty ifTrue:[^self].
fm@2051
  1147
fm@2163
  1148
    similarTranslationsAssociations := similarTranslationsAssociations associations inject: OrderedCollection new into:[:collection :association |
cg@2434
  1149
	collection detect:[:selectedAssociation |
cg@2434
  1150
	    selectedAssociation value sameAs: association value] ifNone:[collection add: association].
cg@2434
  1151
	collection].
cg@2434
  1152
    selectedTranslation := Dialog
cg@2434
  1153
	choose:'Choose one if you consider itīs usefull to translate:
cg@2434
  1154
    ',
cg@2434
  1155
	'<', key, '>  ', (self currentExampleLanguageText ifNil:[''])
cg@2434
  1156
	fromList: (similarTranslationsAssociations collect:[:each |  '<', each key, '>  ', each value])
cg@2434
  1157
	values: (similarTranslationsAssociations collect:[:each | each value])
cg@2434
  1158
	lines:10
cg@2434
  1159
	cancel: nil.
cg@2434
  1160
cg@2434
  1161
    selectedTranslation notNil ifTrue:[self languageTextHolderValue: selectedTranslation].
fm@2051
  1162
! !
fm@2051
  1163
cg@2015
  1164
!InternationalLanguageTranslationEditor methodsFor:'aspects'!
cg@2015
  1165
fm@2053
  1166
alwaysWriteUTF8Holder
cg@2434
  1167
    alwaysWriteUTF8Holder isNil ifTrue:[alwaysWriteUTF8Holder := true asValue].
fm@2053
  1168
    ^ alwaysWriteUTF8Holder
fm@2053
  1169
!
fm@2053
  1170
fm@2050
  1171
autoAcceptHolder
cg@2434
  1172
    autoAcceptHolder isNil ifTrue:[autoAcceptHolder := true asValue].
fm@2050
  1173
    ^ autoAcceptHolder
fm@2050
  1174
!
fm@2050
  1175
fm@2050
  1176
exampleLanguageSelectionHolder
fm@2050
  1177
    exampleLanguageSelectionHolder isNil ifTrue:[
cg@2434
  1178
	exampleLanguageSelectionHolder := self exampleLanguageByDefault asValue.
cg@2434
  1179
	exampleLanguageSelectionHolder addDependent:self.
cg@2434
  1180
    ].
fm@2050
  1181
    ^ exampleLanguageSelectionHolder
fm@2050
  1182
!
fm@2050
  1183
fm@2050
  1184
exampleLanguageTextHolder
fm@2050
  1185
    exampleLanguageTextHolder isNil ifTrue:[
cg@2434
  1186
	exampleLanguageTextHolder := '' asValue.
fm@2050
  1187
    ].
fm@2050
  1188
    ^ exampleLanguageTextHolder.
fm@2050
  1189
!
fm@2050
  1190
fm@2327
  1191
ignoreCaseHolder
fm@2327
  1192
fm@2327
  1193
    ignoreCaseHolder isNil ifTrue:[
cg@2434
  1194
	ignoreCaseHolder := false asValue.
fm@2327
  1195
"/ if your app needs to be notified of changes, uncomment one of the lines below:
fm@2327
  1196
"/       ignoreCaseHolder addDependent:self.
cg@2434
  1197
	ignoreCaseHolder onChangeSend:#ignoreCaseHolderChanged to:self.
fm@2327
  1198
fm@2327
  1199
    ].
fm@2327
  1200
    ^ ignoreCaseHolder.
fm@2327
  1201
fm@2327
  1202
    "Created: / 16-06-2007 / 06:45:04 / Administrador"
fm@2327
  1203
    "Modified: / 16-06-2007 / 19:32:15 / Administrador"
fm@2327
  1204
!
fm@2327
  1205
cg@2015
  1206
keyStringAndLanguageSelectionTable
cg@2015
  1207
    keyStringsToLanguageMappings isNil ifTrue:[
cg@2434
  1208
	keyStringsToLanguageMappings := KeyStringsToLanguageMappings new.
cg@2015
  1209
    ].
cg@2015
  1210
    ^ keyStringsToLanguageMappings.
cg@2015
  1211
!
cg@2015
  1212
cg@2015
  1213
keyStringAndLanguageSelectionTableColumnDescriptionHolder
cg@2015
  1214
    keyStringAndLanguageSelectionTableColumnDescriptionHolder isNil ifTrue:[
cg@2434
  1215
	keyStringAndLanguageSelectionTableColumnDescriptionHolder := ValueHolder new.
cg@2434
  1216
	keyStringAndLanguageSelectionTableColumnDescriptionHolder value:(self keyStringAndLanguageSelectionTableColumnDescription).
cg@2015
  1217
    ].
cg@2015
  1218
    ^ keyStringAndLanguageSelectionTableColumnDescriptionHolder.
cg@2015
  1219
!
cg@2015
  1220
cg@2015
  1221
languageAtCol:colNr
cg@2015
  1222
    ^ shownLanguages at:colNr-1.
cg@2015
  1223
!
cg@2015
  1224
cg@2015
  1225
languageShownHolderFor:lang
cg@2015
  1226
    |holder|
cg@2015
  1227
cg@2015
  1228
    languageShownHolders isNil ifTrue:[
cg@2434
  1229
	languageShownHolders := Dictionary new
cg@2015
  1230
    ].
cg@2434
  1231
    holder := languageShownHolders
cg@2434
  1232
		at:lang
cg@2434
  1233
		ifAbsentPut:[
cg@2434
  1234
		    |h|
cg@2434
  1235
cg@2434
  1236
		    h := true asValue.
cg@2434
  1237
		    h onChangeEvaluate:[
cg@2434
  1238
			h value ifTrue:[
cg@2434
  1239
			   self enableLanguageDisplayFor:lang
cg@2434
  1240
			] ifFalse:[
cg@2434
  1241
			   self disableLanguageDisplayFor:lang
cg@2434
  1242
			].
cg@2434
  1243
		    ].
cg@2434
  1244
		    h
cg@2434
  1245
		].
cg@2015
  1246
    ^ holder.
cg@2015
  1247
!
cg@2015
  1248
cg@2048
  1249
languageTextAcceptHolder
cg@2048
  1250
    languageTextAcceptHolder isNil ifTrue:[
cg@2434
  1251
	languageTextAcceptHolder := false asValue.
cg@2048
  1252
    ].
cg@2048
  1253
    ^ languageTextAcceptHolder.
cg@2048
  1254
!
cg@2048
  1255
cg@2015
  1256
languageTextHolder
cg@2015
  1257
    languageTextHolder isNil ifTrue:[
cg@2434
  1258
	languageTextHolder := '' asValue.
cg@2015
  1259
    ].
cg@2015
  1260
    ^ languageTextHolder.
cg@2015
  1261
!
cg@2015
  1262
cg@2015
  1263
languageTextModifiedHolder
cg@2015
  1264
    languageTextModifiedHolder isNil ifTrue:[
cg@2434
  1265
	languageTextModifiedHolder := false asValue.
cg@2015
  1266
    ].
cg@2015
  1267
    ^ languageTextModifiedHolder.
cg@2015
  1268
!
cg@2015
  1269
cg@2015
  1270
languagesList
cg@2015
  1271
    languagesList isNil ifTrue:[
cg@2434
  1272
	languagesList := List withAll:(self keyStringAndLanguageSelectionTable languages).
cg@2015
  1273
    ].
cg@2015
  1274
    ^ languagesList.
cg@2015
  1275
!
cg@2015
  1276
cg@2015
  1277
originalTextHolder
cg@2015
  1278
    originalTextHolder isNil ifTrue:[
cg@2434
  1279
	originalTextHolder := '' asValue.
cg@2015
  1280
    ].
cg@2015
  1281
    ^ originalTextHolder.
cg@2015
  1282
!
cg@2015
  1283
cg@2015
  1284
originalTextModifiedHolder
cg@2015
  1285
    originalTextModifiedHolder isNil ifTrue:[
cg@2434
  1286
	originalTextModifiedHolder := false asValue.
cg@2015
  1287
    ].
cg@2015
  1288
    ^ originalTextModifiedHolder.
cg@2015
  1289
!
cg@2015
  1290
fm@2323
  1291
pasteOriginalEnableHolder
cg@2434
  1292
   pasteOriginalEnableHolder isNil ifTrue:[pasteOriginalEnableHolder := false asValue].
fm@2323
  1293
    ^ pasteOriginalEnableHolder
fm@2323
  1294
!
fm@2323
  1295
fm@2051
  1296
pastePreviousTranslationEnableHolder
cg@2434
  1297
   pastePreviousTranslationEnableHolder isNil ifTrue:[pastePreviousTranslationEnableHolder := false asValue].
fm@2051
  1298
    ^ pastePreviousTranslationEnableHolder
fm@2051
  1299
!
fm@2051
  1300
fm@2327
  1301
searchBarImageInfoLabelHolder
fm@2327
  1302
fm@2327
  1303
    searchBarImageInfoLabelHolder isNil ifTrue:[
cg@2434
  1304
	searchBarImageInfoLabelHolder := nil asValue .
fm@2327
  1305
    ].
fm@2327
  1306
    ^ searchBarImageInfoLabelHolder.
fm@2327
  1307
fm@2327
  1308
    "Created: / 16-06-2007 / 10:06:28 / Administrador"
fm@2327
  1309
!
fm@2327
  1310
fm@2327
  1311
searchBarInfoLabelHolder
fm@2327
  1312
fm@2327
  1313
    searchBarInfoLabelHolder isNil ifTrue:[
cg@2434
  1314
	searchBarInfoLabelHolder := '' asValue .
fm@2327
  1315
    ].
fm@2327
  1316
    ^ searchBarInfoLabelHolder.
fm@2327
  1317
fm@2327
  1318
    "Created: / 16-06-2007 / 06:20:49 / Administrador"
fm@2327
  1319
!
fm@2327
  1320
fm@2327
  1321
searchBoxVisible
fm@2327
  1322
fm@2327
  1323
    searchBoxVisible isNil ifTrue:[
cg@3286
  1324
        searchBoxVisible := false asValue.
cg@3286
  1325
        searchBoxVisible 
cg@3286
  1326
            onChangeEvaluate:[ 
cg@3286
  1327
                self updateToolVisibility.
cg@3286
  1328
                searchBoxVisible value ifTrue:[
cg@3286
  1329
                    searchTextView takeFocus.
cg@3286
  1330
                ].
cg@3286
  1331
            ].
fm@2327
  1332
    ].
fm@2327
  1333
    ^ searchBoxVisible.
fm@2327
  1334
fm@2327
  1335
    "Created: / 15-06-2007 / 18:15:52 / Administrador"
fm@2327
  1336
!
fm@2327
  1337
fm@2051
  1338
searchForSimilarTranslationEnableHolder
cg@2434
  1339
   searchForSimilarTranslationEnableHolder isNil
cg@2434
  1340
	ifTrue:[searchForSimilarTranslationEnableHolder := true asValue].
fm@2051
  1341
    ^ searchForSimilarTranslationEnableHolder
fm@2051
  1342
!
fm@2051
  1343
fm@2327
  1344
searchTextHolder
fm@2327
  1345
fm@2327
  1346
    searchTextHolder isNil ifTrue:[
cg@2434
  1347
	searchTextHolder := ValueHolder new.
fm@2327
  1348
"/ if your app needs to be notified of changes, uncomment one of the lines below:
fm@2327
  1349
"/       userSelectedHolder addDependent:self.
fm@2327
  1350
"/       userSelectedHolder onChangeSend:#searchTextHolderChanged to:self.
fm@2327
  1351
    ].
fm@2327
  1352
    ^ searchTextHolder.
fm@2327
  1353
fm@2327
  1354
    "Created: / 15-06-2007 / 18:06:08 / Administrador"
fm@2327
  1355
!
fm@2327
  1356
fm@2327
  1357
searchTextModifiedHolder
fm@2327
  1358
fm@2327
  1359
    searchTextModifiedHolder isNil ifTrue:[
cg@2434
  1360
	searchTextModifiedHolder := false asValue .
fm@2327
  1361
"/ if your app needs to be notified of changes, uncomment one of the lines below:
fm@2327
  1362
"/       searchTextModifiedHolder addDependent:self.
fm@2327
  1363
       searchTextModifiedHolder onChangeSend:#searchTextModifiedHolderChanged to:self.
fm@2327
  1364
    ].
fm@2327
  1365
    ^ searchTextModifiedHolder.
fm@2327
  1366
fm@2327
  1367
    "Created: / 15-06-2007 / 18:07:19 / Administrador"
fm@2327
  1368
!
fm@2327
  1369
cg@2015
  1370
selectedKeyRow
cg@2015
  1371
    selectedKeyRow isNil ifTrue:[
cg@2434
  1372
	selectedKeyRow := ValueHolder new.
cg@2434
  1373
	selectedKeyRow onChangeSend:#selectionChanged to:self.
cg@2015
  1374
    ].
cg@2015
  1375
    ^ selectedKeyRow.
cg@2015
  1376
!
cg@2015
  1377
cg@2015
  1378
showMissingTranslationsOnly
cg@2015
  1379
    showMissingTranslationsOnly isNil ifTrue:[
cg@2434
  1380
	showMissingTranslationsOnly := false asValue.
cg@2434
  1381
	showMissingTranslationsOnly onChangeSend:#showMissingTranslationsOnlyChanged to:self.
cg@2015
  1382
    ].
cg@2015
  1383
    ^ showMissingTranslationsOnly.
cg@2015
  1384
!
cg@2015
  1385
cg@2015
  1386
shownLanguages
cg@2015
  1387
    shownLanguages isNil ifTrue:[
cg@2434
  1388
	shownLanguages := List new.
cg@2434
  1389
	shownLanguages addAll:(self languagesList).
cg@2434
  1390
	shownLanguages onChangeSend:#shownLanguagesChanged to:self.
cg@2015
  1391
    ].
cg@2015
  1392
    ^ shownLanguages.
cg@2015
  1393
!
cg@2015
  1394
cg@2015
  1395
stopApplicationIconVisibleHolder
cg@2015
  1396
    stopApplicationIconVisibleHolder isNil ifTrue:[
cg@2434
  1397
	stopApplicationIconVisibleHolder := false asValue.
cg@2015
  1398
    ].
cg@2015
  1399
    ^ stopApplicationIconVisibleHolder.
cg@2015
  1400
! !
cg@2015
  1401
cg@2048
  1402
!InternationalLanguageTranslationEditor methodsFor:'change & update'!
cg@2048
  1403
fm@2051
  1404
languageTextHolderValue: aString
fm@2051
  1405
fm@2163
  1406
    self languageTextHolder value: aString.
fm@2163
  1407
    self languageTextModifiedHolder value:true.
fm@2051
  1408
!
fm@2051
  1409
cg@2048
  1410
update:something with:aParameter from:changedObject
cg@2048
  1411
    changedObject == shownLanguages ifTrue:[
cg@2434
  1412
	 self shownLanguagesChanged.
cg@2434
  1413
	 ^ self.
cg@2048
  1414
    ].
fm@2049
  1415
    changedObject == languageTextAcceptHolder ifTrue:[
cg@2434
  1416
	 self updateLanguageTextModification.
cg@2434
  1417
	 ^ self.
fm@2049
  1418
    ].
fm@2050
  1419
    changedObject == exampleLanguageSelectionHolder ifTrue:[
cg@2434
  1420
	self updateExampleLanguageText.
cg@2434
  1421
	^ self.
cg@2434
  1422
    ].
fm@2051
  1423
    changedObject == showMissingTranslationsOnly ifTrue:[
cg@2434
  1424
	self showMissingTranslationsOnlyChanged.
cg@2434
  1425
	^ self.
cg@2434
  1426
    ].
fm@2051
  1427
!
fm@2051
  1428
fm@2051
  1429
updateCopyPreviousTranslationButtonEnabled
fm@2051
  1430
fm@2163
  1431
     self pastePreviousTranslationEnableHolder value: self shouldCopyPreviousTranslationButtonBeEnabled
fm@2050
  1432
!
fm@2050
  1433
fm@2050
  1434
updateExampleLanguageText
fm@2050
  1435
fm@2050
  1436
    self selectedKeyRow value isNil ifTrue:[^ self].
fm@2050
  1437
    self exampleLanguageTextHolder value:self currentExampleLanguageText
fm@2049
  1438
!
fm@2049
  1439
cg@2434
  1440
updateKeyStringsToLanguageMappings
cg@2434
  1441
cg@2434
  1442
      keyStringsToLanguageMappings
cg@2434
  1443
	at:lastSelectedKey
cg@2434
  1444
	language:lastLanguage
cg@2434
  1445
	put: self newLanguageText.
fm@2049
  1446
!
fm@2049
  1447
fm@2050
  1448
updateLanguageAndKeySelection
fm@2050
  1449
fm@2050
  1450
    self originalTextHolder value: self selectedKey.
fm@2051
  1451
    self languageTextHolder value: (self languageTextFromSelectedKeyFor: self currentLanguage).
fm@2051
  1452
    lastLanguage := self currentLanguage.
cg@2434
  1453
    lastSelectedKey := self selectedKey.
fm@2050
  1454
!
fm@2050
  1455
cg@2434
  1456
updateLanguageTextModification
cg@2434
  1457
     self languageTextModifiedHolder value ifTrue:[
cg@2434
  1458
	(self autoAccept or:[Dialog confirm:'Accept changed translation ?']) ifTrue:[
cg@2434
  1459
	    self languageTextModifiedHolder value:false.
cg@2434
  1460
	    self languageTextHolder value:languageEditor contents.
cg@2434
  1461
	    lastLanguage notNil ifTrue:[self updateKeyStringsToLanguageMappings.]
cg@2434
  1462
	]
fm@2049
  1463
    ].
fm@2049
  1464
!
fm@2049
  1465
fm@2049
  1466
updateOriginalTextModification
fm@2049
  1467
fm@2163
  1468
    |answer|
fm@2049
  1469
sv@3245
  1470
        self originalTextModifiedHolder value ifTrue:[
sv@3245
  1471
            answer := OptionBox
sv@3245
  1472
                          request:'Accept changed original text (key) ?'
sv@3245
  1473
                          label:'Original text (key) changed'
sv@3245
  1474
                          image:(WarningBox iconBitmap)
sv@3245
  1475
                          buttonLabels:#('Cancel' 'Accept' 'Accept As New')
sv@3245
  1476
                          values:#(nil #accept #acceptAsNew)
sv@3245
  1477
                          default:#acceptAsNew.
sv@3245
  1478
sv@3245
  1479
            answer isNil ifTrue:[^ self originalTextModifiedHolder value:false. ].
sv@3245
  1480
            answer == #accept ifTrue:[
sv@3245
  1481
    self shouldImplement.        ].
sv@3245
  1482
            answer == #acceptAsNew ifTrue:[
sv@3245
  1483
    self shouldImplement.        ].
sv@3245
  1484
        ].
fm@2323
  1485
!
fm@2323
  1486
fm@2323
  1487
updatePasteOriginalButtonEnabled
fm@2323
  1488
fm@2323
  1489
     self pasteOriginalEnableHolder value: self shouldPasteOriginalButtonBeEnabled
cg@2048
  1490
! !
cg@2048
  1491
fm@2050
  1492
!InternationalLanguageTranslationEditor methodsFor:'dialogs'!
fm@2050
  1493
fm@2051
  1494
requestEncoderDialog
fm@2050
  1495
fm@2051
  1496
   |box val characterCollection|
fm@2051
  1497
fm@2051
  1498
    val := '' asValue.
fm@2051
  1499
    box := Dialog new.
fm@2051
  1500
    (box addTextLabel:'Select or write the encoder') adjust:#left.
fm@2051
  1501
    box addVerticalSpace.
cg@2434
  1502
    characterCollection := CharacterEncoder supportedExternalEncodings
cg@2434
  1503
	inject: OrderedCollection new
cg@2434
  1504
	into:[:collection :each |
cg@2434
  1505
	    collection add: each first;
cg@2434
  1506
			yourself].
fm@2051
  1507
    (box addComboBoxOn:val) list: characterCollection.
fm@2051
  1508
    box addOkButton.
fm@2051
  1509
    box open.
fm@2051
  1510
    ^val value
fm@2051
  1511
!
fm@2051
  1512
fm@2051
  1513
requestEncoderStringFor: lang
fm@2051
  1514
  "Returns an encoder string and updates the language's info"
fm@2051
  1515
    |encoderString encoder|
fm@2051
  1516
    encoderString := self requestEncoderDialog.
fm@2051
  1517
    encoderString notEmpty ifTrue:[
cg@2434
  1518
	encoder := CharacterEncoder encoderFor: encoderString ifAbsent:nil.
cg@2434
  1519
	encoder notNil ifTrue:[keyStringsToLanguageMappings atLanguage: lang putEncoder: encoder.].
fm@2051
  1520
    ].
fm@2051
  1521
    ^encoderString
fm@2050
  1522
!
fm@2050
  1523
cg@2434
  1524
requestFilename
fm@2050
  1525
fm@2050
  1526
    |aFilename|
fm@2050
  1527
cg@2434
  1528
    aFilename := Dialog
cg@2434
  1529
	requestFileName:(resources string:'Name of resource file:')
cg@2434
  1530
	default:nil
cg@2434
  1531
	pattern:'*.rs'.
fm@2050
  1532
fm@2050
  1533
    aFilename isEmptyOrNil ifTrue:[^ nil ].
fm@2050
  1534
    ^aFilename asFilename
fm@2050
  1535
!
fm@2050
  1536
cg@2434
  1537
requestFilenameFor: lang
fm@2051
  1538
  "Returns a filename to save the language resource and updates the language's info"
fm@2051
  1539
    |aFilename|
fm@2051
  1540
cg@2434
  1541
    aFilename := Dialog
cg@2434
  1542
	requestFileName:(resources string:'Name of resource file to save %1:' with:lang asString)
cg@2434
  1543
	default:nil
cg@2434
  1544
	pattern:'*.rs'.
fm@2051
  1545
fm@2051
  1546
    aFilename isEmptyOrNil ifTrue:[^ nil ].
fm@2051
  1547
    keyStringsToLanguageMappings atLanguage: lang putFilename: aFilename.
fm@2051
  1548
    ^aFilename asFilename
fm@2051
  1549
!
fm@2051
  1550
fm@2050
  1551
requestLanguage
cg@2434
  1552
    ^ Dialog
cg@2434
  1553
	choose:(resources string:'For which language ?')
cg@2434
  1554
	fromList:languagesList
cg@2434
  1555
	lines:10.
fm@2327
  1556
!
fm@2327
  1557
fm@2327
  1558
requestLanguageToSave
cg@2434
  1559
    ^ Dialog
cg@2434
  1560
	choose:'Which language do you want to save?'
cg@2434
  1561
	fromList:languagesList
cg@2434
  1562
	lines:10
cg@2410
  1563
!
cg@2410
  1564
cg@2410
  1565
requestPackage
cg@2419
  1566
    |package allProjects projectsWithResources|
cg@2419
  1567
matilk@3264
  1568
    allProjects := Smalltalk allPackageIDs.
cg@2419
  1569
    projectsWithResources := allProjects
cg@2570
  1570
                                select:[:pID |
cg@2570
  1571
                                    |dir|
cg@2570
  1572
                                    dir := Smalltalk projectDirectoryForPackage:pID.
cg@2570
  1573
                                    dir notNil and:[
cg@2570
  1574
                                    (dir asFilename construct:'resources') exists]
cg@2570
  1575
                                ].
cg@2410
  1576
cg@2410
  1577
    package := Dialog
cg@2570
  1578
        requestProject:(resources string:'Name of Package:')
cg@2570
  1579
        from:projectsWithResources
cg@2570
  1580
        initialAnswer:LastProject
cg@2570
  1581
        suggestions:nil.
cg@2410
  1582
cg@2410
  1583
    package isEmptyOrNil ifTrue:[^ nil ].
cg@2410
  1584
    LastProject := package.
cg@2410
  1585
    ^ package
fm@2050
  1586
! !
fm@2050
  1587
fm@2327
  1588
!InternationalLanguageTranslationEditor methodsFor:'images'!
fm@2327
  1589
fm@2327
  1590
restartSearchBarIcon
fm@2327
  1591
fm@2327
  1592
    ^ self class restartSearchBarIcon
fm@2327
  1593
!
fm@2327
  1594
fm@2327
  1595
warningSearchBarIcon
fm@2327
  1596
fm@2327
  1597
    ^ self class warningSearchBarIcon
fm@2327
  1598
! !
fm@2327
  1599
cg@2015
  1600
!InternationalLanguageTranslationEditor methodsFor:'initialization & release'!
cg@2015
  1601
cg@2015
  1602
closeRequest
cg@2015
  1603
    "asks for permission before closing"
cg@2015
  1604
cg@2015
  1605
    self hasUnsavedChanges ifTrue:[
cg@2434
  1606
	(Dialog
cg@2434
  1607
	    confirm:(resources string:'Close without saving ?')
cg@2434
  1608
	    default:false) ifFalse:[
cg@2434
  1609
	    ^ self
cg@2434
  1610
	]
cg@2015
  1611
    ].
cg@2015
  1612
cg@2015
  1613
    super closeRequest
cg@2015
  1614
!
cg@2015
  1615
cg@2015
  1616
initialize
cg@2015
  1617
    modified := false.
cg@2031
  1618
    inSingleFileMode := false.
cg@3286
  1619
    methodsUsingKey := Dictionary new.
cg@2015
  1620
    super initialize
cg@2015
  1621
!
cg@2015
  1622
fm@2049
  1623
languageEditorBuilt:aView
fm@2049
  1624
    languageEditor := aView.
fm@2049
  1625
!
fm@2049
  1626
cg@2015
  1627
postBuildDataSet:aView
fm@2049
  1628
    dataSetView := aView.
fm@2049
  1629
    aView selectedColIndexHolder onChangeSend:#selectionChanged to:self.
cg@2015
  1630
! !
cg@2015
  1631
fm@2327
  1632
!InternationalLanguageTranslationEditor methodsFor:'initialize'!
fm@2327
  1633
fm@2327
  1634
postBuildSearchBoxView: aBoxView
fm@2327
  1635
fm@2327
  1636
    searchBoxView := aBoxView
fm@2327
  1637
fm@2327
  1638
    "Created: / 15-06-2007 / 18:02:38 / Administrador"
fm@2327
  1639
!
fm@2327
  1640
fm@2327
  1641
postBuildSearchTextView: anEditFieldView
fm@2327
  1642
fm@2327
  1643
    searchTextView := anEditFieldView
fm@2327
  1644
fm@2327
  1645
    "Created: / 15-06-2007 / 18:17:15 / Administrador"
fm@2327
  1646
!
fm@2327
  1647
fm@2327
  1648
postBuildTranslationsPanel: aPanel
fm@2327
  1649
fm@2327
  1650
    translationsPanel := aPanel
fm@2327
  1651
!
fm@2327
  1652
fm@2327
  1653
postBuildWith:aBuilder
fm@2327
  1654
fm@2327
  1655
    super postBuildWith:aBuilder.
fm@2327
  1656
    self updateToolVisibility.
fm@2327
  1657
! !
fm@2327
  1658
cg@2015
  1659
!InternationalLanguageTranslationEditor methodsFor:'menu actions'!
cg@2015
  1660
cg@2015
  1661
addLanguage
cg@2015
  1662
    |lang|
cg@2015
  1663
cg@2410
  1664
    lang := Dialog request:(resources string:'New language (ISO symbol):').
cg@2015
  1665
    lang isEmptyOrNil ifTrue:[^ self].
cg@2410
  1666
    self addLanguage:lang
cg@2410
  1667
!
cg@2410
  1668
cg@2410
  1669
addLanguage:langArg
cg@2410
  1670
    |lang|
cg@2410
  1671
cg@2410
  1672
    lang := langArg asSymbol.
cg@2015
  1673
    (keyStringsToLanguageMappings includesLanguage:lang) ifTrue:[^ self ].
cg@2015
  1674
cg@2015
  1675
    keyStringsToLanguageMappings addLanguage:lang.
cg@2015
  1676
    self languagesList add:lang.
cg@2015
  1677
    self shownLanguages add:lang.
cg@2015
  1678
    modified := true.
cg@2015
  1679
!
cg@2015
  1680
cg@2015
  1681
addTranslation
cg@2015
  1682
    |key index|
cg@2015
  1683
cg@2015
  1684
    key := Dialog request:'New Key:'.
fm@2051
  1685
    key isEmpty ifTrue:[^self].
fm@2163
  1686
    (self includesKey:key) ifFalse:[
cg@2434
  1687
	keyStringsToLanguageMappings addKey:key.
cg@2434
  1688
	modified := true.
cg@2015
  1689
    ].
fm@2051
  1690
   index := keyStringsToLanguageMappings indexOfKey:key.
fm@2051
  1691
   self selectedKeyRow value:index
cg@2015
  1692
!
cg@2015
  1693
cg@3286
  1694
browseReferringMethods
cg@3286
  1695
    |selectedKey methods browser|
cg@3286
  1696
cg@3286
  1697
    selectedKey := self selectedKey.
cg@3286
  1698
    selectedKey isNil ifTrue:[^ Dialog information: 'No selected key'].
cg@3286
  1699
cg@3286
  1700
    methods := methodsUsingKey at:selectedKey ifAbsent:nil.
cg@3286
  1701
    methods isEmptyOrNil ifTrue:[
cg@3286
  1702
        Dialog information:(resources stringWithCRs:'oops - no method remembered.\Please rerun the extract from XXX menu operation').
cg@3286
  1703
        ^ self.
cg@3286
  1704
    ].    
cg@3286
  1705
    browser := UserPreferences systemBrowserClass browseMethods:methods.
cg@3286
  1706
    browser autoSearch:selectedKey ignoreCase:true.
cg@3286
  1707
!
cg@3286
  1708
fm@2163
  1709
changeLastNameSpace
fm@2163
  1710
fm@2163
  1711
    |nameSpace defaultNameSpace|
fm@2163
  1712
fm@2163
  1713
    lastNameSpace notNil ifTrue:[defaultNameSpace := lastNameSpace name].
fm@2163
  1714
    nameSpace := Dialog requestNameSpace:'NameSpace:' title:'Search String in Name Space:' initialAnswer:defaultNameSpace.
fm@2163
  1715
    nameSpace isNil ifTrue:[^self].
fm@2163
  1716
    nameSpace := Smalltalk at:nameSpace asSymbol.
fm@2163
  1717
    nameSpace isNil ifTrue:[
cg@2434
  1718
	^Dialog information:(resources string:'No such nameSpace exists.')
fm@2163
  1719
    ].
fm@2163
  1720
    lastNameSpace := nameSpace.
fm@2163
  1721
!
fm@2163
  1722
fm@2327
  1723
changeLastPackage
fm@2327
  1724
fm@2327
  1725
    |package defaultPackage|
fm@2327
  1726
fm@2327
  1727
    lastPackage notNil ifTrue:[defaultPackage := lastPackage].
fm@2327
  1728
    package := Dialog
cg@2434
  1729
	    requestProject:'Package:'
cg@2434
  1730
	    initialAnswer:defaultPackage
cg@2434
  1731
	    suggestions:#('foo' 'bar' 'baz').
fm@2327
  1732
    package isNil ifTrue:[
cg@2434
  1733
	^ self "/ Dialog information:(resources string:'No such package exists.')
fm@2327
  1734
    ].
fm@2327
  1735
    lastPackage := package.
fm@2327
  1736
!
fm@2327
  1737
cg@2015
  1738
extractTranslationsFromClass
cg@2015
  1739
    |aClass newTranslations|
cg@2015
  1740
cg@2434
  1741
    aClass := Dialog
cg@2434
  1742
		requestClass:'Class to extract translations from:'
cg@2434
  1743
		okLabel:'OK'
cg@2434
  1744
		initialAnswer:(lastExtractedClass ? LastExtractedClass).
cg@2015
  1745
    aClass isNil ifTrue:[^ self ].
cg@2015
  1746
cg@2015
  1747
    lastExtractedClass := LastExtractedClass := aClass.
cg@2015
  1748
cg@2032
  1749
    newTranslations := self extractTranslationsFromClass:aClass.
cg@2032
  1750
    self addAllTranslations:newTranslations.
cg@2032
  1751
!
cg@2032
  1752
fm@2163
  1753
extractTranslationsFromNameSpace
fm@2163
  1754
fm@2163
  1755
    |newTranslations|
fm@2163
  1756
fm@2163
  1757
    self changeLastNameSpace.
fm@2163
  1758
    lastNameSpace isNil ifTrue:[^self.].
fm@2163
  1759
    newTranslations := OrderedCollection new.
fm@2163
  1760
    lastNameSpace allClassesDo:[:eachClass |
cg@2434
  1761
	newTranslations addAll:( self extractTranslationsFromClass:eachClass theNonMetaclass).
fm@2163
  1762
    ].
fm@2163
  1763
    self addAllTranslations:newTranslations.
fm@2163
  1764
!
fm@2163
  1765
cg@2032
  1766
extractTranslationsFromProject
jan@3189
  1767
    |projectID newTranslations|
cg@2032
  1768
jan@3187
  1769
    projectID := Dialog requestProject:(resources string:'Package to extract translations from:') initialAnswer:(lastExtractedProject ? LastExtractedProject) suggestions:(lastExtractedProject ? LastExtractedProject).
cg@2032
  1770
    projectID notNil ifTrue:[
jan@3187
  1771
        projectID := projectID withoutSeparators asSymbol.
cg@2032
  1772
    ].
cg@2032
  1773
    projectID isEmptyOrNil ifTrue:[^ self ].
cg@2032
  1774
cg@2032
  1775
    lastExtractedProject := LastExtractedProject := projectID.
cg@2032
  1776
cg@2015
  1777
    newTranslations := Set new.
cg@3282
  1778
    self withWaitCursorDo:[
cg@3282
  1779
        Smalltalk allClassesDo:[:eachClass |
cg@3282
  1780
            eachClass theNonMetaclass instAndClassMethodsDo:[:eachMethod |
cg@3282
  1781
                eachMethod package == projectID ifTrue:[ 
cg@3282
  1782
                    newTranslations addAll:( self extractTranslationsFromMethod:eachMethod ).
cg@3282
  1783
                ]
cg@3282
  1784
            ].
jan@3189
  1785
        ].
cg@3282
  1786
cg@3282
  1787
        self addAllTranslations:newTranslations.
cg@2015
  1788
    ].
cg@3282
  1789
    
jan@3189
  1790
    "Modified: / 19-02-2015 / 11:44:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
jan@3189
  1791
!
jan@3189
  1792
jan@3189
  1793
generateMissingTranslations: keys for: languages using: translator    
jan@3189
  1794
    keys do:[:string |
jan@3189
  1795
        languages do:[:lang | 
jan@3189
  1796
            | translation |
jan@3189
  1797
jan@3189
  1798
            translation := keyStringsToLanguageMappings at:string language:lang.
jan@3189
  1799
            translation isNil ifTrue:[ 
jan@3189
  1800
                translation := translator value: lang value: string.
jan@3189
  1801
                translation notNil ifTrue:[ 
jan@3189
  1802
                    keyStringsToLanguageMappings at: string language: lang put: translation.  
jan@3189
  1803
                ].
jan@3189
  1804
            ].
jan@3189
  1805
        ].
jan@3189
  1806
    ].
jan@3189
  1807
jan@3189
  1808
    "Created: / 19-02-2015 / 12:31:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
jan@3189
  1809
!
jan@3189
  1810
jan@3189
  1811
generateMissingTranslationsFor: languages
jan@3189
  1812
    self 
jan@3189
  1813
        generateMissingTranslations: keyStringsToLanguageMappings keys
jan@3189
  1814
                                for: languages
jan@3189
  1815
                              using: [ :lang :string | '**%1** %2' bindWith: lang asUppercase with: string ]
jan@3189
  1816
jan@3189
  1817
    "Created: / 19-02-2015 / 12:39:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
jan@3189
  1818
!
jan@3189
  1819
jan@3189
  1820
generateMissingTranslationsForAll
jan@3189
  1821
    self generateMissingTranslationsFor: keyStringsToLanguageMappings languages
jan@3189
  1822
jan@3189
  1823
    "Created: / 19-02-2015 / 12:40:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cg@2015
  1824
!
cg@2015
  1825
fm@2327
  1826
importExistingTranslationsFromFile
cg@2410
  1827
    self information:'The import function is not available in this release'.
fm@2327
  1828
!
fm@2327
  1829
fm@2163
  1830
inspectCanvasMissingStrings
fm@2163
  1831
fm@2163
  1832
    |spec nameSpace missingStrings|
fm@2163
  1833
fm@2163
  1834
    missingStrings := OrderedCollection new.
fm@2163
  1835
    nameSpace := Dialog requestNameSpace:'NameSpace:' title:'Specify NameSpace to look for missing strings' initialAnswer:nil.
fm@2163
  1836
    nameSpace := Smalltalk at:nameSpace asSymbol.
fm@2163
  1837
    nameSpace isNil ifTrue:[
cg@2434
  1838
	^Dialog information:(resources string:'No such nameSpace exists.?')
fm@2163
  1839
    ].
fm@2163
  1840
fm@2163
  1841
    nameSpace allClassesDo:[:cls |
cg@2434
  1842
	cls theMetaclass methodsDo:[:m |
cg@2434
  1843
	    m hasResource ifTrue:[
cg@2434
  1844
		(m resources includesKey:#canvas) ifTrue:[
cg@2434
  1845
		    spec := (cls perform:m selector) decodeAsLiteralArray.
cg@2434
  1846
		    spec do:[:eachComponent |
cg@2434
  1847
			eachComponent translationKeysDo:[:k |
cg@2434
  1848
			    (self includesKey: k) ifFalse:[
cg@2434
  1849
				missingStrings add: k.
cg@2434
  1850
				Transcript showCR: k storeString, '                         ', m printString]]
cg@2434
  1851
		    ]
cg@2434
  1852
		]
cg@2434
  1853
	    ]
cg@2434
  1854
	]
fm@2163
  1855
    ].
fm@2163
  1856
    missingStrings asSet inspect
fm@2163
  1857
!
fm@2163
  1858
cg@2015
  1859
menuNew
cg@2015
  1860
    modified ifTrue:[
cg@2434
  1861
	(Dialog
cg@2434
  1862
	    confirm:(resources stringWithCRs:'Modified translations have not been changed.\\Create new translations set anyway ?')
cg@2434
  1863
	    default:false) ifFalse:[^ self].
cg@2015
  1864
    ].
cg@2015
  1865
cg@2015
  1866
    keyStringsToLanguageMappings initialize.
cg@2015
  1867
    keyStringsToLanguageMappings changed.
cg@2015
  1868
cg@2015
  1869
    self languagesList contents:self keyStringAndLanguageSelectionTable languages.
cg@2015
  1870
    self shownLanguages contents:self keyStringAndLanguageSelectionTable languages.
cg@2015
  1871
    modified := false.
cg@2015
  1872
!
cg@2015
  1873
cg@2015
  1874
menuOpen
fm@2050
  1875
    |aFilename|
cg@2015
  1876
fm@2163
  1877
    self withWaitCursorDo:[
cg@2434
  1878
	aFilename := self requestFilename.
cg@2434
  1879
	aFilename isNil ifTrue:[^ self ].
cg@2434
  1880
	self readResourceFile:aFilename.
fm@2163
  1881
    ]
cg@2015
  1882
!
cg@2015
  1883
cg@2410
  1884
menuOpenByPackage
cg@2410
  1885
    |package|
cg@2410
  1886
cg@2410
  1887
    self withWaitCursorDo:[
cg@2434
  1888
	package := self requestPackage.
cg@2434
  1889
	package isNil ifTrue:[^ self ].
cg@2434
  1890
	self readResourceFileForPackage:package.
cg@2410
  1891
    ]
cg@2410
  1892
!
cg@2410
  1893
cg@2015
  1894
menuSave
fm@2050
  1895
"Saves the language selected in the fileName from where the language resource was obtained."
fm@2053
  1896
    |lang|
cg@2015
  1897
fm@2327
  1898
    lang := self requestLanguageToSave.
fm@2050
  1899
    lang isNil ifTrue:[^ self].
fm@2053
  1900
    self saveLanguage: lang
fm@2053
  1901
!
fm@2053
  1902
fm@2053
  1903
menuSaveAll
fm@2053
  1904
"Saves all the languages in the fileName from where the language resource was obtained."
cg@2434
  1905
    keyStringsToLanguageMappings languagesInUse do:[:each | self saveLanguage: each].
cg@2015
  1906
!
cg@2015
  1907
cg@2015
  1908
menuSaveAs
fm@2050
  1909
"Saves the language selected in the specified fileName."
fm@2050
  1910
     |lang aFilename|
cg@2015
  1911
fm@2327
  1912
    lang := self requestLanguageToSave.
cg@2434
  1913
    lang isNil ifTrue:[^ self].
fm@2053
  1914
    aFilename := self requestFilenameFor:lang.
fm@2050
  1915
    aFilename isNil ifTrue:[^ self].
fm@2050
  1916
    self saveResourceFile:aFilename for:lang asSymbol
cg@2015
  1917
!
cg@2015
  1918
cg@2015
  1919
openAboutThisApplication
cg@2015
  1920
    "This method was generated by the Browser.
cg@2015
  1921
     It will be invoked when the menu-item 'help-about' is selected."
cg@2015
  1922
cg@2015
  1923
    "/ could open a customized aboutBox here ...
cg@2015
  1924
    super openAboutThisApplication
cg@2015
  1925
!
cg@2015
  1926
cg@2015
  1927
openDocumentation
cg@2015
  1928
    "This method was generated by the Browser.
cg@2015
  1929
     It will be invoked when the menu-item 'help-documentation' is selected."
cg@2015
  1930
cg@2015
  1931
    "/ change below as required ...
cg@2015
  1932
cg@2015
  1933
    "/ to open an HTML viewer on some document (under 'doc/online/<language>/' ):
cg@2413
  1934
    HTMLDocumentView openFullOnDocumentationFile:'tools/languageEditor/TOP.html'.
cg@2015
  1935
cg@2015
  1936
    "/ add application-specific help files under the 'doc/online/<language>/help/appName'
cg@2015
  1937
    "/ directory, and open a viewer with:
cg@2015
  1938
    "/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
cg@2015
  1939
!
cg@2015
  1940
cg@2015
  1941
readResourceFile:aFilename
cg@2031
  1942
    |lang|
cg@2031
  1943
fm@2327
  1944
    lang := self requestLanguage.
cg@2031
  1945
    lang isNil ifTrue:[^ self ].
cg@2031
  1946
cg@2031
  1947
    self readResourceFile:aFilename asLanguage:lang asSymbol
cg@2031
  1948
!
cg@2031
  1949
cg@2410
  1950
readResourceFileForPackage:aPackage
cg@2410
  1951
    |allLanguages lang packageDir resourceDir langFile|
cg@2410
  1952
cg@2410
  1953
    packageDir := Smalltalk packageDirectoryForPackageId:aPackage.
cg@2410
  1954
    resourceDir := packageDir asFilename construct:'resources'.
cg@2410
  1955
cg@2410
  1956
    allLanguages := Set new.
cg@2410
  1957
    resourceDir directoryContentsAsFilenamesDo:[:eachFile |
cg@2434
  1958
	eachFile suffix = 'rs' ifTrue:[
cg@2434
  1959
	    (('##.rs' match:eachFile baseName)
cg@2434
  1960
	    or:[('##-##.rs' match:eachFile baseName)]) ifTrue:[
cg@2434
  1961
		allLanguages add:(eachFile withoutSuffix baseName)
cg@2434
  1962
	    ].
cg@2434
  1963
	].
cg@2410
  1964
    ].
cg@2410
  1965
cg@2410
  1966
    allLanguages addAll:languagesList.
cg@2410
  1967
    allLanguages := allLanguages asSortedCollection.
cg@2410
  1968
cg@2434
  1969
    lang := Dialog
cg@2434
  1970
	choose:(resources string:'For which language ?')
cg@2434
  1971
	fromList:allLanguages
cg@2434
  1972
	values:allLanguages
cg@2434
  1973
	buttons:(resources array:#('All'))
cg@2434
  1974
	values:#(all)
cg@2434
  1975
	lines:10
cg@2434
  1976
	cancel:nil.
cg@2410
  1977
cg@2410
  1978
    lang isNil ifTrue:[^ self ].
cg@2410
  1979
cg@2410
  1980
    langFile := resourceDir construct:lang,'.rs'.
cg@2410
  1981
cg@2410
  1982
    lang == #all ifTrue:[
cg@2434
  1983
	allLanguages do:[:lang |
cg@2434
  1984
	    self addLanguage:lang.
cg@2434
  1985
	    self readResourceFile:(resourceDir construct:lang,'.rs') asLanguage:lang.
cg@2434
  1986
	].
cg@2410
  1987
    ] ifFalse:[
cg@2434
  1988
	self readResourceFile:langFile asLanguage:lang asSymbol
cg@2410
  1989
    ].
cg@2410
  1990
!
cg@2410
  1991
fm@2050
  1992
removeLanguage
sv@3246
  1993
    |languagesToRemove|
sv@3246
  1994
sv@3246
  1995
    languagesToRemove := Dialog chooseMultiple:'Which language(s) do you want to remove?' fromList:languagesList lines:10.
sv@3246
  1996
    languagesToRemove isEmptyOrNil ifTrue:[^ self ].
sv@3246
  1997
    (Dialog confirm: 'Are you sure to remove the languages: ', languagesToRemove printString) ifTrue:[
sv@3246
  1998
          self languagesList removeAll:languagesToRemove.
sv@3246
  1999
          self shownLanguages removeAll:languagesToRemove.
cg@2434
  2000
    ].
cg@2015
  2001
!
cg@2015
  2002
cg@2015
  2003
removeTranslation
cg@2015
  2004
    |rowSelectionIndex selectedKey|
cg@2015
  2005
cg@2015
  2006
    rowSelectionIndex := self selectedKeyRow value.
fm@2163
  2007
    rowSelectionIndex isNil ifTrue:[^self].
cg@2015
  2008
    rowSelectionIndex ~~ 0 ifTrue:[
cg@2434
  2009
	selectedKey := keyStringsToLanguageMappings keyAt:rowSelectionIndex ifAbsent:nil.
cg@2434
  2010
	selectedKey isNil ifTrue:[^self].
cg@2434
  2011
	(Dialog confirm:(resources string:'Really remove key %1' with:selectedKey)) ifTrue:[
cg@2434
  2012
	    keyStringsToLanguageMappings removeKey:selectedKey.
cg@2434
  2013
	].
cg@2015
  2014
    ].
cg@2015
  2015
!
cg@2015
  2016
cg@2015
  2017
runApplicationAndCollectTranslations
cg@2047
  2018
    |applicationClass newTranslations pseudoPack app startSelector|
cg@2015
  2019
cg@2015
  2020
    monitoredApplication notNil ifTrue:[
cg@3286
  2021
        monitoredApplication terminate.
cg@3286
  2022
        [monitoredApplication notNil] whileTrue:[
cg@3286
  2023
            Delay waitForSeconds:0.1
cg@3286
  2024
        ].
cg@2015
  2025
    ].
cg@2015
  2026
cg@2434
  2027
    applicationClass := Dialog
cg@3286
  2028
                requestClass:'Application class to start and collect translations from:'
cg@3286
  2029
                okLabel:'OK'
cg@3286
  2030
                initialAnswer:(lastExtractedApplicationClass ? LastExtractedApplicationClass ).
cg@2015
  2031
    applicationClass isNil ifTrue:[^ self ].
cg@3286
  2032
    applicationClass isNameSpace ifTrue:[
cg@3286
  2033
        Dialog warn:'Entered class is a NameSpace'.
cg@3286
  2034
        ^ self.
cg@2047
  2035
    ].
cg@2047
  2036
cg@2047
  2037
    applicationClass isVisualStartable ifTrue:[
cg@3286
  2038
        startSelector := #open
cg@2047
  2039
    ] ifFalse:[
cg@3286
  2040
        startSelector := Dialog
cg@3286
  2041
                    request:'Entered class seems to be no application class. Ok to start using selector:'
cg@3286
  2042
                    initialAnswer:((applicationClass respondsTo:#'start')
cg@3286
  2043
                                        ifTrue:#'start'
cg@3286
  2044
                                        ifFalse:#'new')
cg@3286
  2045
                    okLabel:'START'
cg@3286
  2046
                    title:'Start Application'.
cg@3286
  2047
        startSelector isNil ifTrue:[
cg@3286
  2048
            ^ self
cg@3286
  2049
        ].
cg@3286
  2050
        startSelector := startSelector asSymbol.
cg@2047
  2051
    ].
cg@2015
  2052
cg@2015
  2053
    lastExtractedApplicationClass := LastExtractedApplicationClass := applicationClass.
cg@2015
  2054
cg@2015
  2055
    newTranslations := Set new.
cg@2015
  2056
cg@2015
  2057
    pseudoPack := AccessCollectingPseudoResourcePack new.
cg@2015
  2058
    pseudoPack realResourcePack:(applicationClass classResources).
cg@3286
  2059
    pseudoPack watchingTranslationEditor:self.
cg@2015
  2060
cg@2015
  2061
    self stopApplicationIconVisibleHolder value:true.
cg@2015
  2062
cg@3286
  2063
    monitoredApplication := 
cg@3286
  2064
        [
cg@3286
  2065
            [
cg@3286
  2066
                app := applicationClass new.
cg@3286
  2067
                app resources:pseudoPack.
cg@3286
  2068
                
cg@3286
  2069
                app perform:startSelector.
cg@3286
  2070
                app window waitUntilVisible.
cg@3286
  2071
                app window waitUntilClosed.
cg@3286
  2072
            ] ensure:[
cg@3286
  2073
                app closeRequest.
cg@3286
  2074
                self stopApplicationIconVisibleHolder value:false.
cg@3286
  2075
                monitoredApplication := nil.
cg@3286
  2076
            ].
cg@3286
  2077
        ] fork.
fm@2163
  2078
!
fm@2163
  2079
fm@2163
  2080
searchStringInLastNameSpace
fm@2163
  2081
fm@2323
  2082
    |selectedKey browser lastSearchPatterns|
fm@2163
  2083
fm@2163
  2084
    selectedKey := self selectedKey.
fm@2163
  2085
    selectedKey isNil ifTrue:[^Dialog information: 'No selected key'].
fm@2163
  2086
    browser := NewSystemBrowser new "open".
fm@2163
  2087
    browser allButOpen.
fm@2323
  2088
    lastSearchPatterns := browser lastSearchPatterns.
fm@2323
  2089
    (lastSearchPatterns notNil and:[lastSearchPatterns first ~= selectedKey]) ifTrue:[
cg@2434
  2090
	browser lastSearchPatterns addFirst: selectedKey
fm@2163
  2091
    ].
fm@2327
  2092
    SearchDialog lastStringSearchArea: #currentNameSpace.
fm@2163
  2093
    lastNameSpace isNil ifTrue:[
cg@2434
  2094
	self changeLastNameSpace.
fm@2163
  2095
    ].
fm@2163
  2096
    lastNameSpace notNil ifTrue:[
fm@2163
  2097
"/        browser navigationState selectedClasses value: lastNameSpace allClasses.
cg@2434
  2098
	browser navigationState nameSpaceFilter value: (OrderedCollection with:lastNameSpace name).
cg@2434
  2099
	browser navigationState selectedNamespaces value: (OrderedCollection with:lastNameSpace name).
fm@2163
  2100
    ].
fm@2163
  2101
    self withWaitCursorDo:[
cg@2434
  2102
	browser browseMenuMethodsWithString
fm@2163
  2103
    ].
fm@2327
  2104
!
fm@2327
  2105
fm@2327
  2106
searchStringInLastPackage
fm@2327
  2107
fm@2327
  2108
    | selectedKey browser lastSearchPatterns|
fm@2327
  2109
fm@2327
  2110
    selectedKey := self selectedKey.
cg@3286
  2111
    selectedKey isNil ifTrue:[^ Dialog information: 'No selected key'].
cg@3286
  2112
fm@2327
  2113
    browser := NewSystemBrowser new "open".
fm@2327
  2114
    browser allButOpen.
cg@3286
  2115
    
fm@2327
  2116
    lastSearchPatterns := browser lastSearchPatterns.
fm@2327
  2117
    (lastSearchPatterns notNil and:[lastSearchPatterns first ~= selectedKey]) ifTrue:[
cg@3286
  2118
        browser lastSearchPatterns addFirst: selectedKey
fm@2327
  2119
    ].
fm@2327
  2120
    SearchDialog lastStringSearchArea: #currentPackage.
fm@2327
  2121
    lastPackage isNil ifTrue:[
cg@3286
  2122
        self changeLastPackage.
fm@2327
  2123
    ].
fm@2327
  2124
    lastPackage notNil ifTrue:[
fm@2327
  2125
"/        browser navigationState selectedClasses value: lastNameSpace allClasses.
cg@3286
  2126
        browser navigationState packageFilter value: (OrderedCollection with:lastPackage).
cg@3286
  2127
        browser navigationState selectedProjects value: (OrderedCollection with:lastPackage).
fm@2327
  2128
    ].
fm@2327
  2129
    self withWaitCursorDo:[
cg@3286
  2130
        browser 
cg@3286
  2131
            askForMethodAndSpawnSearchTitle:'String to Search for in Sources:'
cg@3286
  2132
            browserLabel:'Methods containing "%1"'
cg@3286
  2133
            searchWith:#( #'findString:in:ignoreCase:match:' #'findString:inMethods:ignoreCase:match:' )
cg@3286
  2134
            searchWhat:#string
cg@3286
  2135
            searchArea:#currentPackage
cg@3286
  2136
            withCaseIgnore:false
cg@3286
  2137
            withTextEntry:false
cg@3286
  2138
            withMatch:true
cg@3286
  2139
            withMethodList:false
cg@3286
  2140
            setSearchPattern:[:brwsr :string :ignoreCase :doMatch|
cg@3286
  2141
                                brwsr autoSearchPattern:string ignoreCase:ignoreCase.
cg@3286
  2142
                             ]
cg@3286
  2143
            initialText:selectedKey "/ does not work: ('''*',selectedKey,'*''') check match!!               
fm@2327
  2144
    ].
cg@2015
  2145
! !
cg@2015
  2146
cg@2015
  2147
!InternationalLanguageTranslationEditor methodsFor:'menus dynamic'!
cg@2015
  2148
cg@2015
  2149
disableLanguageDisplayFor:lang
cg@2015
  2150
    self shownLanguages remove:lang ifAbsent:[]
cg@2015
  2151
!
cg@2015
  2152
cg@2015
  2153
enableLanguageDisplayFor:newLang
cg@2015
  2154
    |shownLanguagesInOrder|
cg@2015
  2155
cg@2015
  2156
    (self shownLanguages includes:newLang) ifFalse:[
cg@2048
  2157
"/        shownLanguagesInOrder := self languagesList
cg@2048
  2158
"/                                    select:[:lang | (self shownLanguages includes:lang)
cg@2048
  2159
"/                                                    or:[ lang = newLang ]].
cg@2048
  2160
"/        self shownLanguages contents:shownLanguagesInOrder.
cg@2434
  2161
	self shownLanguages add:newLang.
cg@2015
  2162
    ]
cg@2015
  2163
!
cg@2015
  2164
cg@2015
  2165
isLanguageShown:lang
cg@2015
  2166
    ^ self shownLanguages includes:lang
cg@2015
  2167
!
cg@2015
  2168
jan@3189
  2169
menuSliceTranslateGenerate
jan@3189
  2170
    | menu |
jan@3189
  2171
jan@3189
  2172
    menu := Menu new.
jan@3189
  2173
    keyStringsToLanguageMappings notNil ifTrue:[ 
jan@3189
  2174
        keyStringsToLanguageMappings languages do:[:lang | 
jan@3189
  2175
            menu addItem:   
jan@3189
  2176
                (MenuItem
jan@3189
  2177
                    label: (resources string: 'Generate Missing Translations - %1' with: lang asUppercase)
jan@3189
  2178
                    itemValue: [ self generateMissingTranslationsFor: (Array with: lang) ])
jan@3189
  2179
        ].
jan@3189
  2180
    ].
jan@3189
  2181
    ^ menu
jan@3189
  2182
jan@3189
  2183
    "Created: / 19-02-2015 / 12:44:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
jan@3189
  2184
!
jan@3189
  2185
cg@2015
  2186
shownLanguagesMenu
cg@2015
  2187
    <resource: #programMenu >
cg@2015
  2188
cg@2015
  2189
    ^ [
cg@2434
  2190
	|m selected|
cg@2434
  2191
cg@2434
  2192
	m := Menu new.
cg@2434
  2193
cg@2434
  2194
	self languagesList do:[:lang |
cg@2434
  2195
	    |item|
cg@2434
  2196
cg@2434
  2197
	    item := MenuItem label:lang.
cg@2434
  2198
	    item indication:(self languageShownHolderFor:lang).
cg@2434
  2199
	    item hideMenuOnActivated:false.
cg@2434
  2200
	    m addItem:item.
cg@2434
  2201
	].
cg@2434
  2202
	m
cg@2015
  2203
    ].
cg@2015
  2204
!
cg@2015
  2205
cg@2015
  2206
toggleLanguageDisplayFor:lang
cg@2015
  2207
    (self shownLanguages includes:lang) ifTrue:[
cg@2434
  2208
	self disableLanguageDisplayFor:lang
cg@2015
  2209
    ] ifFalse:[
cg@2434
  2210
	self enableLanguageDisplayFor:lang
cg@2015
  2211
    ].
cg@2015
  2212
! !
cg@2015
  2213
cg@2015
  2214
!InternationalLanguageTranslationEditor methodsFor:'private-key extraction'!
cg@2015
  2215
cg@2032
  2216
addAllTranslations:newTranslations
cg@3286
  2217
    "merge found xlations into the list of already present xlations"
cg@3286
  2218
    
cg@2034
  2219
    |newTranslationKeys stringKeys nonStringKeys|
cg@2032
  2220
sv@3245
  2221
    newTranslationKeys := newTranslations select:[:k | k notEmptyOrNil and:[k isString not or:[k isBlank not]]].
cg@2032
  2222
    newTranslationKeys := newTranslationKeys select:[:k | (keyStringsToLanguageMappings includesKey:k) not].
cg@3286
  2223
    "/ follow the common-xlations algrithm of ResourcePack
cg@3286
  2224
    "/ (which knows how to xlate strings with additional special chars.)
cg@3286
  2225
    newTranslationKeys := 
cg@3286
  2226
        newTranslationKeys collect:[:oldKey |
cg@3286
  2227
            |newKey methods|
cg@3286
  2228
            
cg@3286
  2229
            (oldKey endsWith:' ...') ifTrue:[
cg@3286
  2230
                newKey := oldKey copyButLast:4.
cg@3286
  2231
            ] ifFalse:[ (oldKey endsWith:'...') ifTrue:[
cg@3286
  2232
                newKey := oldKey copyButLast:3.
cg@3286
  2233
            ] ifFalse:[ ('\.:?=,!! ' includes:oldKey last) ifTrue:[
cg@3286
  2234
                newKey := oldKey copyButLast:1.
cg@3286
  2235
            ] ifFalse:[ ((oldKey first == $() and:[ oldKey last == $) ]) ifTrue:[
cg@3286
  2236
                newKey := oldKey copyFrom:2 to:oldKey size - 1
cg@3286
  2237
            ] ifFalse:[ ((oldKey first == $[) and:[ oldKey last == $] ]) ifTrue:[
cg@3286
  2238
                newKey := oldKey copyFrom:2 to:oldKey size - 1
cg@3286
  2239
            ] ifFalse:[
cg@3286
  2240
                newKey :=oldKey
cg@3286
  2241
            ]]]]].
cg@3286
  2242
            "/ must attach oldKey-methods to newKey
cg@3286
  2243
            methods := methodsUsingKey at:oldKey ifAbsent:nil.
cg@3286
  2244
            methods notNil ifTrue:[
cg@3286
  2245
                (methodsUsingKey at:newKey ifAbsentPut:[Set new]) addAll:methods
cg@3286
  2246
            ].    
cg@3286
  2247
            newKey
cg@3286
  2248
        ].
cg@3286
  2249
        
cg@2034
  2250
    newTranslationKeys := newTranslationKeys asSet.
sv@3246
  2251
    newTranslationKeys := newTranslationKeys select:[:k | (keyStringsToLanguageMappings includesKey:k) not].
cg@2034
  2252
cg@2032
  2253
    newTranslationKeys notEmpty ifTrue:[
cg@3077
  2254
        stringKeys := newTranslationKeys select:[:k | k isString].
cg@3077
  2255
        nonStringKeys := newTranslationKeys select:[:k | k isString not].
cg@3077
  2256
cg@3077
  2257
        stringKeys := stringKeys asSortedCollection.
cg@3077
  2258
        keyStringsToLanguageMappings addKeys:stringKeys.
cg@3077
  2259
        keyStringsToLanguageMappings addKeys:nonStringKeys.
cg@3077
  2260
        modified := true.
cg@2032
  2261
    ].
cg@2032
  2262
!
cg@2032
  2263
cg@2032
  2264
extractTranslationsFromClass:aClass
cg@2032
  2265
    |newTranslations|
cg@2032
  2266
cg@2032
  2267
    newTranslations := Set new.
cg@2032
  2268
cg@2032
  2269
    self withWaitCursorDo:[
sv@3248
  2270
        "/ now, the hard part:
sv@3248
  2271
        "/ possible translations are in the specs,
sv@3248
  2272
        "/ and all arguments to (resources string:) messages.
sv@3248
  2273
        aClass instAndClassMethodsDo:[:eachMethod |
sv@3248
  2274
            newTranslations addAll:( self extractTranslationsFromMethod:eachMethod ).
sv@3248
  2275
        ].
sv@3248
  2276
    ].
cg@3286
  2277
    
cg@3286
  2278
    newTranslations := 
cg@3286
  2279
        newTranslations select:[:eachTranslation|
cg@3286
  2280
            (aClass resources at:eachTranslation ifAbsent:nil) isNil
cg@3286
  2281
        ].
cg@2032
  2282
    ^ newTranslations
cg@2032
  2283
!
cg@2032
  2284
cg@2015
  2285
extractTranslationsFromHelpSpecMethod:aMethod
cg@3286
  2286
    "return strings which need translation from a help-spec method"
cg@3286
  2287
cg@2015
  2288
    |codeStrings matcher parseTree resourceKeys|
cg@2015
  2289
cg@2434
  2290
    parseTree := RBParser
sv@3245
  2291
            parseMethod:aMethod source
sv@3245
  2292
            onError: [:str :pos | Transcript showCR:str. Transcript showCR:pos.
sv@3245
  2293
                                  nil].
cg@2015
  2294
    parseTree isNil ifTrue:[^ #() ].
cg@2015
  2295
cg@2434
  2296
    codeStrings  :=
sv@3245
  2297
        #(
sv@3245
  2298
                '`@dict addPairsFrom: `#helpKeysAndStrings'
cg@3283
  2299
                '^ `#lit'
sv@3245
  2300
        ).
cg@2015
  2301
cg@2015
  2302
    resourceKeys := Set new.
cg@2015
  2303
cg@2015
  2304
    matcher := ParseTreeSearcher new.
cg@2434
  2305
    matcher
sv@3245
  2306
        matchesAnyOf: codeStrings
sv@3245
  2307
        do: [:aNode :answer |
sv@3245
  2308
                |sel argNode arg|
sv@3245
  2309
cg@3283
  2310
                aNode isReturn ifTrue:[
cg@3283
  2311
                    "/ a ^ #(...)
cg@3283
  2312
                    aNode value isLiteralArray ifTrue:[
cg@3283
  2313
                        aNode value value pairWiseDo:[:helpKey :helpString |
cg@3286
  2314
                            self rememberMethod:aMethod usingKey:helpString.
cg@3283
  2315
                            resourceKeys add:helpString.
cg@3283
  2316
                        ].
cg@3283
  2317
                    ].    
cg@3283
  2318
                ] ifFalse:[    
cg@3283
  2319
                    sel := aNode selector.
cg@3283
  2320
                    (sel startsWith:'addPairsFrom:') ifTrue:[
cg@3283
  2321
                        argNode := aNode arguments at:1.
cg@3286
  2322
                        argNode isLiteralArray ifTrue:[
cg@3283
  2323
                            arg := argNode value.
cg@3286
  2324
                            arg doWithIndex:[:el :index |
cg@3286
  2325
                                index even ifTrue:[
cg@3286
  2326
                                    el isString ifTrue:[
cg@3286
  2327
                                        self rememberMethod:aMethod usingKey:el.
cg@3286
  2328
                                        resourceKeys add:el.
cg@3286
  2329
                                    ]
sv@3245
  2330
                                ].
sv@3245
  2331
                            ].
sv@3245
  2332
                        ] ifFalse:[
cg@3283
  2333
                            Transcript halt
sv@3245
  2334
                                showCR:(resources
cg@3286
  2335
                                            string:'Cannot derive resourceKey from non-literal array: %1 in %2'
cg@3283
  2336
                                            with:argNode formattedCode
cg@3283
  2337
                                            with:aMethod selector).
sv@3245
  2338
                        ].
sv@3245
  2339
                    ].
sv@3245
  2340
                ].
sv@3245
  2341
                aNode
sv@3245
  2342
            ].
cg@2015
  2343
cg@2015
  2344
    matcher executeTree: parseTree initialAnswer: nil.
cg@2015
  2345
    ^ resourceKeys
cg@2015
  2346
!
cg@2015
  2347
cg@2015
  2348
extractTranslationsFromMenuSpecMethod:aMethod
cg@3286
  2349
    "return strings which need translation from a menu-spec method"
cg@3286
  2350
cg@2015
  2351
    |menu resourceKeys|
cg@2015
  2352
cg@2015
  2353
    menu := aMethod mclass theNonMetaclass perform:aMethod selector.
cg@2015
  2354
    menu isNil ifTrue:[ ^ #() ].
cg@2015
  2355
cg@2015
  2356
    (menu isKindOf:Menu) ifFalse:[
sv@3248
  2357
        menu := Menu new fromLiteralArrayEncoding:menu
cg@2015
  2358
    ].
cg@2015
  2359
cg@2015
  2360
    resourceKeys := Set new.
cg@2015
  2361
    menu allItemsDo:[:aMenuItem |
sv@3248
  2362
        aMenuItem translateLabel ifTrue:[
sv@3248
  2363
            (aMenuItem isSeparatorItem or:[aMenuItem isMenuSlice])  ifFalse:[
cg@3286
  2364
                self rememberMethod:aMethod usingKey:aMenuItem label.
sv@3248
  2365
                resourceKeys add:aMenuItem label.
sv@3248
  2366
            ]
sv@3248
  2367
        ]
cg@2015
  2368
    ].
cg@2015
  2369
    ^ resourceKeys
cg@2015
  2370
!
cg@2015
  2371
cg@2015
  2372
extractTranslationsFromMethod:aMethod
cg@3286
  2373
    "return strings which need translation from a method."
cg@3286
  2374
    
cg@2015
  2375
    |mResources|
cg@2015
  2376
cg@2015
  2377
    mResources := aMethod resources.
cg@2015
  2378
    mResources notNil ifTrue:[
cg@3283
  2379
        (mResources includesKey:#menu) ifTrue:[
cg@3283
  2380
             ^ self extractTranslationsFromMenuSpecMethod:aMethod.
cg@3283
  2381
        ].
cg@3283
  2382
        (mResources includesKey:#canvas) ifTrue:[
cg@3283
  2383
             ^ self extractTranslationsFromUISpecMethod:aMethod.
cg@3283
  2384
        ].
cg@3283
  2385
        (mResources includesKey:#help) ifTrue:[
cg@3283
  2386
             ^ self extractTranslationsFromHelpSpecMethod:aMethod.
cg@3283
  2387
        ].
cg@3283
  2388
        (mResources includesKey:#tableColumns) ifTrue:[
cg@3283
  2389
             ^ self extractTranslationsFromTableColumnsSpecMethod:aMethod.
cg@3283
  2390
        ].
cg@3283
  2391
cg@3283
  2392
        ^ self extractTranslationsFromSpecMethod:aMethod.
cg@2015
  2393
    ].
cg@2015
  2394
    ^ self extractTranslationsFromMethodsCode:aMethod
cg@2015
  2395
!
cg@2015
  2396
cg@2015
  2397
extractTranslationsFromMethodsCode:aMethod
cg@3286
  2398
    "return strings which need translation from a normal method.
cg@3286
  2399
     detects messages to the resource translation mechanism"
cg@3286
  2400
cg@2015
  2401
    |codeStrings matcher parseTree resourceKeys|
cg@2015
  2402
cg@2434
  2403
    parseTree := RBParser
jan@3189
  2404
            parseMethod:aMethod source
jan@3189
  2405
            onError: [:str :pos | Transcript showCR:str. Transcript showCR:pos.
jan@3189
  2406
                                  nil].
cg@2015
  2407
    parseTree isNil ifTrue:[^ #() ].
cg@2015
  2408
cg@2434
  2409
    codeStrings  :=
jan@3189
  2410
        #(
jan@3189
  2411
                'resources `@msg: `@args'
jan@3189
  2412
                'self resources `@msg: `@args'
jan@3189
  2413
                'self class resources `@msg: `@args'
cg@3284
  2414
                'self class classResources `@msg: `@args'
jan@3189
  2415
                'self classResources `@msg: `@args'
sv@3245
  2416
                '`V classResources `@msg: `@args'
jan@3189
  2417
        ).
cg@2015
  2418
cg@2015
  2419
    resourceKeys := Set new.
cg@2015
  2420
cg@2015
  2421
    matcher := ParseTreeSearcher new.
cg@2434
  2422
    matcher
jan@3189
  2423
        matchesAnyOf: codeStrings
jan@3189
  2424
        do: [:aNode :answer |
jan@3189
  2425
                |sel keyStringArgNode keyStringArg|
jan@3189
  2426
jan@3189
  2427
                sel := aNode selector.
jan@3189
  2428
                ((sel startsWith:'string:') or:[(sel startsWith:'at:') or:[sel startsWith:'stringWithCRs:']]) ifTrue:[
jan@3189
  2429
                    keyStringArgNode := aNode arguments at:1.
cg@3284
  2430
                    (keyStringArg := self literalStringOrStringConcatenation:keyStringArgNode) notNil ifTrue:[
cg@3286
  2431
                        self rememberMethod:aMethod usingKey:keyStringArg.
cg@3284
  2432
                        resourceKeys add:keyStringArg.
jan@3189
  2433
                    ] ifFalse:[
jan@3189
  2434
                        Transcript
cg@3284
  2435
                            showCR:(resources
cg@3284
  2436
                                    string:'[LanguageTranslator] warning: Cannot derive resourceKey from non-string: %1 in %2'
cg@3284
  2437
                                    with:keyStringArgNode formattedCode
cg@3284
  2438
                                    with:aMethod whoString).
jan@3189
  2439
                    ].
jan@3189
  2440
                ].
jan@3189
  2441
                aNode
jan@3189
  2442
            ].
cg@2015
  2443
cg@2015
  2444
    matcher executeTree: parseTree initialAnswer: nil.
cg@2015
  2445
    ^ resourceKeys
jan@3189
  2446
jan@3189
  2447
    "Modified: / 19-02-2015 / 11:42:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cg@2015
  2448
!
cg@2015
  2449
cg@2015
  2450
extractTranslationsFromSpecMethod:aMethod
cg@2015
  2451
    ^ #()
cg@2015
  2452
!
cg@2015
  2453
cg@2015
  2454
extractTranslationsFromTableColumnsSpecMethod:aMethod
cg@3286
  2455
    "return strings which need translation from a table-spec method"
cg@3286
  2456
cg@2015
  2457
    |columnDescription resourceKeys|
cg@2015
  2458
cg@2015
  2459
    columnDescription := aMethod mclass theNonMetaclass perform:aMethod selector.
cg@2015
  2460
    columnDescription isNil ifTrue:[ ^ #() ].
cg@2015
  2461
cg@2015
  2462
    (columnDescription first isKindOf:DataSetColumnSpec) ifFalse:[
cg@3286
  2463
        columnDescription := columnDescription collect:[:el | DataSetColumnSpec new fromLiteralArrayEncoding:el].
cg@2015
  2464
    ].
cg@2015
  2465
cg@2015
  2466
    resourceKeys := Set new.
cg@2015
  2467
    columnDescription do:[:aColumnSpec |
cg@3286
  2468
        aColumnSpec translateLabel ifTrue:[
cg@3286
  2469
            self rememberMethod:aMethod usingKey:aColumnSpec label.
cg@3286
  2470
            resourceKeys add:aColumnSpec label.
cg@3286
  2471
        ]
cg@2015
  2472
    ].
cg@2015
  2473
    ^ resourceKeys
cg@2015
  2474
!
cg@2015
  2475
cg@2015
  2476
extractTranslationsFromUISpecMethod:aMethod
cg@3286
  2477
    "return strings which need translation from a UI-spec method"
cg@3286
  2478
    
cg@2015
  2479
    |spec resourceKeys visitor|
cg@2015
  2480
cg@2015
  2481
    spec := aMethod mclass theNonMetaclass perform:aMethod selector.
cg@2015
  2482
    spec isNil ifTrue:[ ^ #() ].
cg@2015
  2483
cg@2015
  2484
    (spec isKindOf:UISpecification) ifFalse:[
cg@3286
  2485
        spec := UISpecification from:spec
cg@2015
  2486
    ].
cg@2015
  2487
cg@2015
  2488
    resourceKeys := Set new.
cg@2015
  2489
cg@2015
  2490
    visitor := UISpecVisitor new.
cg@2015
  2491
    spec acceptVisitor:visitor.
cg@3286
  2492
    visitor translatedLabels do:[:each |
cg@3286
  2493
        self rememberMethod:aMethod usingKey:each.
cg@3286
  2494
    ].
cg@2015
  2495
    ^ visitor translatedLabels
cg@3284
  2496
!
cg@3284
  2497
cg@3284
  2498
literalStringOrStringConcatenation:aParseNode
cg@3284
  2499
    "nil if not a literal or a string concatenation"
cg@3284
  2500
    
cg@3284
  2501
    aParseNode isLiteralString ifTrue:[^ aParseNode value].
cg@3284
  2502
    (aParseNode isMessage and:[aParseNode selector == #,]) ifTrue:[
cg@3284
  2503
        |leftString rightString|
cg@3284
  2504
        
cg@3284
  2505
        aParseNode receiver isLiteralString ifTrue:[
cg@3284
  2506
            leftString := aParseNode receiver value
cg@3284
  2507
        ] ifFalse:[
cg@3284
  2508
            leftString := self literalStringOrStringConcatenation:aParseNode receiver.
cg@3284
  2509
        ].
cg@3284
  2510
        aParseNode arguments first isLiteralString ifTrue:[
cg@3284
  2511
            rightString := aParseNode arguments first value
cg@3284
  2512
        ] ifFalse:[
cg@3284
  2513
            rightString := self literalStringOrStringConcatenation:aParseNode arguments first.
cg@3284
  2514
        ].
cg@3284
  2515
        (leftString notNil and:[rightString notNil]) ifTrue:[
cg@3284
  2516
            ^ leftString , rightString
cg@3284
  2517
        ].
cg@3284
  2518
    ].
cg@3284
  2519
    ^ nil
cg@3286
  2520
!
cg@3286
  2521
cg@3286
  2522
recordNewTranslation:aString
cg@3286
  2523
    "called from recorder, when the monitored application does a translation"
cg@3286
  2524
    
cg@3286
  2525
    self addAllTranslations:{ aString }
cg@3286
  2526
!
cg@3286
  2527
cg@3286
  2528
rememberMethod:aMethod usingKey:aKey
cg@3286
  2529
    (methodsUsingKey at:aKey ifAbsentPut:[Set new]) add:aMethod
cg@2015
  2530
! !
cg@2015
  2531
cg@2015
  2532
!InternationalLanguageTranslationEditor methodsFor:'queries'!
cg@2015
  2533
cg@2434
  2534
autoAccept
fm@2050
  2535
fm@2050
  2536
    ^ self autoAcceptHolder value
fm@2050
  2537
!
fm@2050
  2538
cg@2434
  2539
currentExampleLanguageText
fm@2050
  2540
   "Returns the language text corresponding for the current selected key and the example language selection"
fm@2050
  2541
fm@2050
  2542
  ^self languageTextFromSelectedKeyFor: self exampleLanguageSelectionHolder value
fm@2050
  2543
!
fm@2050
  2544
fm@2051
  2545
currentLanguage
fm@2051
  2546
fm@2163
  2547
    |colSelectionIndex |
fm@2051
  2548
fm@2051
  2549
    colSelectionIndex := dataSetView selectedColIndex.
fm@2051
  2550
    ^colSelectionIndex > 1 ifTrue:[ shownLanguages at:colSelectionIndex-1 ] ifFalse:nil.
fm@2051
  2551
!
fm@2051
  2552
fm@2050
  2553
exampleLanguageByDefault
fm@2050
  2554
fm@2163
  2555
    ^self shownLanguages isEmpty
cg@2434
  2556
	ifTrue:[nil]
cg@2434
  2557
	ifFalse:[self shownLanguages first]
fm@2050
  2558
!
fm@2050
  2559
fm@2051
  2560
hasFirstRowSelection
fm@2051
  2561
    self selectedKeyRow isNil ifTrue:[^false].
fm@2051
  2562
    ^ self selectedKeyRow value > 1
fm@2051
  2563
!
fm@2051
  2564
fm@2051
  2565
hasLanguageSelection
fm@2051
  2566
    dataSetView selectedColIndex isNil ifTrue:[^false].
fm@2051
  2567
    ^ dataSetView selectedColIndex > 1
fm@2051
  2568
!
fm@2051
  2569
cg@2015
  2570
hasUnsavedChanges
cg@2015
  2571
    ^ modified
fm@2050
  2572
!
fm@2050
  2573
fm@2163
  2574
includesKey: aKey
fm@2163
  2575
    keyStringsToLanguageMappings isNil ifTrue:[^false].
fm@2163
  2576
    ^keyStringsToLanguageMappings includesKey:aKey
fm@2163
  2577
!
fm@2163
  2578
fm@2051
  2579
isSearchForSimilarTranslationEnabled
fm@2051
  2580
fm@2163
  2581
    ^self searchForSimilarTranslationEnableHolder value
fm@2051
  2582
!
fm@2051
  2583
fm@2051
  2584
languageTextFromKey: aKeyIndex for: language
cg@2434
  2585
    "Returns the language text corresponding for the aKeyIndex and the received language"
fm@2051
  2586
fm@2051
  2587
    language isNil ifTrue:[^''].
cg@2434
  2588
    ^keyStringsToLanguageMappings at: aKeyIndex language:language.
fm@2051
  2589
!
fm@2051
  2590
fm@2050
  2591
languageTextFromSelectedKeyFor: language
cg@2434
  2592
    "Returns the language text corresponding for the current selected key and the received language"
cg@2434
  2593
cg@2434
  2594
    ^self languageTextFromKey: self selectedKey for: language
fm@2051
  2595
!
fm@2051
  2596
fm@2051
  2597
shouldCopyPreviousTranslationButtonBeEnabled
cg@2434
  2598
    ^ self hasLanguageSelection
cg@2434
  2599
	and:[self hasFirstRowSelection]
fm@2051
  2600
!