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