dijs / wiki

Wikipedia Interface for Node.js
MIT License
313 stars 62 forks source link

Changing language of a page #59

Closed arliber closed 6 years ago

arliber commented 7 years ago

Hello, I'm trying to get results to a certain query in 2 languages. I know I can change the API URL but it won't help as the query returns a result on when searched for in English so looks like I need to search for the English version first and then get somehow to the page of the same entry in the desired language.

What would be the most efficient way of doing so? I know there is a parameter called lllang in the official API but I'm not sure how to apply it through wikijs while making the request.

Thanks in advance!

dijs commented 6 years ago

Hi, sorry this reply is so late.

Do you have an example of a page?

Can this already be done manually?

dijs commented 6 years ago

Ah, I see it now, in the bottom left corner this exists.

dijs commented 6 years ago

I added the langlinks page method in v4.3.0

It returns a list of different translations with the language code and the page title.

Good luck!

arliber commented 6 years ago

Thank you so much! I'll give it a try ASAP