@@ -168,12 +168,9 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
168
168
private appendDonateFooter ( ) {
169
169
const footer = document . createElement ( 'div' ) ;
170
170
footer . classList . add ( 'ide-updater-dialog--footer' ) ;
171
-
172
- footer . innerText = nls . localize (
173
- 'arduino/ide-updater/donateText' ,
174
- 'Open source is love'
175
- ) ;
176
- footer . appendChild ( document . createTextNode ( ',\u00A0' ) ) ;
171
+ const footerContent = document . createElement ( 'div' ) ;
172
+ footerContent . classList . add ( 'ide-updater-dialog--footer-content' ) ;
173
+ footer . appendChild ( footerContent ) ;
177
174
178
175
const footerLink = document . createElement ( 'a' ) ;
179
176
footerLink . innerText = nls . localize (
@@ -184,16 +181,31 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
184
181
footerLink . onclick = ( ) =>
185
182
this . openExternal ( 'https://www.arduino.cc/en/donate' ) ;
186
183
187
- const footerLinkIcon = document . createElement ( 'div ' ) ;
184
+ const footerLinkIcon = document . createElement ( 'span ' ) ;
188
185
footerLinkIcon . title = nls . localize (
189
186
'arduino/ide-updater/donateLinkIconTitle' ,
190
- 'donate to support us '
187
+ 'open donation page '
191
188
) ;
192
189
footerLinkIcon . classList . add ( 'ide-updater-dialog--footer-link-icon' ) ;
193
-
194
- footer . appendChild ( footerLink ) ;
195
190
footerLink . appendChild ( footerLinkIcon ) ;
196
191
192
+ const placeholderKey = '%%link%%' ;
193
+ const footerText = nls . localize (
194
+ 'arduino/ide-updater/donateText' ,
195
+ 'Open source is love, {0}' ,
196
+ placeholderKey
197
+ ) ;
198
+ const placeholder = footerText . indexOf ( placeholderKey ) ;
199
+ if ( placeholder !== - 1 ) {
200
+ const parts = footerText . split ( placeholderKey ) ;
201
+ footerContent . appendChild ( document . createTextNode ( parts [ 0 ] ) ) ;
202
+ footerContent . appendChild ( footerLink ) ;
203
+ footerContent . appendChild ( document . createTextNode ( parts [ 1 ] ) ) ;
204
+ } else {
205
+ footerContent . appendChild ( document . createTextNode ( footerText ) ) ;
206
+ footerContent . appendChild ( footerLink ) ;
207
+ }
208
+
197
209
this . controlPanel . insertAdjacentElement ( 'afterend' , footer ) ;
198
210
}
199
211
0 commit comments