Re: [Mediawiki-api] Localized (translated) version of sections

2017-01-27 Thread Max Vlasov
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)  wrote:

> i18n
___
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


Re: [Mediawiki-api] Localized (translated) version of sections

2017-01-27 Thread Gergo Tisza
On Fri, Jan 27, 2017 at 7:57 AM, Max Vlasov  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
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


Re: [Mediawiki-api] Localized (translated) version of sections

2017-01-27 Thread Brad Jorsch (Anomie)
On Fri, Jan 27, 2017 at 10:57 AM, Max Vlasov  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=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=allmessages=vector-view-edit=de.[2]


 [1]: https://en.wikipedia.org/wiki/MediaWiki:Vector-view-edit/de
 [2]:
https://en.wikipedia.org/w/api.php?action=query=allmessages=vector-view-edit=de

-- 
Brad Jorsch (Anomie)
Senior Software Engineer
Wikimedia Foundation
___
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


[Mediawiki-api] Localized (translated) version of sections

2017-01-27 Thread 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
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


Re: [Mediawiki-api] parse feature inconsistency

2017-01-27 Thread Max Vlasov
Thanks, it works now

On Fri, Jan 27, 2017 at 4:20 PM, Betacommand  wrote:

> That would be because of capitalization see https://en.wikipedia.org/w/
> api.php?action=parse=sections=Set_theory
>
> On Fri, Jan 27, 2017 at 8:06 AM, Max Vlasov  wrote:
>
>> Hi,
>>
>> Trying to find a way to extract links from a wikipedia see also section,
>> noticed a stackoverflow answer ( http://stackoverflow.com/quest
>> ions/37396367/how-to-extract-links-from-see-also-section-
>> of-an-article-in-wikipedia ), suggesting parsing sections first and then
>> parsing "see also" separately. It had a Chicago working example, but when I
>> try to do the same with the "Set theory" article, I get an empty result, so
>> the url
>>
>> https://en.wikipedia.org/w/api.php?action=parse=section
>> s=Set_Theory
>>
>> returns an empty list of section while there are obviously many sections
>> in this article.
>>
>> Is this expected?
>>
>> Thanks
>>
>> Max
>>
>>
>> ___
>> Mediawiki-api mailing list
>> Mediawiki-api@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
>>
>>
>
> ___
> Mediawiki-api mailing list
> Mediawiki-api@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
>
>
___
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


Re: [Mediawiki-api] parse feature inconsistency

2017-01-27 Thread Betacommand
That would be because of capitalization see
https://en.wikipedia.org/w/api.php?action=parse=sections=Set_theory

On Fri, Jan 27, 2017 at 8:06 AM, Max Vlasov  wrote:

> Hi,
>
> Trying to find a way to extract links from a wikipedia see also section,
> noticed a stackoverflow answer ( http://stackoverflow.com/
> questions/37396367/how-to-extract-links-from-see-also-
> section-of-an-article-in-wikipedia ), suggesting parsing sections first
> and then parsing "see also" separately. It had a Chicago working example,
> but when I try to do the same with the "Set theory" article, I get an empty
> result, so the url
>
> https://en.wikipedia.org/w/api.php?action=parse=
> sections=Set_Theory
>
> returns an empty list of section while there are obviously many sections
> in this article.
>
> Is this expected?
>
> Thanks
>
> Max
>
>
> ___
> Mediawiki-api mailing list
> Mediawiki-api@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
>
>
___
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api


[Mediawiki-api] parse feature inconsistency

2017-01-27 Thread Max Vlasov
Hi,

Trying to find a way to extract links from a wikipedia see also section,
noticed a stackoverflow answer (
http://stackoverflow.com/questions/37396367/how-to-extract-links-from-see-also-section-of-an-article-in-wikipedia
), suggesting parsing sections first and then parsing "see also"
separately. It had a Chicago working example, but when I try to do the same
with the "Set theory" article, I get an empty result, so the url

https://en.wikipedia.org/w/api.php?action=parse=sections=Set_Theory

returns an empty list of section while there are obviously many sections in
this article.

Is this expected?

Thanks

Max
___
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api