Last modified: 2012-06-10 07:37:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 13309 - Special:Browse should translate object page and category names
Special:Browse should translate object page and category names
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: denny vrandecic
Depends on: 37445
  Show dependency treegraph
Reported: 2008-03-10 09:58 UTC by S Page
Modified: 2012-06-10 07:37 UTC (History)
2 users (show)

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


Description S Page 2008-03-10 09:58:20 UTC
Special:Browse translates subjects of properties, redirects and property names into the user's language (if $smwgTranslate is true), but it does not translate category names and pages when they are the objects of annotations.

Steps to reproduce:

1. Set $smwgTranslate = true in SMW_Settings.php
2. Provide interwiki translations, e.g. add [[fr:Propriété:situé à]] to Property:Located_in, [[fr:Allemagne]] to Germany, and [[fr:Catégorie:Ville]] to Category:Cities.
3  Create a page using this property, category, and page, e.g. "Stuttgart" with
  In [[located in::Germany]]   [[Category:Cities]]
4. Click the browse "eye" icon for Stuttgart
5. Then in preferences change your language to fr - Francais, or tack ?uselang=fr on to the Special:Browse URL.

Actual results:
"Located in  Germany" changes to "Propriété:situé à  Germany"
"Categories  Cities" changes to "Catégories  Cities"

Note the property name and namespace are translated,  but not the page and category titles.

Expected results:
"Propriété:situé à  Allemagne"
"Catégories  Ville"

Alas, this enhancement isn't as simple as adding smwfT() around these printouts to translate them.  In SMW_Browse.php, the SMWStore returns categories and the objects of properties of type:Page as SMWWikiPageValue instances and SMW_Browse displays them by invoking their getLongHTMLText($skin) method.  There's currently no way to tell a SMWWikiPageValue "display this translated text when making a link of this title" because the text it displays is a private member (m_textform) with no setter.  Furthermore, SMWWikiPageValue gets its m_textform from MediaWiki's Title object, and that also has no way to specify a translated text form.

Arguably, MediaWiki's Title object should implement a method Title->getInterlangText($lang) that hides these details and optimizes the common case where the content lang == the user's lang.
Comment 1 Markus Krötzsch 2008-12-05 18:53:25 UTC
Assigned to developer for comments.
Comment 2 MWJames 2012-06-10 07:37:41 UTC
This might be solved by having access to the context (class RequestContext, $context->msg(), $context->getTitle() etc.). Add 37445 dependency.

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