Tools__InternationalLanguageTranslationEditor.st
author Claus Gittinger <cg@exept.de>
Fri, 22 Feb 2019 09:51:13 +0100
changeset 3642 9b49ded14b95
parent 3641 507f252953da
child 3744 71fa6500e535
permissions -rw-r--r--
#FEATURE by cg
class: Tools::InternationalLanguageTranslationEditor
added:
#addTranslationForKey:
#selectOrAddKey:
changed: #addTranslation

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