jenkins-bot has submitted this change and it was merged.
Change subject: Use "article" instead of "page" only on Wikipedia
......................................................................
Use "article" instead of "page" only on Wikipedia
* Revert to using "page" by default
* Use the MessageCache::get hook to rewrite the keys for a subset of
GettingStarted messages so that the resulting message uses "article"
instead of "page"
* Only register the MessageCache::get hook on Wikipedia
Change-Id: I3ea11c0b584039bed051fe9bdd2a18e3d1ef6210
(cherry picked from commit b575348acec113a40f8a99f9c1364bed88e98291)
---
M GettingStarted.php
M Hooks.php
M i18n/en.json
M i18n/qqq.json
4 files changed, 95 insertions(+), 19 deletions(-)
Approvals:
Mattflaschen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/GettingStarted.php b/GettingStarted.php
index 9bc9e3b..318cb6d 100644
--- a/GettingStarted.php
+++ b/GettingStarted.php
@@ -349,4 +349,12 @@
// Extension:CentralAuth's hook
$wgHooks[ 'CentralAuthPostLoginRedirect' ][] =
'GettingStarted\Hooks::onCentralAuthPostLoginRedirect';
$wgHooks[ 'ResourceLoaderTestModules' ][] =
'GettingStarted\Hooks::onResourceLoaderTestModules';
-$wgHooks[ 'PageContentSaveComplete' ][] =
'GettingStarted\Hooks::onPageContentSaveComplete';
\ No newline at end of file
+$wgHooks[ 'PageContentSaveComplete' ][] =
'GettingStarted\Hooks::onPageContentSaveComplete';
+
+list( $site, $lang ) = $wgConf->siteFromDB( $wgDBname );
+
+// Known Issue: Wikimedia Commons is considered Wikipedia, which may need to
be fixed
+// if GettingStarted is ever deployed there.
+if ( $site === 'wikipedia' ) {
+ $wgHooks[ 'MessageCache::get' ][] =
'GettingStarted\Hooks::onMessageCacheGet';
+}
diff --git a/Hooks.php b/Hooks.php
index 672c45c..1a5aecc 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -461,4 +461,40 @@
\EventLogging::logEvent( 'TrackedPageContentSaveComplete',
7872558, $event );
return true;
}
+
+ /**
+ * If the site is a Wikipedia, this is called to specify that
Wikipedia-specific
+ * versions will be used for certain keys.
+ *
+ * It modifies the passed-in i18n key if it is one of those listed.
+ *
+ * @param string &$lckey Lower-case i18n key, before substitution
+ *
+ * @return bool Always true
+ */
+ public static function onMessageCacheGet( &$lckey ) {
+
+ if ( in_array( $lckey, array(
+ "gettingstarted-task-toolbar-try-another-text",
+ "gettingstarted-task-toolbar-no-suggested-page",
+ "gettingstarted-task-copyedit-toolbar-description",
+
"gettingstarted-task-copyedit-toolbar-try-another-title",
+ "gettingstarted-task-clarify-toolbar-description",
+ "gettingstarted-task-clarify-toolbar-try-another-title",
+ "gettingstarted-task-addlinks-toolbar-description",
+
"gettingstarted-task-addlinks-toolbar-try-another-title",
+
"guidedtour-tour-gettingstartedtasktoolbarintro-description",
+
"guidedtour-tour-gettingstartedtasktoolbar-ambox-description",
+
"guidedtour-tour-gettingstartedtasktoolbar-edit-article-title",
+
"guidedtour-tour-gettingstartedtasktoolbar-edit-article-description",
+
"guidedtour-tour-gettingstartedtasktoolbarve-click-save-description",
+
"guidedtour-tour-gettingstarted-click-preview-description",
+ "gettingstarted-cta-edit-page",
+ "gettingstarted-cta-fix-pages",
+ ) ) ) {
+ $lckey = "{$lckey}-wikipedia";
+ }
+
+ return true;
+ }
}
diff --git a/i18n/en.json b/i18n/en.json
index 7aa0a6d..2602e19 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -11,35 +11,35 @@
"tag-gettingstarted_edit-description": "Edit made via the
[[{{MediaWiki:gettingstarted-project-link}}|GettingStarted]] system, which
suggests easy tasks to editors and shows them how to complete them.",
"gettingstarted-task-toolbar-editing-help-text": "Show me how",
"gettingstarted-task-toolbar-editing-help-title": "Show a guide on how to
edit",
- "gettingstarted-task-toolbar-try-another-text": "Try another article ►",
+ "gettingstarted-task-toolbar-try-another-text": "Try another page ►",
"gettingstarted-task-toolbar-close-title": "Close this toolbar",
- "gettingstarted-task-toolbar-no-suggested-page": "Sorry. We couldn't find
more articles to be improved at the moment. Try again in a moment or search for
your own topics of interest.",
- "gettingstarted-task-copyedit-toolbar-description": "This article may have
spelling or grammar errors you can fix.",
- "gettingstarted-task-copyedit-toolbar-try-another-title": "Go to a random
article you can improve by copyediting",
- "gettingstarted-task-clarify-toolbar-description": "This article may be
confusing or vague. Look for ways you can make it clearer.",
- "gettingstarted-task-clarify-toolbar-try-another-title": "Go to a random
article you can clarify",
- "gettingstarted-task-addlinks-toolbar-description": "This article may need
more links. Look for terms that have a {{SITENAME}} article.",
- "gettingstarted-task-addlinks-toolbar-try-another-title": "Go to a random
article you can add links to",
+ "gettingstarted-task-toolbar-no-suggested-page": "Sorry. We couldn't find
more pages to be improved at the moment. Try again in a moment or search for
your own topics of interest.",
+ "gettingstarted-task-copyedit-toolbar-description": "This page may have
spelling or grammar errors you can fix.",
+ "gettingstarted-task-copyedit-toolbar-try-another-title": "Go to a random
page you can improve by copyediting",
+ "gettingstarted-task-clarify-toolbar-description": "This page may be
confusing or vague. Look for ways you can make it clearer.",
+ "gettingstarted-task-clarify-toolbar-try-another-title": "Go to a random
page you can clarify",
+ "gettingstarted-task-addlinks-toolbar-description": "This page may need
more links. Look for terms that have a {{SITENAME}} page.",
+ "gettingstarted-task-addlinks-toolbar-try-another-title": "Go to a random
page you can add links to",
"guidedtour-tour-gettingstartedtasktoolbarintro-title": "Let's get
started",
- "guidedtour-tour-gettingstartedtasktoolbarintro-description": "This
article is identified by other {{SITENAME}} users as needing improvement. You
don't have to be an expert in the subject to help.",
+ "guidedtour-tour-gettingstartedtasktoolbarintro-description": "This page
is identified by other {{SITENAME}} users as needing improvement. You don't
have to be an expert in the subject to help.",
"guidedtour-tour-gettingstartedtasktoolbar-ambox-title": "Ideas on what to
do",
- "guidedtour-tour-gettingstartedtasktoolbar-ambox-description": "These
banners identify problems with this article. You don't need to fix them all,
just stick with what you're comfortable doing.",
- "guidedtour-tour-gettingstartedtasktoolbar-edit-article-title": "Edit the
whole article…",
- "guidedtour-tour-gettingstartedtasktoolbar-edit-article-description":
"Click \"{{int:vector-view-edit}}\" to change content anywhere in the article.",
+ "guidedtour-tour-gettingstartedtasktoolbar-ambox-description": "These
banners identify problems with this page. You don't need to fix them all, just
stick with what you're comfortable doing.",
+ "guidedtour-tour-gettingstartedtasktoolbar-edit-article-title": "Edit the
whole page…",
+ "guidedtour-tour-gettingstartedtasktoolbar-edit-article-description":
"Click \"{{int:vector-view-edit}}\" to change content anywhere in the page.",
"guidedtour-tour-gettingstartedtasktoolbar-edit-section-title": "Or edit a
section",
"guidedtour-tour-gettingstartedtasktoolbar-edit-section-description": "If
you want to edit a specific section, you can click on the blue
\"{{int:editsection}}\" link near each section's title.",
"guidedtour-tour-gettingstartedtasktoolbarve-click-save-title": "Make your
changes and save",
- "guidedtour-tour-gettingstartedtasktoolbarve-click-save-description": "You
can now edit the article contents. When you are done, click
\"{{int:visualeditor-toolbar-savedialog}}\" to review and save your changes.",
+ "guidedtour-tour-gettingstartedtasktoolbarve-click-save-description": "You
can now edit the page contents. When you are done, click
\"{{int:visualeditor-toolbar-savedialog}}\" to review and save your changes.",
"guidedtour-tour-gettingstarted-click-preview-title": "Preview (optional)",
- "guidedtour-tour-gettingstarted-click-preview-description": "Clicking
\"{{int:showpreview}}\" allows you to see what the article will look like with
your changes. Just don't forget to save.",
+ "guidedtour-tour-gettingstarted-click-preview-description": "Clicking
\"{{int:showpreview}}\" allows you to see what the page will look like with
your changes. Just don't forget to save.",
"guidedtour-tour-gettingstarted-click-save-title": "You're almost
finished!",
"guidedtour-tour-gettingstarted-click-save-description": "Click
\"{{int:savearticle}}\" and your changes will be visible.",
"gettingstarted-cta-close": "Close",
"gettingstarted-cta-heading": "Help improve {{SITENAME}}",
"gettingstarted-cta-text": "You can contribute to {{SITENAME}} in
different ways",
- "gettingstarted-cta-edit-page": "Edit this article",
+ "gettingstarted-cta-edit-page": "Edit this page",
"gettingstarted-cta-edit-page-sub": "We'll show you how",
- "gettingstarted-cta-fix-pages": "Edit a suggested article",
+ "gettingstarted-cta-fix-pages": "Edit a suggested page",
"gettingstarted-cta-fix-pages-sub": "We'll pick something easy",
"gettingstarted-cta-leave": "No thanks, maybe later",
"guidedtour-tour-anonymouseditoracquisitionpreedit-title": "Sign up to
edit {{SITENAME}}",
@@ -48,5 +48,21 @@
"guidedtour-tour-anonymouseditoracquisitionpreedit-continue": "No thanks",
"guidedtour-tour-anonymouseditoracquisitionpostedit-title": "Join
{{SITENAME}}",
"guidedtour-tour-anonymouseditoracquisitionpostedit-description": "Create
an account to edit and you can: <ul><li>Track your contributions</li><li>Follow
updates to your favorite pages</li><li>Connect with other Wikipedia
editors</li><li>Get early access to new features</li></ul>",
- "guidedtour-tour-anonymouseditoracquisitionpostedit-continue": "Create my
account"
+ "guidedtour-tour-anonymouseditoracquisitionpostedit-continue": "Create my
account",
+ "gettingstarted-task-toolbar-try-another-text-wikipedia": "Try another
article ►",
+ "gettingstarted-task-toolbar-no-suggested-page-wikipedia": "Sorry. We
couldn't find more articles to be improved at the moment. Try again in a moment
or search for your own topics of interest.",
+ "gettingstarted-task-copyedit-toolbar-description-wikipedia": "This
article may have spelling or grammar errors you can fix.",
+ "gettingstarted-task-copyedit-toolbar-try-another-title-wikipedia": "Go to
a random article you can improve by copyediting",
+ "gettingstarted-task-clarify-toolbar-description-wikipedia": "This article
may be confusing or vague. Look for ways you can make it clearer.",
+ "gettingstarted-task-clarify-toolbar-try-another-title-wikipedia": "Go to
a random article you can clarify",
+ "gettingstarted-task-addlinks-toolbar-description-wikipedia": "This
article may need more links. Look for terms that have a {{SITENAME}} article.",
+ "gettingstarted-task-addlinks-toolbar-try-another-title-wikipedia": "Go to
a random article you can add links to",
+ "guidedtour-tour-gettingstartedtasktoolbarintro-description-wikipedia":
"This article is identified by other {{SITENAME}} users as needing improvement.
You don't have to be an expert in the subject to help.",
+ "guidedtour-tour-gettingstartedtasktoolbar-ambox-description-wikipedia":
"These banners identify problems with this article. You don't need to fix them
all, just stick with what you're comfortable doing.",
+ "guidedtour-tour-gettingstartedtasktoolbar-edit-article-title-wikipedia":
"Edit the whole article…",
+
"guidedtour-tour-gettingstartedtasktoolbar-edit-article-description-wikipedia":
"Click \"{{int:vector-view-edit}}\" to change content anywhere in the article.",
+
"guidedtour-tour-gettingstartedtasktoolbarve-click-save-description-wikipedia":
"You can now edit the article contents. When you are done, click
\"{{int:visualeditor-toolbar-savedialog}}\" to review and save your changes.",
+ "guidedtour-tour-gettingstarted-click-preview-description-wikipedia":
"Clicking \"{{int:showpreview}}\" allows you to see what the article will look
like with your changes. Just don't forget to save.",
+ "gettingstarted-cta-edit-page-wikipedia": "Edit this article",
+ "gettingstarted-cta-fix-pages-wikipedia": "Edit a suggested article"
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 4016ec1..2a11adf 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -49,5 +49,21 @@
"guidedtour-tour-anonymouseditoracquisitionpreedit-continue": "Main text
of the button inviting the user to remain anonymous and continue editing the
page",
"guidedtour-tour-anonymouseditoracquisitionpostedit-title": "Title of the
step inviting the user to create an account after editing the page",
"guidedtour-tour-anonymouseditoracquisitionpostedit-description":
"Description of the step inviting the user to create an account after editing
the page",
- "guidedtour-tour-anonymouseditoracquisitionpostedit-continue": "Main text
of the button inviting the user to create an account after editing the page"
+ "guidedtour-tour-anonymouseditoracquisitionpostedit-continue": "Main text
of the button inviting the user to create an account after editing the page",
+ "gettingstarted-task-toolbar-try-another-text-wikipedia":
"\"{{msg-mw|gettingstarted-task-toolbar-try-another-text}}\" with \"page\"
replaced with \"article\".",
+ "gettingstarted-task-toolbar-no-suggested-page-wikipedia":
"\"{{msg-mw|gettingstarted-task-toolbar-no-suggested-page}}\" with \"page\"
replaced with \"article\".",
+ "gettingstarted-task-copyedit-toolbar-description-wikipedia":
"\"{{msg-mw|gettingstarted-task-copyedit-toolbar-description}}\" with \"page\"
replaced with \"article\".",
+ "gettingstarted-task-copyedit-toolbar-try-another-title-wikipedia":
"\"{{msg-mw|gettingstarted-task-copyedit-toolbar-try-another-title}}\" with
\"page\" replaced with \"article\".",
+ "gettingstarted-task-clarify-toolbar-description-wikipedia":
"\"{{msg-mw|gettingstarted-task-clarify-toolbar-description}}\" with \"page\"
replaced with \"article\".",
+ "gettingstarted-task-clarify-toolbar-try-another-title-wikipedia":
"\"{{msg-mw|gettingstarted-task-clarify-toolbar-try-another-title}}\" with
\"page\" replaced with \"article\".",
+ "gettingstarted-task-addlinks-toolbar-description-wikipedia":
"\"{{msg-mw|gettingstarted-task-addlinks-toolbar-description}}\" with \"page\"
replaced with \"article\".",
+ "gettingstarted-task-addlinks-toolbar-try-another-title-wikipedia":
"\"{{msg-mw|gettingstarted-task-addlinks-toolbar-try-another-title}}\" with
\"page\" replaced with \"article\".",
+ "guidedtour-tour-gettingstartedtasktoolbarintro-description-wikipedia":
"\"{{msg-mw|guidedtour-tour-gettingstartedtasktoolbarintro-description}}\" with
\"page\" replaced with \"article\".",
+ "guidedtour-tour-gettingstartedtasktoolbar-ambox-description-wikipedia":
"\"{{msg-mw|guidedtour-tour-gettingstartedtasktoolbar-ambox-description}}\"
with \"page\" replaced with \"article\".",
+ "guidedtour-tour-gettingstartedtasktoolbar-edit-article-title-wikipedia":
"\"{{msg-mw|guidedtour-tour-gettingstartedtasktoolbar-edit-article-title}}\"
with \"page\" replaced with \"article\".",
+
"guidedtour-tour-gettingstartedtasktoolbar-edit-article-description-wikipedia":
"\"{{msg-mw|guidedtour-tour-gettingstartedtasktoolbar-edit-article-description}}\"
with \"page\" replaced with \"article\".",
+
"guidedtour-tour-gettingstartedtasktoolbarve-click-save-description-wikipedia":
"\"{{msg-mw|guidedtour-tour-gettingstartedtasktoolbarve-click-save-description}}\"
with \"page\" replaced with \"article\".",
+ "guidedtour-tour-gettingstarted-click-preview-description-wikipedia":
"\"{{msg-mw|guidedtour-tour-gettingstarted-click-preview-description}}\" with
\"page\" replaced with \"article\".",
+ "gettingstarted-cta-edit-page-wikipedia":
"\"{{msg-mw|gettingstarted-cta-edit-page}}\" with \"page\" replaced with
\"article\".",
+ "gettingstarted-cta-fix-pages-wikipedia":
"\"{{msg-mw|gettingstarted-cta-fix-pages}}\" with \"page\" replaced with
\"article\"."
}
--
To view, visit https://gerrit.wikimedia.org/r/133608
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3ea11c0b584039bed051fe9bdd2a18e3d1ef6210
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: wmf/1.24wmf4
Gerrit-Owner: Phuedx <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits