Ricordisamoa has uploaded a new change for review.
https://gerrit.wikimedia.org/r/233104
Change subject: Add a "language" field to SpecialNewEntity
......................................................................
Add a "language" field to SpecialNewEntity
Switching 'lang' from <input type="hidden"> to <select>
Bug: T108907
Change-Id: I31d1c4e2129d3ffd7d169f20fb4420ca046994fe
---
M repo/i18n/en.json
M repo/i18n/qqq.json
M repo/includes/specials/SpecialNewEntity.php
3 files changed, 21 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/04/233104/1
diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index ded32d9..3c11c41 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -170,6 +170,7 @@
"wikibase-newitem-page": "Name of the first linked page",
"wikibase-newitem-no-external-page": "The specified page could not be
found on the corresponding site.",
"wikibase-newitem-not-recognized-siteid": "The provided site identifier
was not recognized.",
+ "wikibase-newentity-language": "Language:",
"wikibase-newentity-label": "Label:",
"wikibase-newentity-description": "Description:",
"wikibase-newentity-aliases": "Aliases, pipe-separated:",
diff --git a/repo/i18n/qqq.json b/repo/i18n/qqq.json
index 8a9e09c..303ce64 100644
--- a/repo/i18n/qqq.json
+++ b/repo/i18n/qqq.json
@@ -198,6 +198,7 @@
"wikibase-newitem-page": "Label for the page-textfield holding the page
name of the first linked page to add to the new item",
"wikibase-newitem-no-external-page": "Error message shown when a user
tries to add a page that does not exist on the website choosen.",
"wikibase-newitem-not-recognized-siteid": "Error message shown when a
user tries to add a link to a site with an unknown identifier.\n\nSee also:\n*
{{msg-mw|Wikibase-api-not-recognized-siteid}}",
+ "wikibase-newentity-language": "Label for the \"lang\" dropdown menu
holding the language in which the label, description and aliases of the new
item should be typed.",
"wikibase-newentity-label": "Label for the \"label\" textfield holding
the label of the new item.\n{{Identical|Label}}",
"wikibase-newentity-description": "Label for the \"description\"
textfield holding the description of the new item.\n{{Identical|Description}}",
"wikibase-newentity-aliases": "Label for the \"aliases\" textfield
holding the pipe-separated aliases of the new item.",
diff --git a/repo/includes/specials/SpecialNewEntity.php
b/repo/includes/specials/SpecialNewEntity.php
index f535a3f..9a3630b 100644
--- a/repo/includes/specials/SpecialNewEntity.php
+++ b/repo/includes/specials/SpecialNewEntity.php
@@ -5,6 +5,7 @@
use Html;
use Language;
use Status;
+use Xml;
use Wikibase\CopyrightMessageBuilder;
use Wikibase\DataModel\Entity\Entity;
use Wikibase\Repo\WikibaseRepo;
@@ -225,10 +226,25 @@
$langCode = $this->contentLanguage->getCode();
$langName = Language::fetchLanguageName( $langCode );
$langDir = $this->contentLanguage->getDir();
- return Html::hidden(
- 'lang',
- $langCode
+ list( , $selector ) = Xml::languageSelector(
+ $langCode,
+ false, // $customisedOnly
+ null, // $inLanguage
+ array(
+ 'name' => 'lang',
+ 'id' => 'wb-newentity-lang',
+ 'class' => 'wb-input'
+ )
+ );
+ return Html::element(
+ 'label',
+ array(
+ 'for' => 'wb-newentity-lang',
+ 'class' => 'wb-label'
+ ),
+ $this->msg( 'wikibase-newentity-language' )->text()
)
+ . $selector
. Html::element(
'label',
array(
--
To view, visit https://gerrit.wikimedia.org/r/233104
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I31d1c4e2129d3ffd7d169f20fb4420ca046994fe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits