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