Tools__InternationalLanguageTranslationEditor.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:07:51 +0100
branchjv
changeset 3630 5e718e0a754e
parent 3312 84084dd13f11
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present

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