Last modified: 2013-04-04 11:23:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42003, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40003 - Cannot whitelist message group
Cannot whitelist message group
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-05 13:40 UTC by antony.seedhouse
Modified: 2013-04-04 11:23 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description antony.seedhouse 2012-09-05 13:40:37 UTC
At the moment, to prevent translators from being able to edit content of the source language, you would blacklist *

This causes a problem if you want to edit a system message (group MediaWiki), as if you edit the content via editing the article, the changes are not in the translation system

If you try to add the page to the translation system, it is in it's own group

Suggest a $wgTranslateWhitelist that is applied after the blacklist
Comment 1 Niklas Laxström 2012-09-05 16:28:34 UTC
Could you elaborate a bit? I assume you are using $wgTranslateBlacklist, but what kind message groups (PHP class) are you using and what is the issue you want to solve?
Comment 2 antony.seedhouse 2012-09-06 11:49:52 UTC
I have a wiki whose source language is English, so I have blacklisted translations of English as per the example in Translate.php

 *     '*' => array( // All groups
 *         'en' => 'English is the source language.',
 *     ),

I still want to use Translate for translating the MediaWiki group (the wiki interface/system messages), e.g. MediaWiki:Loginprompt

This is fine, until I want to modify the English version. 

With * blacklisted in English, it cannot be edited via Translate. 

If I edit the page (e.g. MediaWiki:Loginprompt ) directly, the changes are not shown in the Translate system.

If I manually mark the page for translate (adding <translate></translate), then the page has it's own messages group (page-MediaWiki:Loginprompt), and then there will be entries in both the MediaWiki and page-MediaWiki.. groups

As far as I can tell, it is not possible to blacklist "all except x, y, z", so I think this would be something suitable for an additional Whitelist option

Or is there another trick to blacklisting the source language from translation while maintaining the ability to use the Translate system for the MediaWiki?
Comment 3 Niklas Laxström 2012-09-06 12:19:26 UTC
I'm afraid we are not supporting your use case very well. There is no per language restrictions (though we might have one for source language at some point).

It looks like you mostly want to translate custom interface modifications, for which I would recommended this guide which fits better for that: https://www.mediawiki.org/wiki/Help:Extension:Translate/Unstructured_element_translation
Comment 4 antony.seedhouse 2012-09-06 14:35:24 UTC
Isn't a purpose of wgTranslateBlacklist to restrict translation of a group/language?

I have implemented the basic wgTranslateWhitelist functionality which as far as I can tell/understand is the neatest way to handle this use case, see attached patch

Missing: isWhitelisted function (StatsTable.php) and logic (SpecialLanguageStats.php & SpecialMessageGroupStats.php)

If I finish the patch, would you implement it?
Comment 5 antony.seedhouse 2012-09-06 14:57:04 UTC
Oh, I see now that the message system is... more complicated than I thought.

I still need to transclude the \en article in the main article for it to be used

-> I guess the proper way would be to have some kind of hook, for whenever a "core" message is displayed in the default language, for it to use the \en version?

and the original "Message definition" is still not changed even when English translation is changed or the main article.

-> I hope this is not too difficult to fix
Comment 6 Andre Klapper 2013-04-04 11:23:59 UTC
(In reply to comment #4)
> If I finish the patch, would you implement it?

Niklas, do you have an opinion here / could you answer this?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links