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