The medals js should be available in spanish too - You're right, it should be using i18n to allow translating the text to other languages, but unfortunately it's an old script that wasn't written this way. Until someone dedicates the efforts to adjust it for multiple languages, it would stick to English.
How do you make js scripts - That question is a little vague. If you're looking to learning JS in general, there are many free resources on the web. Not everything is relevant to Fandom, but still you'll have to ask a more focused question in order to get a useful answer.
How do you make them compatible with other languages - Do you mean programming languages or regular languages? Generally scripts here on Dev use I18n-js to allow using of multiple languages, and then various users add the actual translations. If you want to contribute Spanish translations to script that support it, you're welcome.