samundrak / vscode-esdoc-mdn

[BETA] See documentation of any javascript api from mozilla on your visual studio code side by side
https://marketplace.visualstudio.com/items?itemName=samundrak.esdoc-mdn
33 stars 7 forks source link

change doc language #8

Closed Pfurr closed 5 years ago

Pfurr commented 5 years ago

Hi, anyone can you help me to setup this plugin for italian mdn docs in vscode?

Inukares commented 5 years ago

Sure. Key thing to know is how link to mozilla docs looks like. Example: https://developer.mozilla.org/en-US/docs/Web/API/FormData/getAll What we're looking for is /en-US part - This extension bases on links.json file that is just a json object with hardcoded Mozilla urls. Example url part in this file: "javascript building blocks": "/en-US/docs/Learn/JavaScript/Building_blocks", In order to get Italian sites with this extension, you could tweak the first part of the link, to something like /getDefaultLanguageFromUserSettings()/..... and if the user setting would've been set to it-IT this would transform later to: /it-IT/.... With this approach you'd have to modify links.json to actually be links.js and using string literals would easily solve your problem.

Hope that helped you somehow.

Pfurr commented 5 years ago

thank you :) i replaced /it-IT/ in links.json and it work :)

samundrak commented 5 years ago

thanks @Inukares