Merge "Make LBFactorySingle call initLoadBalancer() as the others do"
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.ForeignStructuredUpload.js
index c955729..3a0a94b 100644 (file)
         */
        ForeignStructuredUpload.prototype.getText = function () {
                return this.config.format.filepage
-                       // Replace "numbered parameters" with the given information
+                       // Replace "named parameters" with the given information
                        .replace( '$DESCRIPTION', this.getDescriptions() )
                        .replace( '$DATE', this.getDate() )
                        .replace( '$SOURCE', this.getSource() )
         * @inheritdoc
         */
        ForeignStructuredUpload.prototype.getComment = function () {
-               return this.config.comment
+               var
+                       isLocal = this.target === 'local',
+                       comment = typeof this.config.comment === 'string' ?
+                               this.config.comment :
+                               this.config.comment[ isLocal ? 'local' : 'foreign' ];
+               return comment
                        .replace( '$PAGENAME', mw.config.get( 'wgPageName' ) )
                        .replace( '$HOST', location.host );
        };