Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395752 )

Change subject: Added i18n message for "simple upload"
......................................................................

Added i18n message for "simple upload"

Change-Id: I0a09a02c910f9dc1bda4b0ef1816640a7e8ea9b8
---
M PageForms.php
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/forminputs/PF_TextInput.php
M libs/PF_simpleupload.js
6 files changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/52/395752/2

diff --git a/PageForms.php b/PageForms.php
index f5bacc2..ccc881d 100644
--- a/PageForms.php
+++ b/PageForms.php
@@ -378,7 +378,7 @@
                ),
         'messages' => array(
                        'pf_forminputs_change_file',
-                       'upload-dialog-button-upload'
+                       'pf-simpleupload'
                ),
        ),
        'ext.pageforms.select2' => $wgPageFormsResourceTemplate + array(
diff --git a/extension.json b/extension.json
index 1748b82..4a5090a 100644
--- a/extension.json
+++ b/extension.json
@@ -302,7 +302,7 @@
                        ],
                        "messages": [
                                "pf_forminputs_change_file",
-                               "upload-dialog-button-upload"
+                               "pf-simpleupload"
                        ]
                },
                "ext.pageforms.select2": {
diff --git a/i18n/en.json b/i18n/en.json
index 0eba774..4a6196c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -215,6 +215,7 @@
        "pf_modified_input_error": "This modification should be approved or 
rejected",
        "pf_pipe_error": "\"|\" is not allowed, except within {{...}} or 
[[...]]",
        "uploadwindow": "Upload window",
+       "pf-simpleupload": "Upload",
        "pf_deletionlog": "Deletion log",
        "pf-preview-header": "Form preview",
        "pf-preview-note": "This is what the form will look like when it is in 
use:",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 43c40a2..c74a17a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -232,6 +232,7 @@
        "pf_modified_input_error": "Warning message",
        "pf_pipe_error": "An error message - if an input contains a pipe 
character (\"|\"), the pipe must be part of a link, like \"[[a|b]]\", or a call 
to a template, like \"{{c|d}}\", or a parser function, like \"{{#e:f}}\".",
        "uploadwindow": "Special page name for 
[[Special:UploadWindow]].\n\n'''This is about a window for uploading files. The 
window is not the thing being uploaded.'''",
+       "pf-simpleupload": "A button label\n{{{Identical|Upload}}}",
        "pf_deletionlog": "{{Identical|Deletion log}}",
        "pf-preview-header": "Header when previewing a form in 
Special:CreateForm",
        "pf-preview-note": "Informational message when previewing a form in 
Special:CreateForm",
diff --git a/includes/forminputs/PF_TextInput.php 
b/includes/forminputs/PF_TextInput.php
index fa11a7e..6ad9e4b 100644
--- a/includes/forminputs/PF_TextInput.php
+++ b/includes/forminputs/PF_TextInput.php
@@ -148,7 +148,7 @@
                if ( $wgPageFormsSimpleUpload ) {
                        $text = "\n" . '<img class="loading" 
style="display:none;" src="' . $wgPageFormsScriptPath . '/skins/loading.gif"/>' 
. "\n";
                        $text .= Html::input( '',
-                               wfMessage( 'upload-dialog-button-upload' 
)->escaped(),
+                               wfMessage( 'pf-simpleupload' )->escaped(),
                                'button',
                                array(
                                        'class' => 'simpleupload_btn',
diff --git a/libs/PF_simpleupload.js b/libs/PF_simpleupload.js
index 1da6ee2..0881368 100644
--- a/libs/PF_simpleupload.js
+++ b/libs/PF_simpleupload.js
@@ -22,7 +22,7 @@
                _this.parent().find( "input[type='file']" ).val('');
                input.val('');
                _this.hide();
-               _this.parent().find('.simpleupload_btn').val( mw.message( 
'upload-dialog-button-upload' ).text() );
+               _this.parent().find('.simpleupload_btn').val( mw.message( 
'pf-simpleupload' ).text() );
        });
 
        $( ".simpleupload_btn" ).click(function () {
@@ -32,7 +32,7 @@
        $( "input[type='file'].simpleupload" ).change(function(event) {
                var _this = $(this);
                var input = _this.parent().find('#' + _this.data('id'));
-               var fileToUpload = event.target.files[0]; // get (first) File 
+               var fileToUpload = event.target.files[0]; // get (first) File
                var fileName = event.target.files[0].name;
 
                var formdata = new FormData(); //see 
https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
@@ -63,13 +63,13 @@
                                        
_this.parent().find('.simpleupload_rmv_btn').show();
                                } else {
                                        window.alert("Error: " + 
data.error.info);
-                                       
_this.parent().find('.simpleupload_btn').show().val( mw.message( 
'upload-dialog-button-upload' ).text() );
+                                       
_this.parent().find('.simpleupload_btn').show().val( mw.message( 
'pf-simpleupload' ).text() );
                                        
_this.parent().find('img.loading').hide();
                                }
                        },
                        error:function( xhr,status, error ){
                                window.alert('Something went wrong! Please 
check the log for errors');
-                               
_this.parent().find('.simpleupload_btn').show().val( mw.message( 
'upload-dialog-button-upload' ).text() );
+                               
_this.parent().find('.simpleupload_btn').show().val( mw.message( 
'pf-simpleupload' ).text() );
                                _this.parent().find('img.loading').hide();
                                mw.log(error);
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/395752
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a09a02c910f9dc1bda4b0ef1816640a7e8ea9b8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to