Spanish vocabulary from "Harry Potter y la piedra filosofal"

Recently, I've been attempting to improve my Spanish by reading Harry Potter y la piedra filosofal, the Spanish version of Harry Potter and the Sorcerer's Stone. It's definitely improving my vocabulary, as there are many words I've needed to look up. I've listed many of them below, in the hopes this list may be helpful to others as well.

To make this slightly more relevant to my usual topic of programming languages, I've added Javascript that will show or hide the English translations, which will also show up if you hover over a link. (See the end for explanation of the Javascript.)

How the Javascript works

I'm including some programming content for my regular blog readers, since this is a bit off topic. If you're interested in the Spanish, you can stop reading here :-)

I have two CSS classes, one for the enabled text, and one for the disabled text. I simply change the color to show and hide the text. The #f6f6f6 color is to match the background of my blog page, which isn't quite white.

<style TYPE="text/css"> 
       .enabled {color: black}
       .disabled {color: #f6f6f6}
</style>
Next, each word entry has a span tag around the English text that I want to show or hide:
<a href="http://..." title="to add">añadir</a>
<span class="enabled"> - to add</span>
Then, I have a Javscript function that will toggle the class for each span tag. It simply loops through all the span tags switching ones with the enabled class to the disabled class and vice versa. Other span tags are left alone.
<script language="JavaScript">
function toggle() {
 elts = document.getElementsByTagName("span");
 for (var i = 0; i < elts.length; i++) {
  if (elts[i].className == "enabled") {
   elts[i].className = "disabled";
  } else if (elts[i].className == "disabled") {
   elts[i].className = "enabled";
  }
 }
}
</script>
Finally, the button calls the Javascript toggle routine to toggle the visibility.
<button onclick="toggle();">Show/Hide English</button>

9 comments:

  1. suerte con tu aprendizaje del español, lenguaje complicado donde los haya (bastante mas que arc :-P )

    ReplyDelete
  2. pasé unos meses viviendo en México para mejorar mi español, esperas viajar a algún país hispanohablante o quizás ya lo has hecho? :)

    ReplyDelete
  3. The Spanish language is one of the world’s most important languages, spoken by people in many parts of the globe. It is commonly spoken and understood. More than 400 million people call Spanish their native language. Mexico, Columbia, Panama, Cuba, Spain, Chile, Uruguay — these are just a few countries where Spanish is the dominant language.But just because many people speak the language, that is not the only good reason why you should learn Spanish.

    ReplyDelete
  4. This is wonderful. I just imported it into dict.cc's vocabulary trainer: http://enes.my.dict.cc/print/657948/

    Of course, what I really need at this point is a list of Spanish Harry Potter 2. :-)

    ReplyDelete
  5. What is canturreaba? iTranslate doesn't know. It's in the paragraph with "Our story begins when..."

    ReplyDelete
  6. "Canturreaba" is to sing softly.

    ReplyDelete
  7. Thank you so much for doing this - I appreciate how much work has gone into it. I am about to start reading the Spanish version of this book so this is very helpful. I have looked on many websites to try and get the Spanish audio book to help with pronunciation and to listen to as I drive, but have not had any success. Were you able to find the audiobook anywhere?

    ReplyDelete
  8. Thanks for the list. I'm about to start this Harry Potter book and was looking for some vocabulary to study prior to reading it. I appreciate your effort.

    ReplyDelete
  9. Hola!!. Hay algunos errores de traducción y algunos no son sinónimos !!

    ReplyDelete