Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/156094
Change subject: i18n: get rid of hardcoded 'reply' text ...................................................................... i18n: get rid of hardcoded 'reply' text Change-Id: I50dc6784ecc535654a6ac1b56ab61b32a823e309 --- M Resources.php M handlebars/compiled/flow_block_topic.handlebars.php M handlebars/compiled/flow_block_topic_reply.handlebars.php M handlebars/compiled/flow_block_topiclist.handlebars.php M handlebars/flow_block_topic_reply.handlebars M handlebars/flow_reply_form.handlebars M handlebars/flow_topic_titlebar_content.handlebars M includes/TemplateHelper.php M modules/new/components/flow-board.js M modules/new/flow-handlebars.js 10 files changed, 40 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/94/156094/1 diff --git a/Resources.php b/Resources.php index 1eeefe9..1feee2c 100644 --- a/Resources.php +++ b/Resources.php @@ -301,6 +301,7 @@ 'flow-error-http', 'flow-error-fetch-after-open-close', 'mw-ui-unsubmitted-confirm', + 'flow-reply-link', ) ) + $mobile, 'ext.flow.vendor.storer' => $flowResourceTemplate + array( diff --git a/handlebars/compiled/flow_block_topic.handlebars.php b/handlebars/compiled/flow_block_topic.handlebars.php index 8622dfe..38690ba 100644 --- a/handlebars/compiled/flow_block_topic.handlebars.php +++ b/handlebars/compiled/flow_block_topic.handlebars.php @@ -50,10 +50,16 @@ ' : '').' <span class="flow-author">'.LCRun3::ch($cx, 'l10n', Array(Array('started_with_participants',$in),Array()), 'encq').'</span> <div class="flow-topic-meta"> - <a class="mw-ui-progressive mw-ui-quiet" - data-flow-interactive-handler="activateForm" - href="#flow-post-'.htmlentities(((is_array($in) && isset($in['postId'])) ? $in['postId'] : null), ENT_QUOTES, 'UTF-8').'-form-content">'.LCRun3::ch($cx, 'l10n', Array(Array('Reply',((is_array($in) && isset($in['author'])) ? $in['author'] : null)),Array()), 'encq').'</a> - • '.LCRun3::ch($cx, 'l10n', Array(Array('comment_count',$in),Array()), 'encq').' • + '.((LCRun3::ifvar($cx, ((is_array($in['actions']) && isset($in['actions']['reply'])) ? $in['actions']['reply'] : null))) ? ' + <a href="#flow-post-'.htmlentities(((is_array($in) && isset($in['postId'])) ? $in['postId'] : null), ENT_QUOTES, 'UTF-8').'-form-content" + title="'.htmlentities(((is_array($in['actions']['reply']) && isset($in['actions']['reply']['title'])) ? $in['actions']['reply']['title'] : null), ENT_QUOTES, 'UTF-8').'" + class="mw-ui-progressive mw-ui-quiet" + data-flow-interactive-handler="activateForm">'.htmlentities(((is_array($in['actions']['reply']) && isset($in['actions']['reply']['title'])) ? $in['actions']['reply']['title'] : null), ENT_QUOTES, 'UTF-8').'</a> + • + ' : '').' + + '.LCRun3::ch($cx, 'l10n', Array(Array('comment_count',$in),Array()), 'encq').' • + '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['last_updated'])) ? $in['last_updated'] : null))) ? ' <!--span class="wikiglyph wikiglyph-speech-bubbles"></span--> '.LCRun3::ch($cx, 'timestamp', Array(Array(((is_array($in) && isset($in['last_updated'])) ? $in['last_updated'] : null),'active_ago'),Array()), 'encq').' ' : ' @@ -344,7 +350,7 @@ class="mw-ui-button mw-ui-constructive" data-flow-interactive-handler="apiRequest" data-flow-api-handler="submitReply" - data-flow-api-target="< .flow-topic">'.LCRun3::ch($cx, 'l10n', Array(Array('Reply',((is_array($in) && isset($in['author'])) ? $in['author'] : null)),Array()), 'encq').'</button> + data-flow-api-target="< .flow-topic">'.htmlentities(((is_array($in['actions']['reply']) && isset($in['actions']['reply']['title'])) ? $in['actions']['reply']['title'] : null), ENT_QUOTES, 'UTF-8').'</button> <button data-flow-api-handler="preview" data-flow-api-target="< form textarea" name="preview" diff --git a/handlebars/compiled/flow_block_topic_reply.handlebars.php b/handlebars/compiled/flow_block_topic_reply.handlebars.php index c46c466..e98aa84 100644 --- a/handlebars/compiled/flow_block_topic_reply.handlebars.php +++ b/handlebars/compiled/flow_block_topic_reply.handlebars.php @@ -53,7 +53,7 @@ data-role="content">'.LCRun3::hbch($cx, 'ifEquals', Array(Array(((is_array($cx['scopes'][0]['submitted']) && isset($cx['scopes'][0]['submitted']['postId'])) ? $cx['scopes'][0]['submitted']['postId'] : null),((is_array($in) && isset($in['postId'])) ? $in['postId'] : null)),Array()), $in, function($cx, $in) {return ''.htmlentities(((is_array($cx['scopes'][0]['submitted']) && isset($cx['scopes'][0]['submitted']['content'])) ? $cx['scopes'][0]['submitted']['content'] : null), ENT_QUOTES, 'UTF-8').'';}).'</textarea> <div class="flow-form-actions flow-form-collapsible"> - <button data-role="submit" class="mw-ui-button mw-ui-constructive mw-ui-flush-right">'.LCRun3::ch($cx, 'l10n', Array(Array('Reply',((is_array($in) && isset($in['author'])) ? $in['author'] : null)),Array()), 'encq').'</button> + <button data-role="submit" class="mw-ui-button mw-ui-constructive mw-ui-flush-right">'.htmlentities(((is_array($in['actions']['reply']) && isset($in['actions']['reply']['title'])) ? $in['actions']['reply']['title'] : null), ENT_QUOTES, 'UTF-8').'</button> <button data-flow-api-handler="preview" data-flow-api-target="< form textarea" name="preview" diff --git a/handlebars/compiled/flow_block_topiclist.handlebars.php b/handlebars/compiled/flow_block_topiclist.handlebars.php index 6a6d6a1..661f853 100644 --- a/handlebars/compiled/flow_block_topiclist.handlebars.php +++ b/handlebars/compiled/flow_block_topiclist.handlebars.php @@ -178,10 +178,16 @@ ' : '').' <span class="flow-author">'.LCRun3::ch($cx, 'l10n', Array(Array('started_with_participants',$in),Array()), 'encq').'</span> <div class="flow-topic-meta"> - <a class="mw-ui-progressive mw-ui-quiet" - data-flow-interactive-handler="activateForm" - href="#flow-post-'.htmlentities(((is_array($in) && isset($in['postId'])) ? $in['postId'] : null), ENT_QUOTES, 'UTF-8').'-form-content">'.LCRun3::ch($cx, 'l10n', Array(Array('Reply',((is_array($in) && isset($in['author'])) ? $in['author'] : null)),Array()), 'encq').'</a> - • '.LCRun3::ch($cx, 'l10n', Array(Array('comment_count',$in),Array()), 'encq').' • + '.((LCRun3::ifvar($cx, ((is_array($in['actions']) && isset($in['actions']['reply'])) ? $in['actions']['reply'] : null))) ? ' + <a href="#flow-post-'.htmlentities(((is_array($in) && isset($in['postId'])) ? $in['postId'] : null), ENT_QUOTES, 'UTF-8').'-form-content" + title="'.htmlentities(((is_array($in['actions']['reply']) && isset($in['actions']['reply']['title'])) ? $in['actions']['reply']['title'] : null), ENT_QUOTES, 'UTF-8').'" + class="mw-ui-progressive mw-ui-quiet" + data-flow-interactive-handler="activateForm">'.htmlentities(((is_array($in['actions']['reply']) && isset($in['actions']['reply']['title'])) ? $in['actions']['reply']['title'] : null), ENT_QUOTES, 'UTF-8').'</a> + • + ' : '').' + + '.LCRun3::ch($cx, 'l10n', Array(Array('comment_count',$in),Array()), 'encq').' • + '.((LCRun3::ifvar($cx, ((is_array($in) && isset($in['last_updated'])) ? $in['last_updated'] : null))) ? ' <!--span class="wikiglyph wikiglyph-speech-bubbles"></span--> '.LCRun3::ch($cx, 'timestamp', Array(Array(((is_array($in) && isset($in['last_updated'])) ? $in['last_updated'] : null),'active_ago'),Array()), 'encq').' ' : ' @@ -472,7 +478,7 @@ class="mw-ui-button mw-ui-constructive" data-flow-interactive-handler="apiRequest" data-flow-api-handler="submitReply" - data-flow-api-target="< .flow-topic">'.LCRun3::ch($cx, 'l10n', Array(Array('Reply',((is_array($in) && isset($in['author'])) ? $in['author'] : null)),Array()), 'encq').'</button> + data-flow-api-target="< .flow-topic">'.htmlentities(((is_array($in['actions']['reply']) && isset($in['actions']['reply']['title'])) ? $in['actions']['reply']['title'] : null), ENT_QUOTES, 'UTF-8').'</button> <button data-flow-api-handler="preview" data-flow-api-target="< form textarea" name="preview" diff --git a/handlebars/flow_block_topic_reply.handlebars b/handlebars/flow_block_topic_reply.handlebars index c26edbe..744da0d 100644 --- a/handlebars/flow_block_topic_reply.handlebars +++ b/handlebars/flow_block_topic_reply.handlebars @@ -21,7 +21,7 @@ </textarea> <div class="flow-form-actions flow-form-collapsible"> - <button data-role="submit" class="mw-ui-button mw-ui-constructive mw-ui-flush-right">{{l10n "Reply" author}}</button> + <button data-role="submit" class="mw-ui-button mw-ui-constructive mw-ui-flush-right">{{actions.reply.title}}</button> {{> flow_form_buttons }} <small class="flow-terms-of-use plainlinks">{{l10nParse "flow-terms-of-use-reply"}}</small> </div> diff --git a/handlebars/flow_reply_form.handlebars b/handlebars/flow_reply_form.handlebars index b043efd..2a77bac 100644 --- a/handlebars/flow_reply_form.handlebars +++ b/handlebars/flow_reply_form.handlebars @@ -28,7 +28,7 @@ data-flow-interactive-handler="apiRequest" data-flow-api-handler="submitReply" data-flow-api-target="< .flow-topic"> - {{~l10n "Reply" author~}} + {{~actions.reply.title~}} </button> {{> flow_form_buttons }} <small class="flow-terms-of-use plainlinks">{{l10nParse "flow-terms-of-use-reply"}}</small> diff --git a/handlebars/flow_topic_titlebar_content.handlebars b/handlebars/flow_topic_titlebar_content.handlebars index 0562eb4..0c988c8 100644 --- a/handlebars/flow_topic_titlebar_content.handlebars +++ b/handlebars/flow_topic_titlebar_content.handlebars @@ -7,10 +7,18 @@ {{/if}} <span class="flow-author">{{l10n "started_with_participants" this}}</span> <div class="flow-topic-meta"> - <a class="mw-ui-progressive mw-ui-quiet" - data-flow-interactive-handler="activateForm" - href="#flow-post-{{postId}}-form-content">{{l10n "Reply" author}}</a> - • {{l10n "comment_count" this}} • + {{#if actions.reply}} + <a href="#flow-post-{{postId}}-form-content" + title="{{actions.reply.title}}" + class="mw-ui-progressive mw-ui-quiet" + data-flow-interactive-handler="activateForm"> + {{~actions.reply.title~}} + </a> + • + {{/if}} + + {{l10n "comment_count" this}} • + {{#if last_updated}} <!--span class="wikiglyph wikiglyph-speech-bubbles"></span--> {{timestamp last_updated "active_ago"}} {{else}} diff --git a/includes/TemplateHelper.php b/includes/TemplateHelper.php index 84d1be6..f9bd207 100644 --- a/includes/TemplateHelper.php +++ b/includes/TemplateHelper.php @@ -193,11 +193,6 @@ $str = array_shift( $args ); switch( $str ) { - case 'Reply': - $author = $args[0]; - $message = wfMessage( 'flow-reply-submit', $author['gender'] ); - break; - case 'Moderate': // @todo: Unused? $type = $args[0]; $str = "flow-post-action-$type-post"; diff --git a/modules/new/components/flow-board.js b/modules/new/components/flow-board.js index 9363333..bea39a2 100644 --- a/modules/new/components/flow-board.js +++ b/modules/new/components/flow-board.js @@ -1564,7 +1564,8 @@ { actions: { reply: { - url: $( this ).attr( 'href' ) + url: $( this ).attr( 'href' ), + title: mw.msg( 'flow-reply-link', author ) } }, postId: postId, diff --git a/modules/new/flow-handlebars.js b/modules/new/flow-handlebars.js index 7553c18..365e182 100644 --- a/modules/new/flow-handlebars.js +++ b/modules/new/flow-handlebars.js @@ -164,7 +164,6 @@ function flowMessages( str ) { var parameters = Array.prototype.slice.call( arguments, 1 ), strings = ( { - "Reply": "Reply", // TODO: pass in and parse $author['gender'] "Topics_n": function ( count, options ) { return "Topics (" + count + ")"; }, -- To view, visit https://gerrit.wikimedia.org/r/156094 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50dc6784ecc535654a6ac1b56ab61b32a823e309 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits