Changeset 134
- Timestamp:
- 03/03/06 13:20:34 (6 years ago)
- Files:
-
- 1 modified
-
wikipedia/godmode-light/trunk/godmode-light.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wikipedia/godmode-light/trunk/godmode-light.js
r133 r134 179 179 } 180 180 return str; 181 } 182 183 // Helper function for i18n text 184 var _placeholder = /\$(\d+)/; 185 function _(text) { 186 // Additional arguments are used to replace $N placeholders in the text, 187 // starting at $1. 188 while (_placeholder.test(text)) { 189 var index = _placeholder.exec(text)[1]; 190 var replacement = '[no replacement text found]'; 191 if (index > 0 && index < arguments.length) 192 replacement = arguments[index]; 193 text = text.replace(_placeholder, replacement); 194 } 195 return text; 181 196 } 182 197 … … 288 303 for (i = l.length; i--; ) { 289 304 if (l[i].name == 'wpSummary') { 290 l[i].value = revertpage.replace(/\$1/g, gml_editor).replace(/\$2/g, gml_vandal);305 l[i].value = _(revertpage, gml_editor, gml_vandal); 291 306 } else if (l[i].name == 'wpMinoredit') { 292 307 l[i].value = '1';
