Page MenuHomePhabricator

It's unclear how can one translate the word "and" in the license note on Mobile Frontend
Open, Needs TriagePublic

Description

To reproduce:

  1. Go to https://he.m.wikipedia.org/wiki/ASCII (note that it must be in Mobile View, and the UI and content language must be Hebrew)
  2. Edit.
  3. Write something.
  4. Click the Publish button (blue button at the top with an arrow).
  5. The edit summary box appears. Underneath the edit summary field, there's a license notice. (As far as I understand, the message is mobile-frontend-editor-licensing-with-terms.)

Observed: Most of the message is translated to Hebrew, but the end says "CC BY-SA 3.0 and GFDL". The word "and" is not translated.

Expected the word "end" must be translated, so the string is suppose to be something like "CC BY-SA 3.0 ו־GFDL"

I couldn't find where to translate this string.

Possibly related to T111833.

Event Timeline

	/**
	 * Check, if the given license message string holds multiple license messages.
	 *
	 * FIXME: This hack shouldn't be needed anymore after fixing T111833
	 *
	 * @param string $license License or licenses message
	 * @param Message|null $msgObj delimiter (optional)
	 * @return int Returns 2, if there are multiple licenses, 1 otherwise.
	 */
	public static function getPluralLicenseInfo( $license, $msgObj = null ) {
		// for plural support we need the info, if there is one or more licenses used in the license text
		// this check if very simple and works on the base, that more than one license will
		// use "and" as a connective
		// 1 - no plural
		// 2 - plural
		if ( $msgObj !== null ) {
			$delimiterMsg = $msgObj;
		} else {
			$delimiterMsg = wfMessage( 'and' );
		}
		$delimiterMsg = $delimiterMsg->inContentLanguage();
		// check, if "and" isn't disabled and exists in site language
		return $delimiterMsg->isDisabled() || strpos( $license, $delimiterMsg->text() ) === false ? 1 : 2;
	}

Didn't mean to hit enter.. but it's using https://translatewiki.net/wiki/MediaWiki:And/en

That's what I thought, and this message is translated to Hebrew, and yet it appears in English.

That's what I thought, and this message is translated to Hebrew, and yet it appears in English.

Seems that it's because of this (which, at a glance, looks very out-of-place to me):

			$delimiterMsg = wfMessage( 'and' );
		}
		$delimiterMsg = $delimiterMsg->inContentLanguage();

I'm trying to think of a valid reason why the license separator msg ("and") would ever be in content and not UI language but I can't think of any. It certainly makes sense to have *actual* license messages (if any) "untranslatable", and separators like this fully translatable.

Looking at it in more detail, it uses the "and" message to see if the "and" appears in the string, but then returns plurality; it doesn't specifically use that and there...

(mobile-frontend-editor-licensing-with-terms: (mobile-frontend-editor-terms-link: https://m.wikimediafoundation.org/wiki/Terms_of_Use), CC BY-SA 3.0 and GFDL, 1)

Screenshot 2021-05-18 at 14.44.19.png (136×2 px, 40 KB)

The and is there as one of the parameters being passed in

It looks fine on https://he.wikipedia.org/wiki/%D7%9E%D7%93%D7%99%D7%94_%D7%95%D7%99%D7%A7%D7%99:Wikimedia-copyrightwarning (Wikimedia override) for example

LGoto added a subscriber: LGoto.

This task was closed as part of backlog upkeep. If you believe it was closed in error, please respond on the ticket.

It's still a bug. Maybe not the most important one, but a bug nevertheless.

On Wikimedia wikis, the dual-license text actually comes from WikimediaMessages via a hook: https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaMessages/+/034d4a34bd964f2478995e3b77f650a9614b1e00/includes/WikimediaMessagesHooks.php#295.
The message is wikimedia-mobile-license-links, and looking in the WikimediaMessages he.json, I think we've found our culprit.

	"wikimedia-mobile-license-links": "<a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" title=\"הגדרה של רישיון קריאייטיב קומונז ייחוס–שיתוף זהה\" target=\"_blank\">CC BY-SA 3.0</a> and <a href=\"https://www.gnu.org/licenses/fdl.html\" title=\"הגדרה של GFDL\" target=\"_blank\">GFDL</a>",

You can fix the translation at https://translatewiki.net/w/i.php?title=Special:Translate&showMessage=wikimedia-mobile-license-links&group=ext-wikimediamessages&language=he&filter=&optional=1&action=translate or override it in the usual way.

It also looks like the plural detection isn't working correctly, possibly because of this hack on top of a hack. T111833 is the proper solution to that problem though.

Jdlrobson edited projects, added WikimediaMessages; removed VisualEditor, MobileFrontend.
Jdlrobson added a subscriber: ovasileva.

Thanks @AntiCompositeNumber for the detective work!