[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: VisualEditorDataModule: Do not expand templates in plain tex...

2017-08-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/373331 )

Change subject: VisualEditorDataModule: Do not expand templates in plain text 
messages
..


VisualEditorDataModule: Do not expand templates in plain text messages

Changing `->text()` to `->plain()` and some variable
names and comments to match that. This is now the same
as normal ResourceLoader behavior for messages added
via `'messages'` in RL modules.

Also remove a duplicate use of the
'visualeditor-quick-access-characters.json' message.

Bug: T159529
Change-Id: I63593db445433e7da5c71e6800f96daf63054fcf
---
M VisualEditorDataModule.php
M extension.json
2 files changed, 7 insertions(+), 8 deletions(-)

Approvals:
  jenkins-bot: Verified
  Jforrester: Looks good to me, approved



diff --git a/VisualEditorDataModule.php b/VisualEditorDataModule.php
index eb7608c..26da3a0 100644
--- a/VisualEditorDataModule.php
+++ b/VisualEditorDataModule.php
@@ -25,12 +25,12 @@
public function getScript( ResourceLoaderContext $context ) {
$msgInfo = $this->getMessageInfo( $context );
$parsedMessages = $msgInfo['parsed'];
-   $textMessages = [];
+   $plainMessages = [];
foreach ( $msgInfo['parse'] as $msgKey => $msgObj ) {
$parsedMessages[ $msgKey ] = $msgObj->parse();
}
-   foreach ( $msgInfo['text'] as $msgKey => $msgObj ) {
-   $textMessages[ $msgKey ] = $msgObj->text();
+   foreach ( $msgInfo['plain'] as $msgKey => $msgObj ) {
+   $plainMessages[ $msgKey ] = $msgObj->plain();
}
 
return 've.init.platform.addParsedMessages(' . 
FormatJson::encode(
@@ -38,7 +38,7 @@
ResourceLoader::inDebugMode()
) . ');'.
've.init.platform.addMessages(' . FormatJson::encode(
-   $textMessages,
+   $plainMessages,
ResourceLoader::inDebugMode()
) . ');';
}
@@ -68,8 +68,8 @@
),
];
 
-   // Messages to be exported as text
-   $textMsgs = [
+   // Messages to be exported as plain text
+   $plainMsgs = [
'visualeditor-feedback-link' =>
$context->msg( 'visualeditor-feedback-link' )
->inContentLanguage(),
@@ -82,7 +82,7 @@
'parse' => $parseMsgs,
// Already parsed
'parsed' => $parsedMsgs,
-   'text' => $textMsgs,
+   'plain' => $plainMsgs,
];
}
 
diff --git a/extension.json b/extension.json
index 40426ac..6b9242c 100644
--- a/extension.json
+++ b/extension.json
@@ -523,7 +523,6 @@
"jquery.uls.data"
],
"messages": [
-   "visualeditor-quick-access-characters.json",
"visualeditor-special-characters-group-other"
],
"targets": [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I63593db445433e7da5c71e6800f96daf63054fcf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: DLynch 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: VisualEditorDataModule: Do not expand templates in plain tex...

2017-08-23 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373331 )

Change subject: VisualEditorDataModule: Do not expand templates in plain text 
messages
..

VisualEditorDataModule: Do not expand templates in plain text messages

Changing `->text()` to `->plain()` and some variable
names and comments to match that. This is now the same
as normal ResourceLoader behavior for messages added
via `'messages'` in RL modules.

Also remove a duplicate use of the
'visualeditor-quick-access-characters.json' message.

Bug: T159529
Change-Id: I63593db445433e7da5c71e6800f96daf63054fcf
---
M VisualEditorDataModule.php
M extension.json
2 files changed, 7 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/31/373331/1

diff --git a/VisualEditorDataModule.php b/VisualEditorDataModule.php
index eb7608c..26da3a0 100644
--- a/VisualEditorDataModule.php
+++ b/VisualEditorDataModule.php
@@ -25,12 +25,12 @@
public function getScript( ResourceLoaderContext $context ) {
$msgInfo = $this->getMessageInfo( $context );
$parsedMessages = $msgInfo['parsed'];
-   $textMessages = [];
+   $plainMessages = [];
foreach ( $msgInfo['parse'] as $msgKey => $msgObj ) {
$parsedMessages[ $msgKey ] = $msgObj->parse();
}
-   foreach ( $msgInfo['text'] as $msgKey => $msgObj ) {
-   $textMessages[ $msgKey ] = $msgObj->text();
+   foreach ( $msgInfo['plain'] as $msgKey => $msgObj ) {
+   $plainMessages[ $msgKey ] = $msgObj->plain();
}
 
return 've.init.platform.addParsedMessages(' . 
FormatJson::encode(
@@ -38,7 +38,7 @@
ResourceLoader::inDebugMode()
) . ');'.
've.init.platform.addMessages(' . FormatJson::encode(
-   $textMessages,
+   $plainMessages,
ResourceLoader::inDebugMode()
) . ');';
}
@@ -68,8 +68,8 @@
),
];
 
-   // Messages to be exported as text
-   $textMsgs = [
+   // Messages to be exported as plain text
+   $plainMsgs = [
'visualeditor-feedback-link' =>
$context->msg( 'visualeditor-feedback-link' )
->inContentLanguage(),
@@ -82,7 +82,7 @@
'parse' => $parseMsgs,
// Already parsed
'parsed' => $parsedMsgs,
-   'text' => $textMsgs,
+   'plain' => $plainMsgs,
];
}
 
diff --git a/extension.json b/extension.json
index 40426ac..6b9242c 100644
--- a/extension.json
+++ b/extension.json
@@ -523,7 +523,6 @@
"jquery.uls.data"
],
"messages": [
-   "visualeditor-quick-access-characters.json",
"visualeditor-special-characters-group-other"
],
"targets": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63593db445433e7da5c71e6800f96daf63054fcf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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