Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/162204
Change subject: MT: Service selector menu should contain only service provider name ...................................................................... MT: Service selector menu should contain only service provider name When the current language is supported, it should not be explicitly stated in the Services list ( i.e., the selector should indicate "From Apertium" instead of "From Apertium, Español to Català" ). Since this will reduce the required menu width, adjust the style a bit Change-Id: Ie6cdc6534a2a4937b006515a30afad307a67e358 --- M Resources.php M i18n/en.json M i18n/qqq.json M modules/tools/ext.cx.tools.mt.js M modules/tools/styles/ext.cx.tools.mt.less 5 files changed, 8 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/04/162204/1 diff --git a/Resources.php b/Resources.php index 3596f2d..e7340cf 100644 --- a/Resources.php +++ b/Resources.php @@ -304,7 +304,6 @@ 'ext.cx.tools.manager', 'ext.cx.translation', 'ext.cx.util', - 'jquery.uls.data', ), ) + $resourcePaths; diff --git a/i18n/en.json b/i18n/en.json index d781bed..c24eab1 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -58,7 +58,7 @@ "cx-tools-mt-use-source": "Use source text", "cx-tools-mt-clear-translation": "Clear translation", "cx-tools-mt-restore": "Restore", - "cx-tools-mt-provider-title": "From $1, $2 to $3", + "cx-tools-mt-provider-title": "From $1", "cx-tools-mt-not-available": "Not available for $1", "cx-tools-mt-dont-use": "Don't use machine translation", "cx-stats-title": "Content translation statistics", diff --git a/i18n/qqq.json b/i18n/qqq.json index 4d58cde..8c81ebd 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -63,7 +63,7 @@ "cx-tools-mt-use-source": "A button in the machine translation tool card on Special:ContentTranslation. Clicking the button pastes the source text to the translation column.", "cx-tools-mt-clear-translation": "A button in the machine translation tool card on Special:ContentTranslation. Clicking the button removes the machine translation that was added to the paragraph.", "cx-tools-mt-restore": "A button in the machine translation tool card on Special:ContentTranslation. It appears if the translation was cleared using the button {{msg-mw|cx-tools-mt-clear-translation}}, and clicking it restores the machine translation.\n{{Identical|Restore}}", - "cx-tools-mt-provider-title": "An item in a menu in the machine translation tool card on Special:ContentTranslation. The menu lists different available machine translation providers for this language.\n* $1 is the name of the provider, such as Apertium, Microsoft Translator, Google Translate, etc.\n* $2 is the name of the source language.\n* $3 is the name of the target language.", + "cx-tools-mt-provider-title": "An item in a menu in the machine translation tool card on Special:ContentTranslation. The menu lists different available machine translation providers for this language.\n* $1 is the name of the provider, such as Apertium, Microsoft Translator, Google Translate, etc.", "cx-tools-mt-not-available": "An item in a menu in the machine translation tool card on Special:ContentTranslation. It's shown when there is no machine translation provider for that language. $1 is the name of the language.", "cx-tools-mt-dont-use": "An item in a menu in the machine translation tool card on Special:ContentTranslation. Other items in same menu will use the message {{msg-mw|cx-tools-mt-from-provider}}. Selecting this item disables machine translation. It may be the default for some languages.", "cx-stats-title": "The title for the Special:ContentTranslationStats special page.", diff --git a/modules/tools/ext.cx.tools.mt.js b/modules/tools/ext.cx.tools.mt.js index 98aeb59..d5348ed 100644 --- a/modules/tools/ext.cx.tools.mt.js +++ b/modules/tools/ext.cx.tools.mt.js @@ -279,11 +279,7 @@ MTControlCard.provider = providerId; // Set the main label - this.$providerSelectorTrigger.text( this.getProviderTitle( - providerId, - mw.cx.sourceLanguage, - mw.cx.targetLanguage - ) ); + this.$providerSelectorTrigger.text( this.getProviderTitle( providerId ) ); }; MTControlCard.prototype.listen = function () { @@ -338,19 +334,13 @@ /** * Get the text for the menu item in the providers list. * @param {string} id Provider id. - * @param {string} sourceLang Source language code. - * @param {string} targetLang Target language code. * @return {string} */ - MTControlCard.prototype.getProviderTitle = function ( id, from, to ) { + MTControlCard.prototype.getProviderTitle = function ( id ) { if ( id === disableMT ) { return mw.msg( 'cx-tools-mt-dont-use' ); } else { - return mw.msg( 'cx-tools-mt-provider-title', - id, - $.uls.data.getAutonym( from ), - $.uls.data.getAutonym( to ) - ); + return mw.msg( 'cx-tools-mt-provider-title', id ); } }; @@ -363,7 +353,7 @@ */ MTControlCard.prototype.getProviderItem = function ( id, from, to ) { return $( '<li>' ) - .text( this.getProviderTitle( id, from, to ) ) + .text( this.getProviderTitle( id ) ) .prop( 'id', providerIdPrefix + id ) .on( 'click', $.proxy( this.selectProvider, this, id ) ); }; diff --git a/modules/tools/styles/ext.cx.tools.mt.less b/modules/tools/styles/ext.cx.tools.mt.less index 4de224a..9bb2257 100644 --- a/modules/tools/styles/ext.cx.tools.mt.less +++ b/modules/tools/styles/ext.cx.tools.mt.less @@ -43,7 +43,7 @@ .card__providers-menu { .mw-ui-item; - .mw-ui-two-thirds; + .mw-ui-one-half; list-style: none; position: absolute; margin-top: 30px; @@ -70,7 +70,7 @@ :after, :before { bottom: 100%; - left: 50%; + left: 25%; border: solid transparent; content: " "; height: 0; -- To view, visit https://gerrit.wikimedia.org/r/162204 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6cdc6534a2a4937b006515a30afad307a67e358 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits