Localized (translated) version of sections

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Localized (translated) version of sections

Max Vlasov
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

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Localized (translated) version of sections

Brad Jorsch (Anomie)
On Fri, Jan 27, 2017 at 10:57 AM, Max Vlasov <[hidden email]> 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]

--
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Localized (translated) version of sections

Gergo Tisza
In reply to this post by Max Vlasov
On Fri, Jan 27, 2017 at 7:57 AM, Max Vlasov <[hidden email]> 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 mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Localized (translated) version of sections

Max Vlasov
In reply to this post by Brad Jorsch (Anomie)
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) <[hidden email]> wrote:
i18n



_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api