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