Hi again,
Is there a way to get a localized version of section names of an article, for example "See also"? Currently my question is related to section names, but in general I would like to get language equivalent for other semantic entities. Are there docs about such things? I tried to find but failed.
Thanks,
Max
On Fri, Jan 27, 2017 at 10:57 AM, Max Vlasov max.vlasov@gmail.com wrote:
Is there a way to get a localized version of section names of an article, for example "See also"? Currently my question is related to section names, but in general I would like to get language equivalent for other semantic entities. Are there docs about such things? I tried to find but failed.
For section names, no. There's nothing special about the title of the "See also" section versus any other section on any other page, unless the wiki is specifically loading i18n messages for section headings like Commons does.
For interface messages, you'd need to determine the message key. Then you can query them from the API (action=query&meta=allmessages) or you can look on the wiki in the MediaWiki namespace. For example, the text of the "edit" tab in the Vector skin comes from the message 'vector-view-edit', so if you want to see what that is in German on your wiki you could check MediaWiki:vector-view-edit/de[1] or api.php?action=query&meta=allmessages&ammessages=vector-view-edit&amlang=de.[2]
[1]: https://en.wikipedia.org/wiki/MediaWiki:Vector-view-edit/de [2]: https://en.wikipedia.org/w/api.php?action=query&meta=allmessages&amm...
Thanks, Brad and Gergo,
now I see that there's no direct way to do this reliably.
In the past I needed something similar when translating the root category Content to an arbitrary language. I found a workaround, when the titles were retrieved by scanning the Language section of Category:Contents article, still works. But no new trick comes to mind here
On Fri, Jan 27, 2017 at 7:10 PM, Brad Jorsch (Anomie) <bjorsch@wikimedia.org
wrote:
i18n
On Fri, Jan 27, 2017 at 7:57 AM, Max Vlasov max.vlasov@gmail.com wrote:
Is there a way to get a localized version of section names of an article, for example "See also"? Currently my question is related to section names, but in general I would like to get language equivalent for other semantic entities. Are there docs about such things? I tried to find but failed.
For system messages, the docs are at https://www.mediawiki.org/wiki/Help:System_message
As Brad said, "See also" is not a system message but plain user-contributed content. The Translate extension has translation memory (ie. it remembers how user-contributed content was manually translated in the past), and translation memory support was planned for ContentTranslation too (not sure whether that happened already), maybe that can be used to get translations for expressions commonly found in wiki articles. The mediawiki-i18n list is probably a better place to ask about that.
mediawiki-api@lists.wikimedia.org